diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-03 16:53:07 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-03 16:53:07 +0000 |
commit | e300132e2b285b136e160f3e5202c2a4c41c4449 (patch) | |
tree | fb30462ed60f6fd81eee61720aa13d5dcdc98ed3 /libiberty | |
parent | d294874e44e6965ad6a305fff365f34298d72ba9 (diff) |
Mainline merge as of 2003-05-25.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@67386 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 13 | ||||
-rw-r--r-- | libiberty/config.table | 4 | ||||
-rw-r--r-- | libiberty/functions.texi | 8 | ||||
-rw-r--r-- | libiberty/hex.c | 12 |
4 files changed, 31 insertions, 6 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 066980339ba..d26d5ef3e07 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,16 @@ +2003-05-19 Kelley Cook <kelleycook@wideopenwest.com> + + * config.table: Accept i[345867]86 variant. + +2003-05-15 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. + 2003-05-07 Josef Zlomek <zlomekj@suse.cz> * splay-tree.c (splay_tree_predecessor): Fix comment. diff --git a/libiberty/config.table b/libiberty/config.table index df48ce99525..1867cfeaafa 100644 --- a/libiberty/config.table +++ b/libiberty/config.table @@ -11,7 +11,7 @@ case "${host}" in *-*-freebsd2.1.*) frag=mh-fbsd21 ;; *-*-freebsd2.2.[012]) frag=mh-fbsd21 ;; i370-*-opened*) frag=mh-openedition ;; - i[345]86-*-windows*) frag=mh-windows ;; + i[34567]86-*-windows*) frag=mh-windows ;; esac if [ -n "${frag}" ]; then @@ -34,7 +34,7 @@ if [ "${shared}" = "yes" ]; then alpha*-*-linux*) frag=mh-elfalphapic ;; arm*-*-*) frag=mh-armpic ;; hppa*-*-*) frag=mh-papic ;; - i[3456]86-*-* | x86_64-*-*) + i[34567]86-*-* | x86_64-*-*) frag=mh-x86pic ;; powerpc*-*-aix*) ;; powerpc*-*-*) frag=mh-ppcpic ;; diff --git a/libiberty/functions.texi b/libiberty/functions.texi index 4261d864676..b34c20409e3 100644 --- a/libiberty/functions.texi +++ b/libiberty/functions.texi @@ -337,13 +337,19 @@ or zero if it is not. Note that the value you pass will be cast to @end deftypefn @c hex.c:42 -@deftypefn Extension int hex_value (int @var{c}) +@deftypefn Extension unsigned int hex_value (int @var{c}) Returns the numeric equivalent of the given character when interpreted as a hexidecimal digit. The result is undefined if you pass an invalid hex digit. Note that the value you pass will be cast to @code{unsigned char} within the macro. +The @code{hex_value} macro returns @code{unsigned int}, rather than +signed @code{int}, to make it easier to use in parsing addresses from +hex dump files: a signed @code{int} would be sign-extended when +converted to a wider unsigned type --- like @code{bfd_vma}, on some +systems. + @end deftypefn @c index.c:5 diff --git a/libiberty/hex.c b/libiberty/hex.c index 5f822925349..f425509be75 100644 --- a/libiberty/hex.c +++ b/libiberty/hex.c @@ -39,13 +39,19 @@ or zero if it is not. Note that the value you pass will be cast to @end deftypefn -@deftypefn Extension int hex_value (int @var{c}) +@deftypefn Extension unsigned int hex_value (int @var{c}) Returns the numeric equivalent of the given character when interpreted as a hexidecimal digit. The result is undefined if you pass an invalid hex digit. Note that the value you pass will be cast to @code{unsigned char} within the macro. +The @code{hex_value} macro returns @code{unsigned int}, rather than +signed @code{int}, to make it easier to use in parsing addresses from +hex dump files: a signed @code{int} would be sign-extended when +converted to a wider unsigned type --- like @code{bfd_vma}, on some +systems. + @end deftypefn @undocumented _hex_array_size @@ -60,7 +66,7 @@ invalid hex digit. Note that the value you pass will be cast to && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21 \ && EOF == -1 -const char _hex_value[_hex_array_size] = +const unsigned char _hex_value[_hex_array_size] = { _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* NUL SOH STX ETX */ _hex_bad, _hex_bad, _hex_bad, _hex_bad, /* EOT ENQ ACK BEL */ @@ -139,7 +145,7 @@ const char _hex_value[_hex_array_size] = #else -char _hex_value[_hex_array_size]; +unsigned char _hex_value[_hex_array_size]; #endif /* not ASCII */ |