]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - Ada95/gen/gen.c
ncurses 5.7 - patch 20100904
[ncurses.git] / Ada95 / gen / gen.c
index 24c0f08715634881ad85d56bb39937a0c5630960..31391864d1b0f98e1fc66ef02279bf87ee39d78c 100644 (file)
@@ -32,7 +32,7 @@
 
 /*
     Version Control
-    $Id: gen.c,v 1.52 2010/02/20 21:59:56 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 <menu.h>
 #include <form.h>
 
+#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);
@@ -1495,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: