Avoid warnings about comparisons that are always true.
authorBen Pfaff <blp@nicira.com>
Fri, 15 Apr 2011 16:39:08 +0000 (09:39 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 18 Apr 2011 17:26:17 +0000 (10:26 -0700)
commit5160ab34f8e97de8985d75d77c029324e4bccdab
treec3aa2dc95435be85394712bee7bbbca978639baf
parent858f285284634a2933079cc6e68cc088c81cbe1d
Avoid warnings about comparisons that are always true.

The range of "enum" types varies from one ABI to another.  If the enums
being tested in these functions happen to be 16 bits wide, then GCC may
issue a warning because, in such a case, the comparison is always true.

Using an int instead of a uint16_t avoids that particular problem and
should suppress the warning.

Fixes the following reported warnings:

lib/ofp-print.c:240: warning: comparison is always true due to limited
range of data type
lib/ofp-util.c:1973: warning: comparison is always false due to limited
range of data type

Reported-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
lib/ofp-print.c
lib/ofp-util.c