Suppress warnings for suspicious use of "enum" constants.
authorBen Pfaff <blp@cs.stanford.edu>
Wed, 26 Sep 2012 00:02:21 +0000 (17:02 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 26 Sep 2012 04:20:52 +0000 (21:20 -0700)
In each case, the code is using values of enums in valid ways that
GCC 4.7 does not expect, so use a cast to suppress the warnings.

src/language/command.c
src/language/data-io/inpt-pgm.c
src/language/data-io/placement-parser.c

index 8580a18374feeb38569834f9ad5cdb36bab69571..0502ff9d00042e473d32d50235aedd4d150d35f1 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 1997-9, 2000, 2009, 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 1997-9, 2000, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -362,7 +362,7 @@ report_state_mismatch (const struct command *command, enum cmd_state state)
   assert (!in_correct_state (command, state));
   if (state == CMD_STATE_INITIAL || state == CMD_STATE_DATA)
     {
-      switch (command->states)
+      switch ((int) command->states)
         {
           /* One allowed state. */
         case S_INITIAL:
index 36c58c859122fc5a0c6f9322bd46ed102f1af135..ccd53be04e4199913635d1568aa4af774459e36f 100644 (file)
@@ -107,7 +107,7 @@ cmd_input_program (struct lexer *lexer, struct dataset *ds)
       enum cmd_result result;
 
       result = cmd_parse_in_state (lexer, ds, CMD_STATE_INPUT_PROGRAM);
-      if (result == CMD_END_CASE)
+      if (result == (enum cmd_result) CMD_END_CASE)
         {
           emit_END_CASE (ds, inp);
           saw_END_CASE = true;
index cf9981de8f88f93fe028de7ce4ddfcef6e55a929..3360e8d739dc46a2890dfb063fa225fd3b3e7c26 100644 (file)
@@ -270,7 +270,7 @@ bool
 execute_placement_format (const struct fmt_spec *format,
                           int *record, int *column)
 {
-  switch (format->type)
+  switch ((int) format->type)
     {
     case PRS_TYPE_X:
       *column += format->w;