From: Julian Seward Date: Fri, 17 Oct 2014 15:05:01 +0000 (+0000) Subject: -Wmissing-enum seems to have arrived at the MacOS builds for some X-Git-Tag: svn/VALGRIND_3_11_0~914 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f015e52c059cca27c30c111c4b4c3ad9e52aee6d;p=thirdparty%2Fvalgrind.git -Wmissing-enum seems to have arrived at the MacOS builds for some reason, and complains about missing cases in sr_isError, sr_Res, sr_ResHI, sr_Err. Add cases to keep it happy. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14634 --- diff --git a/include/pub_tool_basics.h b/include/pub_tool_basics.h index 4e3016004c..26a22e3196 100644 --- a/include/pub_tool_basics.h +++ b/include/pub_tool_basics.h @@ -217,9 +217,14 @@ static inline Bool sr_EQ ( SysRes sr1, SysRes sr2 ) { static inline Bool sr_isError ( SysRes sr ) { switch (sr._mode) { - case SysRes_UNIX_ERR: return True; - default: return False; + case SysRes_UNIX_ERR: + return True; /* should check tags properly and assert here, but we can't here */ + case SysRes_MACH: + case SysRes_MDEP: + case SysRes_UNIX_OK: + default: + return False; } } @@ -227,22 +232,38 @@ static inline UWord sr_Res ( SysRes sr ) { switch (sr._mode) { case SysRes_MACH: case SysRes_MDEP: - case SysRes_UNIX_OK: return sr._wLO; - default: return 0; /* should assert, but we can't here */ + case SysRes_UNIX_OK: + return sr._wLO; + /* should assert, but we can't here */ + case SysRes_UNIX_ERR: + default: + return 0; } } static inline UWord sr_ResHI ( SysRes sr ) { switch (sr._mode) { - case SysRes_UNIX_OK: return sr._wHI; - default: return 0; /* should assert, but we can't here */ + case SysRes_UNIX_OK: + return sr._wHI; + /* should assert, but we can't here */ + case SysRes_MACH: + case SysRes_MDEP: + case SysRes_UNIX_ERR: + default: + return 0; } } static inline UWord sr_Err ( SysRes sr ) { switch (sr._mode) { - case SysRes_UNIX_ERR: return sr._wLO; - default: return 0; /* should assert, but we can't here */ + case SysRes_UNIX_ERR: + return sr._wLO; + /* should assert, but we can't here */ + case SysRes_MACH: + case SysRes_MDEP: + case SysRes_UNIX_OK: + default: + return 0; } }