0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-09-22 10:43:39 -04:00

compiler.h: add redundant cast to quiet Watcom warning

Add a redundant cast in watcom_switch_hack() to quiet a Watcom
warning, and remove open-coded implementation of the Watcom switch
hack.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin
2017-03-01 00:52:48 -08:00
parent e29c7bb241
commit e90a89abe4
2 changed files with 2 additions and 5 deletions

View File

@@ -259,7 +259,7 @@ size_t strnlen(const char *s, size_t maxlen);
static inline unsigned int watcom_switch_hack(uint64_t x) static inline unsigned int watcom_switch_hack(uint64_t x)
{ {
if (x > UINT_MAX) if (x > (uint64_t)UINT_MAX)
return BOGUS_CASE; return BOGUS_CASE;
else else
return (unsigned int)x; return (unsigned int)x;

View File

@@ -1140,10 +1140,7 @@ static void obj_out(int32_t segto, const void *data,
ldata += size; ldata += size;
} }
if (size > UINT_MAX) switch (size) {
size = 0;
switch ((unsigned int)size) {
default: default:
nasm_error(ERR_NONFATAL, "OBJ format can only handle 16- or " nasm_error(ERR_NONFATAL, "OBJ format can only handle 16- or "
"32-byte relocations"); "32-byte relocations");