From 7e507cd28db195418c8d98f3cf30c3a001a4a16c Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 8 Oct 2008 07:23:44 +0000 Subject: [PATCH] Merge [2096] and [2097] from trunk (C89 compliance and util.h robustness). svn path=/branches/yasm-0.7.x/; revision=2141 --- libyasm/errwarn.c | 4 ++++ tools/re2c/main.c | 11 +++++++---- util.h | 4 ---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/libyasm/errwarn.c b/libyasm/errwarn.c index 64b2f9eb..26d7f072 100644 --- a/libyasm/errwarn.c +++ b/libyasm/errwarn.c @@ -38,6 +38,10 @@ #define MSG_MAXSIZE 1024 +#if !defined(HAVE_TOASCII) || defined(lint) +# define toascii(c) ((c) & 0x7F) +#endif + /* Default handlers for replacable functions */ static /*@exits@*/ void def_internal_error_ (const char *file, unsigned int line, const char *message); diff --git a/tools/re2c/main.c b/tools/re2c/main.c index f0baaf61..94843160 100644 --- a/tools/re2c/main.c +++ b/tools/re2c/main.c @@ -45,20 +45,23 @@ static void usage() "-? -h --help Display this info.\n" "\n" "-b --bit-vectors Implies -s. Use bit vectors as well in the attempt to\n" - " coax better code out of the compiler. Most useful for\n" + " coax better code out of the compiler. Most useful for\n"); + fprintf(stderr, " specifications with more than a few keywords (e.g. for\n" " most programming languages).\n" "\n" "-e --ecb Cross-compile from an ASCII platform to\n" " an EBCDIC one.\n" - "\n" + "\n"); + fprintf(stderr, "-s --nested-ifs Generate nested ifs for some switches. Many compilers\n" " need this assist to generate better code.\n" "\n" "-f --storable-state Generate a scanner with support for storable state\n" "\n" "-o --output=output Specify the output file instead of stdout\n" - "\n" + "\n"); + fprintf(stderr, "-d --debug-output Creates a parser that dumps information during\n" " about the current position and in which state the\n" " parser is.\n" @@ -159,7 +162,7 @@ int main(int argc, char *argv[]) } } - // set up the output stream + /* set up the output stream */ if (outputFileName == 0 || (fileName[0] == '-' && fileName[1] == '\0')) { outputFileName = mystrdup(""); output = stdout; diff --git a/util.h b/util.h index f19792e8..f1886a23 100644 --- a/util.h +++ b/util.h @@ -116,10 +116,6 @@ # define USE_OUR_OWN_STRCASECMP #endif -#if !defined(HAVE_TOASCII) || defined(lint) -# define toascii(c) ((c) & 0x7F) -#endif - #include #ifdef HAVE_SYS_CDEFS_H -- 2.49.0