X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Fgen%2Fgen.c;fp=Ada95%2Fgen%2Fgen.c;h=31391864d1b0f98e1fc66ef02279bf87ee39d78c;hp=3ab2b5e1d31e6b86baf065a66da78d6b71660cfa;hb=275aeb5889b10a51796b311f3773aeaea4d0a754;hpb=d4ff840fddef2f6deb4a3daeb26d398a93b58dd2 diff --git a/Ada95/gen/gen.c b/Ada95/gen/gen.c index 3ab2b5e1..31391864 100644 --- a/Ada95/gen/gen.c +++ b/Ada95/gen/gen.c @@ -32,7 +32,7 @@ /* Version Control - $Id: gen.c,v 1.53 2010/05/01 17:08:30 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 @@ -57,6 +57,7 @@ #include #include +#define UChar(c) ((unsigned char)(c)) #define RES_NAME "Reserved" static const char *model = ""; @@ -445,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); } @@ -771,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);