From patchwork Thu Dec 7 18:19:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaakov Selkowitz X-Patchwork-Id: 121071 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8703239qgn; Thu, 7 Dec 2017 10:29:30 -0800 (PST) X-Google-Smtp-Source: AGs4zMaz7Oxu4wa7Ogyulz+/w8+UCrpkFq0krIOV7OBgUid+0bxvxbJBJOvoHNkmZ/59MC+D9Mrf X-Received: by 10.101.68.65 with SMTP id e1mr25745705pgq.282.1512671370313; Thu, 07 Dec 2017 10:29:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512671370; cv=none; d=google.com; s=arc-20160816; b=Kxo5jgCyVyoM7yW90xLZL6tPW6IRRtCrobgouoNyvmMY5kYMjuXNL16ma41vfw/tw2 SX1Cv0ens58f8ANHuQPABUYzsPPbjooxMByicLnoxFyjILCgaAHQCIqxtCpocqbmYgl5 3aAuC8iZEtA0KjYGrxe+Fb5nXd0gd4yHQeuJf5cJjJ8kGHc5Ckv1TjT3suggff781DcZ /lGbxllYf6fTbO5UMo7xTmpOf0znR59XMAe7ZKGidoVulU9oWluBoQMEEu01tWvtYYBu xFlKfQPOPIkyCAsP4l/HeP2PXp0+/m9/SkTSfP/J3K8Vbb2IJzXm9yxnpPUhG7ZQRtL9 OnOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from:delivered-to :sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=IphRgymTREI6ysq4SAJ/7+aCRXdlTq5mdBv1B7PaYkc=; b=FefONI1/FN5Eiom630v0ZoqcG+saBbIZAPjRWekkJp4aM9tZUtsICWYM+lTN4h45TN Dyax9QdkkdeUE9DwLne1diZvqIdoIvl2HRaNCjQH4Xh25+nSOHPQvBoBJ16I9TuYY6LX 0U3Fg+FgWF9vd8mGb5hfx/ta0o2F59bcIOGpZz54tcOA8AAtIYCcaF+cXr1oS+3x9tYL EFxObKzGUYu935vYLmy/BfiBvyYDI70YWjiPXqL1TZZMJCSHaI8OD3ZHgDDe6ZNgi4vz 0tkZDDxdODY+E4CewuN4wDbkQvh8dEcHqI74YUo9mAoEdCUjhC07Wft6nraPtXMchNTg MEJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=N6P7cOBz; spf=pass (google.com: domain of newlib-return-15503-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-15503-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id k14si3897387pln.223.2017.12.07.10.29.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2017 10:29:30 -0800 (PST) Received-SPF: pass (google.com: domain of newlib-return-15503-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=N6P7cOBz; spf=pass (google.com: domain of newlib-return-15503-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-15503-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=DtXdEx5xDb9B5c8pEqkWjQMiJdo4Lgy Ok6Viy2Z8Wy4E49TkGPRLjBERxJ8rQ3Re0qUQDlugNnZowmGsW6wzt7uebAnHFCa c2VbtLlT6oeGIWIr8BTJgbEsq9PWEZW3exKRmlcBW8XkZ8IZsdI8HubSmiEpJj3y Wo21h3W2MkTQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=kUJPVUyTrvWo+0GAZGnyLoppL/Y=; b=N6P7c OBzHlsR/tLKsM6BoEDlKlI646DlQiuTTf+JKFzyyZvrbbZRMOmvz4MTguFMqGcA5 TkkY1jnu58ptPguIE76Hs085jFh0G8RbEFSv/Ub/k4orO1a7f21YruPO0E6J+Wpt tnHIyOFjEDAd3Rt4zCyxVx6FYs1DYwVm6lWBYQ= Received: (qmail 36274 invoked by alias); 7 Dec 2017 18:29:02 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Delivered-To: mailing list newlib@sourceware.org Received: (qmail 36151 invoked by uid 89); 7 Dec 2017 18:29:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, T_RP_MATCHES_RCVD, UNSUBSCRIBE_BODY autolearn=ham version=3.3.2 spammy=1618, isp X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Dec 2017 18:29:00 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 515F37CB95 for ; Thu, 7 Dec 2017 18:20:13 +0000 (UTC) Received: from localhost.localdomain (ovpn-120-70.rdu2.redhat.com [10.10.120.70]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C43597D89A for ; Thu, 7 Dec 2017 18:20:12 +0000 (UTC) From: Yaakov Selkowitz To: newlib@sourceware.org Subject: [PATCH v2 17/17] ansification: remove ansidecl.h from makedoc Date: Thu, 7 Dec 2017 12:19:09 -0600 Message-Id: <20171207181909.1112-18-yselkowi@redhat.com> In-Reply-To: <20171207181909.1112-1-yselkowi@redhat.com> References: <20171207181909.1112-1-yselkowi@redhat.com> Signed-off-by: Yaakov Selkowitz --- newlib/doc/ansidecl.h | 95 ------------------------------------ newlib/doc/makedoc.c | 132 +++++++++++++++++++------------------------------- 2 files changed, 51 insertions(+), 176 deletions(-) delete mode 100644 newlib/doc/ansidecl.h -- 2.15.1 diff --git a/newlib/doc/ansidecl.h b/newlib/doc/ansidecl.h deleted file mode 100644 index f67f93bea..000000000 --- a/newlib/doc/ansidecl.h +++ /dev/null @@ -1,95 +0,0 @@ -/* ANSI and traditional C compatability macros - Copyright 1991 Free Software Foundation, Inc. - This file is part of the GNU C Library. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* ANSI and traditional C compatibility macros - - Some ANSI environments are "broken" in the sense that __STDC__ cannot be - relied upon to have it's intended meaning. Therefore we must use our own - concoction: _HAVE_STDC. Always use _HAVE_STDC instead of __STDC__ in newlib - sources! - - ANSI C is assumed if _HAVE_STDC is #defined. - - Macro ANSI C definition Traditional C definition - ----- ---- - ---------- ----------- - ---------- - PTR `void *' `char *' - LONG_DOUBLE `long double' `double' - CONST `const' `' - VOLATILE `volatile' `' - SIGNED `signed' `' - PTRCONST `void *const' `char *' - - DEFUN(name, arglist, args) - - Defines function NAME. - - ARGLIST lists the arguments, separated by commas and enclosed in - parentheses. ARGLIST becomes the argument list in traditional C. - - ARGS list the arguments with their types. It becomes a prototype in - ANSI C, and the type declarations in traditional C. Arguments should - be separated with `AND'. For functions with a variable number of - arguments, the last thing listed should be `DOTS'. - - DEFUN_VOID(name) - - Defines a function NAME, which takes no arguments. - - EXFUN(name, prototype) - - Is used in an external function declaration. - In ANSI C it is `NAMEPROTOTYPE' (so PROTOTYPE should be enclosed in - parentheses). In traditional C it is `NAME()'. - For a function that takes no arguments, PROTOTYPE should be `(NOARGS)'. - - For example: - extern int EXFUN(printf, (CONST char *format DOTS)); - int DEFUN(fprintf, (stream, format), - FILE *stream AND CONST char *format DOTS) { ... } - void DEFUN_VOID(abort) { ... } -*/ - -#ifndef _ANSIDECL_H - -#define _ANSIDECL_H 1 - - -/* Every source file includes this file, - so they will all get the switch for lint. */ -/* LINTLIBRARY */ - - - -#define PTR void * -#define PTRCONST void *CONST -#define LONG_DOUBLE long double - -#define AND , -#define NOARGS void -#define CONST const -#define VOLATILE volatile -#define SIGNED signed -#define DOTS , ... - -#define EXFUN(name, proto) name proto -#define DEFUN(name, arglist, args) name(args) -#define DEFUN_VOID(name) name(NOARGS) - - - -#endif /* ansidecl.h */ diff --git a/newlib/doc/makedoc.c b/newlib/doc/makedoc.c index 23d5e2a04..1df08a13d 100644 --- a/newlib/doc/makedoc.c +++ b/newlib/doc/makedoc.c @@ -35,7 +35,6 @@ There is no -#include "ansidecl.h" #include #include #include @@ -67,25 +66,23 @@ typedef struct buffer -static void DEFUN(init_string_with_size,(buffer, size), - string_type *buffer AND - unsigned int size ) +static void +init_string_with_size (string_type *buffer, unsigned int size) { buffer->write_idx = 0; buffer->size = size; buffer->ptr = malloc(size); } -static void DEFUN(init_string,(buffer), - string_type *buffer) +static void +init_string (string_type *buffer) { init_string_with_size(buffer, DEF_SIZE); } -static int DEFUN(find, (str, what), - string_type *str AND - char *what) +static int +find (string_type *str, char *what) { unsigned int i; char *p; @@ -101,30 +98,28 @@ static int DEFUN(find, (str, what), } -static void DEFUN(write_buffer,(buffer), - string_type *buffer) +static void +write_buffer (string_type *buffer) { fwrite(buffer->ptr, buffer->write_idx, 1, stdout); } -static void DEFUN(delete_string,(buffer), - string_type *buffer) +static void +delete_string (string_type *buffer) { free(buffer->ptr); } -static char *DEFUN(addr, (buffer, idx), - string_type *buffer AND - unsigned int idx) +static char * +addr (string_type *buffer, unsigned int idx) { return buffer->ptr + idx; } -static char DEFUN(at,(buffer, pos), - string_type *buffer AND - unsigned int pos) +static char +at (string_type *buffer, unsigned int pos) { if ( pos >= buffer->write_idx) { @@ -133,9 +128,8 @@ static char DEFUN(at,(buffer, pos), return buffer->ptr[pos]; } -static void DEFUN(catchar,(buffer, ch), - string_type *buffer AND - char ch) +static void +catchar (string_type *buffer, char ch) { if (buffer->write_idx == buffer->size) { @@ -147,9 +141,8 @@ static void DEFUN(catchar,(buffer, ch), } -static void DEFUN(overwrite_string,(dst, src), - string_type *dst AND - string_type *src) +static void +overwrite_string (string_type *dst, string_type *src) { free(dst->ptr); dst->size = src->size; @@ -157,9 +150,8 @@ static void DEFUN(overwrite_string,(dst, src), dst->ptr = src->ptr; } -static void DEFUN(catstr,(dst, src), - string_type *dst AND - string_type *src) +static void +catstr (string_type *dst, string_type *src) { unsigned int i; for (i = 0; i < src->write_idx; i++) @@ -169,9 +161,8 @@ static void DEFUN(catstr,(dst, src), } -static void DEFUN(cattext,(buffer, string), - string_type *buffer AND - char *string) +static void +cattext (string_type *buffer, char *string) { while (*string) @@ -181,10 +172,8 @@ static void DEFUN(cattext,(buffer, string), } } -static void DEFUN(catbuf,(buffer, buf, len), - string_type *buffer AND - char *buf AND - unsigned int len) +static void +catbuf (string_type *buffer, char *buf, unsigned int len) { while (len--) @@ -197,9 +186,7 @@ static void DEFUN(catbuf,(buffer, buf, len), static unsigned int -DEFUN(skip_white_and_stars,(src, idx), - string_type *src AND - unsigned int idx) +skip_white_and_stars (string_type *src, unsigned int idx) { while (isspace(at(src,idx)) || (at(src,idx) == '*' && at(src,idx +1) !='/')) @@ -216,7 +203,7 @@ string_type *tos; unsigned int idx = 0; /* Pos in input buffer */ string_type *ptr; /* and the buffer */ -typedef void (*stinst_type)(NOARGS); +typedef void (*stinst_type)(void); stinst_type *pc; stinst_type sstack[STACK]; stinst_type *ssp = &sstack[0]; @@ -238,10 +225,10 @@ struct dict_struct }; typedef struct dict_struct dict_type; -#define WORD(x) static void x(NOARGS) +#define WORD(x) static void x(void) -static void DEFUN(exec,(word), - dict_type *word) +static void +exec (dict_type *word) { pc = word->code; while (*pc) @@ -299,9 +286,7 @@ WORD(push_text) */ static void -DEFUN(remove_noncomments,(src,dst), - string_type *src AND - string_type *dst) +remove_noncomments (string_type *src, string_type *dst) { unsigned int idx = 0; @@ -354,7 +339,7 @@ DEFUN(remove_noncomments,(src,dst), */ static void -DEFUN_VOID(exfunstuff) +exfunstuff (void) { unsigned int openp; unsigned int fname; @@ -482,7 +467,7 @@ WORD(manglecomments) /* Mod tos so that only lines with leading dots remain */ static void -DEFUN_VOID(outputdots) +outputdots (void) { unsigned int idx = 0; string_type out; @@ -726,9 +711,7 @@ WORD(do_fancy_stuff) } /* A command is all upper case,and alone on a line */ static int -DEFUN( iscommand,(ptr, idx), - string_type *ptr AND - unsigned int idx) +iscommand (string_type *ptr, unsigned int idx) { unsigned int len = 0; @@ -757,10 +740,7 @@ DEFUN( iscommand,(ptr, idx), unsigned int -DEFUN(copy_past_newline,(ptr, idx, dst), - string_type *ptr AND - unsigned int idx AND - string_type *dst) +copy_past_newline (string_type *ptr, unsigned int idx, string_type *dst) { while (at(ptr, idx) && at(ptr, idx) != '\n') { @@ -1020,9 +1000,7 @@ WORD(maybecatstr) } char * -DEFUN(nextword,(string, word), - char *string AND - char **word) +nextword (char *string, char **word) { char *word_start; int idx; @@ -1098,8 +1076,7 @@ DEFUN(nextword,(string, word), } dict_type *root; dict_type * -DEFUN(lookup_word,(word), - char *word) +lookup_word (char *word) { dict_type *ptr = root; while (ptr) { @@ -1113,7 +1090,8 @@ DEFUN(lookup_word,(word), } -static int DEFUN_VOID(perform) +static int +perform (void) { tos = stack; int errors = 0; @@ -1153,8 +1131,7 @@ static int DEFUN_VOID(perform) } dict_type * -DEFUN(newentry,(word), - char *word) +newentry (char *word) { dict_type *new = (dict_type *)malloc(sizeof(dict_type)); new->word = word; @@ -1169,9 +1146,7 @@ DEFUN(newentry,(word), unsigned int -DEFUN(add_to_definition,(entry, word), - dict_type *entry AND - stinst_type word) +add_to_definition (dict_type *entry, stinst_type word) { if (entry->code_end == entry->code_length) { @@ -1192,9 +1167,7 @@ return entry->code_end++; void -DEFUN(add_intrinsic,(name, func), - char *name AND - void (*func)(NOARGS)) +add_intrinsic (char *name, void (*func)(void)) { dict_type *new = newentry(name); add_to_definition(new, func); @@ -1202,8 +1175,7 @@ DEFUN(add_intrinsic,(name, func), } void -DEFUN(add_var,(name), - char *name) +add_var (char *name) { dict_type *new = newentry(name); add_to_definition(new, push_number); @@ -1216,9 +1188,7 @@ DEFUN(add_var,(name), int -DEFUN(compile, (string), - char *string) - +compile (char *string) { int ret=0; /* add words to the dictionary */ @@ -1301,7 +1271,8 @@ return(ret); } -static void DEFUN_VOID(bang) +static void +bang (void) { *(uintptr_t *)((isp[0])) = isp[-1]; isp-=2; @@ -1324,9 +1295,8 @@ WORD(hello) -static void DEFUN(read_in, (str, file), - string_type *str AND - FILE *file) +static void +read_in (string_type *str, FILE *file) { char buff[10000]; unsigned int r; @@ -1344,16 +1314,16 @@ static void DEFUN(read_in, (str, file), #if 0 -static void DEFUN_VOID(usage) +static void +usage (void) { fprintf(stderr,"usage: -[i|v] -f macrofile file\n"); exit(33); } #endif -int DEFUN(main,(ac,av), -int ac AND -char *av[]) +int +main (int ac, char *av[]) { unsigned int i; int status = 0;