OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / libiberty / hex.c
index f425509..86ba0b5 100644 (file)
@@ -14,11 +14,19 @@ Library General Public License for more details.
 
 You should have received a copy of the GNU Library General Public
 License along with libiberty; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 #include <stdio.h>  /* for EOF */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 #include "libiberty.h"
+#include "safe-ctype.h" /* for HOST_CHARSET_ASCII */
+
+#if EOF != -1
+ #error "hex.c requires EOF == -1"
+#endif
 
 /*
 
@@ -39,7 +47,7 @@ or zero if it is not.  Note that the value you pass will be cast to
 
 @end deftypefn
 
-@deftypefn Extension unsigned 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
@@ -62,9 +70,7 @@ systems.
 
 
 /* Are we ASCII? */
-#if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \
-  && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21 \
-  && EOF == -1
+#if HOST_CHARSET == HOST_CHARSET_ASCII
 
 const unsigned char _hex_value[_hex_array_size] =
 {
@@ -150,7 +156,7 @@ unsigned char _hex_value[_hex_array_size];
 #endif /* not ASCII */
 
 void
-hex_init ()
+hex_init (void)
 {
 #ifndef HEX_TABLE_INITIALIZED
   int i;