From: Ben Pfaff Date: Wed, 26 Sep 2012 00:02:21 +0000 (-0700) Subject: Suppress warnings for suspicious use of "enum" constants. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=979d5363ef9b22cd865bba3b540d5f4974844f7e;p=pspp Suppress warnings for suspicious use of "enum" constants. 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. --- diff --git a/src/language/command.c b/src/language/command.c index 8580a18374..0502ff9d00 100644 --- a/src/language/command.c +++ b/src/language/command.c @@ -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: diff --git a/src/language/data-io/inpt-pgm.c b/src/language/data-io/inpt-pgm.c index 36c58c8591..ccd53be04e 100644 --- a/src/language/data-io/inpt-pgm.c +++ b/src/language/data-io/inpt-pgm.c @@ -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; diff --git a/src/language/data-io/placement-parser.c b/src/language/data-io/placement-parser.c index cf9981de8f..3360e8d739 100644 --- a/src/language/data-io/placement-parser.c +++ b/src/language/data-io/placement-parser.c @@ -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;