OSDN Git Service

Warning fixes:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Sep 1998 16:34:45 +0000 (16:34 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Sep 1998 16:34:45 +0000 (16:34 +0000)
* actions.c (id_cmp): Do pointer arithmetic as `long' not `int' to
  ensure enough bits for calculation.
* ch-tree.h (check_text_length): Remove unused parameter.
* convert.c (display_int_cst): Cast a HOST_WIDE_INT argument to
function sprintf into the appropriate type for printing.
* decl.c (print_lang_decl): Use HOST_WIDE_INT_PRINT_DEC as the
format specifier.
(print_mode): Likewise.
(init_decl_processing): Cast the arguments of bcopy/bzero to char *.
* grant.c (grant_array_type): Use HOST_WIDE_INT_PRINT_DEC as
the format specifier.
* inout.c (check_text_length): Remove unused parameter `type'.
(build_chill_associate): Initialize variables `arg1', `arg2',
`arg3', `arg4' and `arg5'.
(build_chill_modify): Likewise.
(scanformcont): Change type of variable `curr' to `unsigned char'.
* lex.c (maybe_downcase): Cast the argument of `tolower' to
`unsigned char'.
* satisfy.c (satisfy): Remove unused parameter in call to
`check_text_length'.
* tasking.c (generate_tasking_code_variable): Pass a HOST_WIDE_INT
as a `long' in call to function `error'.
(decl_tasking_code_variable): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22679 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ch/ChangeLog
gcc/ch/actions.c
gcc/ch/ch-tree.h
gcc/ch/convert.c
gcc/ch/decl.c
gcc/ch/grant.c
gcc/ch/inout.c
gcc/ch/lex.c
gcc/ch/satisfy.c
gcc/ch/tasking.c

index 738bd3c..5eb5e19 100644 (file)
@@ -1,3 +1,37 @@
+Wed Sep 30 19:24:41 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
+
+       * actions.c (id_cmp): Do pointer arithmetic as `long' not `int' to
+       ensure enough bits for calculation.
+
+       * ch-tree.h (check_text_length): Remove unused parameter.
+
+       * convert.c (display_int_cst): Cast a HOST_WIDE_INT argument to
+       function sprintf into the appropriate type for printing.
+
+       * decl.c (print_lang_decl): Use HOST_WIDE_INT_PRINT_DEC as the
+       format specifier.
+       (print_mode): Likewise.
+       (init_decl_processing): Cast the arguments of bcopy/bzero to char *.
+
+       * grant.c (grant_array_type): Use HOST_WIDE_INT_PRINT_DEC as
+       the format specifier.
+
+       * inout.c (check_text_length): Remove unused parameter `type'.
+       (build_chill_associate): Initialize variables `arg1', `arg2',
+       `arg3', `arg4' and `arg5'.
+       (build_chill_modify): Likewise.
+       (scanformcont): Change type of variable `curr' to `unsigned char'.
+
+       * lex.c (maybe_downcase): Cast the argument of `tolower' to
+       `unsigned char'.
+
+       * satisfy.c (satisfy): Remove unused parameter in call to
+       `check_text_length'.
+
+       * tasking.c (generate_tasking_code_variable): Pass a HOST_WIDE_INT
+       as a `long' in call to function `error'.
+       (decl_tasking_code_variable): Likewise.
+
 Wed Sep 30 19:03:02 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * grant.c (decode_decl_selective): Cast switch's enum argument to
index 1172219..cd1c46b 100644 (file)
@@ -127,7 +127,9 @@ static int
 id_cmp (p1, p2)
      tree *p1, *p2;
 {
-  return (int)TREE_VALUE (*p1) - (int)TREE_VALUE (*p2);
+  long diff = (long)TREE_VALUE (*p1) - (long)TREE_VALUE (*p2);
+
+  return (diff < 0) ? -1 : (diff > 0);
 }
 
 /* Build the FUNCTION_TYPE or METHOD_TYPE which may raise exceptions
index ae43dd9..c555677 100644 (file)
@@ -1005,7 +1005,7 @@ extern tree build_chill_writerecord             PROTO((tree, tree));
 extern tree build_chill_writetext               PROTO((tree, tree));
 extern void build_enum_tables                   PROTO((void));
 extern tree build_text_mode                     PROTO((tree, tree, int));
-extern tree check_text_length                   PROTO((tree, tree));
+extern tree check_text_length                   PROTO((tree));
 extern void init_access_location                PROTO((tree, tree));
 extern void init_text_location                  PROTO((tree, tree));
 extern void inout_init                          PROTO((void));
index 48becd0..93d1437 100644 (file)
@@ -589,9 +589,9 @@ display_int_cst (val)
       else if (x == '\n')
        strcpy (buffer, "'^J'");
       else if (x < ' ' || x > '~')
-       sprintf (buffer, "'^(%u)'", x);
+       sprintf (buffer, "'^(%u)'", (unsigned int) x);
       else
-       sprintf (buffer, "'%c'", x);
+       sprintf (buffer, "'%c'", (char) x);
       return buffer;
     case ENUMERAL_TYPE:
       for (fields = TYPE_VALUES (TREE_TYPE (val)); fields != NULL_TREE;
index da08222..9c47359 100644 (file)
@@ -897,7 +897,9 @@ print_lang_decl (file, node, indent)
      int  indent;
 {
   indent_to (file, indent + 3);
-  fprintf (file, "nesting_level %d ", DECL_NESTING_LEVEL (node));
+  fputs ("nesting_level ", file);
+  fprintf (file, HOST_WIDE_INT_PRINT_DEC, DECL_NESTING_LEVEL (node));
+  fputs (" ", file);
   if (DECL_WEAK_NAME (node))
     fprintf (file, "weak_name ");
   if (CH_DECL_SIGNAL (node))
@@ -1437,12 +1439,22 @@ print_mode (mode)
          {
            tree itype = TYPE_DOMAIN (mode);
            if (CH_STRING_TYPE_P (mode))
-             printf (" STRING (%d) OF ",
-                     TREE_INT_CST_LOW (TYPE_MAX_VALUE (itype)));
+             {
+               fputs (" STRING (", stdout);
+               printf (HOST_WIDE_INT_PRINT_DEC,
+                       TREE_INT_CST_LOW (TYPE_MAX_VALUE (itype)));
+               fputs (") OF ", stdout);
+             }
            else
-             printf (" ARRAY (%d:%d) OF ",
-                     TREE_INT_CST_LOW (TYPE_MIN_VALUE (itype)),
-                     TREE_INT_CST_LOW (TYPE_MAX_VALUE (itype)));
+             {
+               fputs (" ARRAY (", stdout);
+               printf (HOST_WIDE_INT_PRINT_DEC,
+                       TREE_INT_CST_LOW (TYPE_MIN_VALUE (itype)));
+               fputs (":", stdout);
+               printf (HOST_WIDE_INT_PRINT_DEC,
+                       TREE_INT_CST_LOW (TYPE_MAX_VALUE (itype)));
+               fputs (") OF ", stdout);
+             }
            mode = TREE_TYPE (mode);
            break;
          }
@@ -3697,16 +3709,16 @@ init_decl_processing ()
          tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE,
          (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
           * sizeof (char)));
-  bcopy (chill_tree_code_length,
-         tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE,
+  bcopy ((char *) chill_tree_code_length,
+         (char *) (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE),
          (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
           * sizeof (int)));
-  bcopy (chill_tree_code_name,
-         tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE,
+  bcopy ((char *) chill_tree_code_name,
+         (char *) (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE),
          (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
           * sizeof (char *)));
   boolean_code_name = (char **) xmalloc (sizeof (char *) * (int) LAST_CHILL_TREE_CODE);
-  bzero (boolean_code_name, sizeof (char *) * (int) LAST_CHILL_TREE_CODE);
+  bzero ((char *) boolean_code_name, sizeof (char *) * (int) LAST_CHILL_TREE_CODE);
 
   boolean_code_name[EQ_EXPR] = "=";
   boolean_code_name[NE_EXPR] = "/=";
index 81162f0..ada788c 100644 (file)
@@ -270,7 +270,8 @@ grant_array_type (type)
       if (TREE_CODE (maxval) == INTEGER_CST)
        {
          char  wrk[20];
-         sprintf (wrk, "%d", TREE_INT_CST_LOW (maxval) + 1);
+         sprintf (wrk, HOST_WIDE_INT_PRINT_DEC,
+                  TREE_INT_CST_LOW (maxval) + 1);
          APPEND (result, wrk);
        }
       else if (TREE_CODE (maxval) == MINUS_EXPR
index 2c5f628..c9af816 100644 (file)
@@ -1615,8 +1615,8 @@ build_text_mode (textlength, indexmode, dynamic)
 }
 
 tree
-check_text_length (type, length)
-     tree type, length;
+check_text_length (length)
+     tree length;
 {
   if (length == NULL_TREE || TREE_CODE (length) == ERROR_MARK)
     return length;
@@ -1750,7 +1750,8 @@ build_chill_associate (assoc, fname, attr)
      tree fname;
      tree attr;
 {
-  tree arg1, arg2, arg3, arg4, arg5, arg6, arg7;
+  tree arg1 = NULL_TREE, arg2 = NULL_TREE, arg3 = NULL_TREE, arg4 = NULL_TREE,
+  arg5 = NULL_TREE, arg6, arg7;
   int had_errors = 0;
   tree result;
 
@@ -1982,7 +1983,8 @@ build_chill_modify (assoc, list)
      tree assoc;
      tree list;
 {
-  tree arg1, arg2, arg3, arg4, arg5, arg6, arg7;
+  tree arg1 = NULL_TREE, arg2 = NULL_TREE, arg3 = NULL_TREE, arg4 = NULL_TREE,
+  arg5 = NULL_TREE, arg6, arg7;
   int had_errors = 0, numargs;
   tree fname = NULL_TREE, attr = NULL_TREE;
   tree result;
@@ -3898,7 +3900,7 @@ scanformcont (fcs, len, fcsptr, lenptr, exprlist, exprptr,
      int *nextargnum;
 {
   fcsstate_t state = FormatText;
-  char curr;
+  unsigned char curr;
   int dig;
 
   while (len--)
index bb841d1..bc50f64 100644 (file)
@@ -877,7 +877,7 @@ maybe_downcase (str)
   while (*str)
     {
       if (ISUPPER ((unsigned char) *str))
-       *str = tolower (*str);
+       *str = tolower ((unsigned char)*str);
       str++;
     }
 }
index 04faa94..2b86078 100644 (file)
@@ -564,7 +564,7 @@ satisfy (exp, chain)
                        else if (CH_IS_TEXT_MODE (exp) &&
                                 DECL_NAME (decl) == get_identifier ("__textlength"))
                          DECL_INITIAL (decl)
-                           = check_text_length (exp, DECL_INITIAL (decl));
+                           = check_text_length (DECL_INITIAL (decl));
                      }
                  }
                else if (TREE_CODE (decl) == FIELD_DECL)
index 5ae992f..c0c1c9c 100644 (file)
@@ -154,8 +154,8 @@ generate_tasking_code_variable (name, tasking_code_ptr, quasi_flag)
       /* check for value should be assigned is out of range */
       if (TREE_INT_CST_LOW (*tasking_code_ptr) >
          TREE_INT_CST_LOW (TYPE_MAX_VALUE (chill_taskingcode_type_node)))
-         error ("Tasking code %d out of range for `%s'.",
-                TREE_INT_CST_LOW (*tasking_code_ptr),
+         error ("Tasking code %ld out of range for `%s'.",
+                (long) TREE_INT_CST_LOW (*tasking_code_ptr),
                 IDENTIFIER_POINTER (name));
     }
 
@@ -201,8 +201,8 @@ decl_tasking_code_variable (name, tasking_code_ptr, quasi_flag)
       /* check for value should be assigned is out of range */
       if (TREE_INT_CST_LOW (*tasking_code_ptr) >
          TREE_INT_CST_LOW (TYPE_MAX_VALUE (chill_taskingcode_type_node)))
-         error ("Tasking code %d out of range for `%s'.",
-                TREE_INT_CST_LOW (*tasking_code_ptr),
+         error ("Tasking code %ld out of range for `%s'.",
+                (long) TREE_INT_CST_LOW (*tasking_code_ptr),
                 IDENTIFIER_POINTER (name));
     }