X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;ds=sidebyside;f=Ada95%2Fgen%2Fgen.c;h=31391864d1b0f98e1fc66ef02279bf87ee39d78c;hb=36b653e854865c31c56f04d059d78a0d5e3f4e24;hp=4145e409cdabef34d9e567824e47ae8b0419876b;hpb=f36e772702d4b512a4395e2db96470803485b6df;p=ncurses.git diff --git a/Ada95/gen/gen.c b/Ada95/gen/gen.c index 4145e409..31391864 100644 --- a/Ada95/gen/gen.c +++ b/Ada95/gen/gen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998,2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ /* Version Control - $Id: gen.c,v 1.51 2009/12/26 15:45:31 tom Exp $ + $Id: gen.c,v 1.54 2010/09/04 21:19:50 tom Exp $ --------------------------------------------------------------------------*/ /* This program generates various record structures and constants from the @@ -41,7 +41,12 @@ to produce the real source. */ +#ifdef HAVE_CONFIG_H #include +#else +#include +#define HAVE_USE_DEFAULT_COLORS 1 +#endif #include #include @@ -52,6 +57,7 @@ #include #include +#define UChar(c) ((unsigned char)(c)) #define RES_NAME "Reserved" static const char *model = ""; @@ -440,13 +446,14 @@ keydef(const char *name, const char *old_name, int value, int mode) if (mode == 0) /* Generate the new name */ printf(" %-30s : constant Special_Key_Code := 8#%3o#;\n", name, value); else - { /* generate the old name, but only if it doesn't conflict with the old - * name (Ada95 isn't case sensitive!) - */ + { const char *s = old_name; const char *t = name; - while (*s && *t && (toupper(*s++) == toupper(*t++))); + /* generate the old name, but only if it doesn't conflict with the old + * name (Ada95 isn't case sensitive!) + */ + while (*s && *t && (toupper(UChar(*s++)) == toupper(UChar(*t++)))); if (*s || *t) printf(" %-16s : Special_Key_Code renames %s;\n", old_name, name); } @@ -766,7 +773,7 @@ acs_def(const char *name, chtype *a) int c = a - &acs_map[0]; printf(" %-24s : constant Character := ", name); - if (isprint(c) && (c != '`')) + if (isprint(UChar(c)) && (c != '`')) printf("'%c';\n", c); else printf("Character'Val (%d);\n", c); @@ -1490,7 +1497,7 @@ main(int argc, char *argv[]) } printf(" subtype Eti_Error is C_Int range %d .. %d;\n\n", etimin, etimax); - printf(buf); + printf("%s", buf); } break; default: