diff --git a/include/ChangeLog b/include/ChangeLog index b88ca7880..b7607afbd 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,10 @@ +2003-05-15 Jim Blandy + + * libiberty.h (hex_value): Make the value an unsigned int, to + avoid unexpected sign-extension when cast to unsigned types larger + than int --- like bfd_vma, on some platforms. + (_hex_value): Update declaration. + 2003-05-09 Alan Modra * xtensa-isa-internal.h (xtensa_isa_module_struct): Remove const on diff --git a/include/libiberty.h b/include/libiberty.h index 676ceaba4..761b2cf06 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -254,12 +254,12 @@ extern double physmem_available PARAMS ((void)); #define _hex_array_size 256 #define _hex_bad 99 -extern const char _hex_value[_hex_array_size]; +extern const unsigned char _hex_value[_hex_array_size]; extern void hex_init PARAMS ((void)); #define hex_p(c) (hex_value (c) != _hex_bad) /* If you change this, note well: Some code relies on side effects in the argument being performed exactly once. */ -#define hex_value(c) (_hex_value[(unsigned char) (c)]) +#define hex_value(c) ((unsigned int) _hex_value[(unsigned char) (c)]) /* Definitions used by the pexecute routine. */