]> sourceware.org Git - newlib-cygwin.git/commitdiff
libiberty/ChangeLog:
authorJim Blandy <jimb@codesourcery.com>
Thu, 15 May 2003 19:08:25 +0000 (19:08 +0000)
committerJim Blandy <jimb@codesourcery.com>
Thu, 15 May 2003 19:08:25 +0000 (19:08 +0000)
2003-05-14  Jim Blandy  <jimb@redhat.com>

* hex.c (_hex_value): Make this unsigned.
(hex_value): Update documentation for new return type.  hex_value
now expands to an unsigned int expression, to avoid unexpected
sign extension when we store it in a bfd_vma, which is larger than
int on some platforms.
* functions.texi: Regenerated.

include/ChangeLog:
2003-05-14  Jim Blandy  <jimb@redhat.com>

* 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.

include/ChangeLog
include/libiberty.h

index b88ca7880781d6c33441296f90e1c7880a2759f9..b7607afbddf6e5cad446767b8c339657c44dc68e 100644 (file)
@@ -1,3 +1,10 @@
+2003-05-15  Jim Blandy  <jimb@redhat.com>
+
+       * 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  <amodra@bigpond.net.au>
 
        * xtensa-isa-internal.h (xtensa_isa_module_struct): Remove const on
index 676ceaba4a9cdc0f8d0351b389cf2ba3d308d2e4..761b2cf060ff5a33f4cfe7229099b85ef55351c9 100644 (file)
@@ -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.  */
 
This page took 0.033108 seconds and 5 git commands to generate.