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:
@@ -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;
|
||||||
|
@@ -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");
|
||||||
|
Reference in New Issue
Block a user