aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog45
-rw-r--r--bfd/aoutx.h4
-rw-r--r--bfd/archive.c4
-rw-r--r--bfd/archures.c4
-rw-r--r--bfd/bfd.c9
-rw-r--r--bfd/binary.c5
-rw-r--r--bfd/cpu-v850.c5
-rw-r--r--bfd/hosts/alphavms.h3
-rw-r--r--bfd/ieee.c15
-rw-r--r--bfd/ihex.c5
-rw-r--r--bfd/merge.c2
-rw-r--r--bfd/oasys.c4
-rw-r--r--bfd/pdp11.c4
-rw-r--r--bfd/ppcboot.c5
-rw-r--r--bfd/som.c12
-rw-r--r--bfd/srec.c6
-rw-r--r--bfd/stabs.c5
-rw-r--r--bfd/syms.c10
-rw-r--r--bfd/vms-gsd.c2
-rw-r--r--bfd/vms-hdr.c6
-rw-r--r--bfd/vms-tir.c2
21 files changed, 90 insertions, 67 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 8d65726..e2fb365 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,48 @@
+2001-09-18 Bruno Haible <haible@clisp.cons.org>
+
+ * aoutx.h: Include "safe-ctype.h" instead of <ctype.h>.
+ (aout_link_write_symbols): Use ISDIGIT instead of isdigit.
+ * archive.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (_bfd_generic_read_ar_hdr_mag): Use ISDIGIT instead of isdigit.
+ * archures.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (bfd_default_scan): Use ISDIGIT instead of isdigit.
+ * bfd.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (bfd_scan_vma): Use ISXDIGIT/ISDIGIT/ISLOWER instead of
+ isxdigit/isdigit/islower.
+ * binary.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (mangle_name): Use ISALNUM instead of isalnum.
+ * cpu-v850.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (scan): Use ISDIGIT instead of isdigit.
+ * hosts/alphavms.h: Don't include <ctype.h>.
+ * ieee.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (ieee_object_p): Use TOUPPER instead of toupper.
+ * ihex.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (ihex_bad_byte): Use ISPRINT instead of isprint.
+ * merge.c: Don't include <ctype.h>.
+ * oasys.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (oasys_write_sections): Use ISDIGIT instead of isdigit.
+ * pdp11.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (aout_link_write_symbols): Use ISDIGIT instead of isdigit.
+ * ppcboot.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (mangle_name): Use ISALNUM instead of isalnum.
+ * som.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (som_set_reloc_info): Use ISUPPER/ISLOWER/ISDIGIT instead of
+ isupper/islower/isdigit.
+ (som_decode_symclass): Use TOUPPER instead of toupper.
+ * srec.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (srec_bad_byte): Use ISPRINT instead of isprint.
+ (srec_scan): Use ISSPACE instead of isspace.
+ * stabs.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (_bfd_link_section_stabs): Use ISDIGIT instead of isdigit.
+ * syms.c: Include "safe-ctype.h"
+ (islower, toupper): Remove macro definitions.
+ (bfd_decode_symclass): Use TOUPPER instead of toupper.
+ * vms-gsd.c: Don't include <ctype.h>.
+ * vms-hdr.c: Include "safe-ctype.h" instead of <ctype.h>.
+ (_bfd_vms_write_hdr): Use ISLOWER/TOUPPER instead of
+ islower/toupper.
+ * vms-tir.c: Don't include <ctype.h>.
+
2001-09-18 Alan Modra <amodra@bigpond.net.au>
* libbfd.c (bfd_bread): New function replacing bfd_read without
diff --git a/bfd/aoutx.h b/bfd/aoutx.h
index 2403485..4c30e87 100644
--- a/bfd/aoutx.h
+++ b/bfd/aoutx.h
@@ -120,9 +120,9 @@ DESCRIPTION
#define KEEPIT udata.i
-#include <ctype.h>
#include "bfd.h"
#include "sysdep.h"
+#include "safe-ctype.h"
#include "bfdlink.h"
#include "libaout.h"
@@ -4407,7 +4407,7 @@ aout_link_write_symbols (finfo, input_bfd)
{
/* Skip the file number. */
++s;
- while (isdigit ((unsigned char) *s))
+ while (ISDIGIT (*s))
++s;
--s;
}
diff --git a/bfd/archive.c b/bfd/archive.c
index 1faf0c7..f158ae6 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -132,7 +132,7 @@ DESCRIPTION
#include "libbfd.h"
#include "aout/ar.h"
#include "aout/ranlib.h"
-#include <ctype.h>
+#include "safe-ctype.h"
#ifndef errno
extern int errno;
@@ -407,7 +407,7 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag)
else if (hdr.ar_name[0] == '#'
&& hdr.ar_name[1] == '1'
&& hdr.ar_name[2] == '/'
- && isdigit ((unsigned char) hdr.ar_name[3]))
+ && ISDIGIT (hdr.ar_name[3]))
{
/* BSD-4.4 extended name */
namelen = atoi (&hdr.ar_name[3]);
diff --git a/bfd/archures.c b/bfd/archures.c
index 1a7ecbf..18925e3 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
-#include <ctype.h>
+#include "safe-ctype.h"
/*
@@ -813,7 +813,7 @@ bfd_default_scan (info, string)
}
number = 0;
- while (isdigit ((unsigned char) *ptr_src))
+ while (ISDIGIT (*ptr_src))
{
number = number * 10 + *ptr_src - '0';
ptr_src++;
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 067c021..8101814 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -203,6 +203,7 @@ CODE_FRAGMENT
#endif
#include "libiberty.h"
+#include "safe-ctype.h"
#include "bfdlink.h"
#include "libbfd.h"
#include "coff/internal.h"
@@ -211,8 +212,6 @@ CODE_FRAGMENT
#include "libecoff.h"
#undef obj_symbols
#include "elf-bfd.h"
-
-#include <ctype.h>
/* provide storage for subsystem, stack and heap data which may have been
passed in on the command line. Ld puts this data into a bfd_link_info
@@ -1034,10 +1033,10 @@ bfd_scan_vma (string, end, base)
/* Speed could be improved with a table like hex_value[] in gas. */
#define HEX_VALUE(c) \
- (isxdigit ((unsigned char) c) \
- ? (isdigit ((unsigned char) c) \
+ (ISXDIGIT (c) \
+ ? (ISDIGIT (c) \
? (c - '0') \
- : (10 + c - (islower ((unsigned char) c) ? 'a' : 'A'))) \
+ : (10 + c - (ISLOWER (c) ? 'a' : 'A'))) \
: 42)
for (value = 0; (digit = HEX_VALUE (* string)) < base; string ++)
diff --git a/bfd/binary.c b/bfd/binary.c
index 4d2fe03..6ef626c 100644
--- a/bfd/binary.c
+++ b/bfd/binary.c
@@ -32,8 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
the file. objcopy cooperates by specially setting the start
address to zero by default. */
-#include <ctype.h>
-
+#include "safe-ctype.h"
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
@@ -167,7 +166,7 @@ mangle_name (abfd, suffix)
/* Change any non-alphanumeric characters to underscores. */
for (p = buf; *p; p++)
- if (! isalnum ((unsigned char) *p))
+ if (! ISALNUM (*p))
*p = '_';
return buf;
diff --git a/bfd/cpu-v850.c b/bfd/cpu-v850.c
index 359c2c4..8836362 100644
--- a/bfd/cpu-v850.c
+++ b/bfd/cpu-v850.c
@@ -20,8 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
-
-#include <ctype.h>
+#include "safe-ctype.h"
static boolean scan PARAMS ((const struct bfd_arch_info *, const char *));
@@ -59,7 +58,7 @@ scan (info, string)
return info->the_default;
number = 0;
- while (isdigit ((unsigned char) *ptr_src))
+ while (ISDIGIT (*ptr_src))
{
number = number * 10 + * ptr_src - '0';
ptr_src ++;
diff --git a/bfd/hosts/alphavms.h b/bfd/hosts/alphavms.h
index eee391a..e77c21f 100644
--- a/bfd/hosts/alphavms.h
+++ b/bfd/hosts/alphavms.h
@@ -1,5 +1,5 @@
/* alphavms.h -- BFD definitions for an openVMS host
- Copyright 1996 Free Software Foundation, Inc.
+ Copyright 1996, 2000 Free Software Foundation, Inc.
Written by Klaus Kämpf (kkaempf@progis.de)
of proGIS Softwareentwicklung, Aachen, Germany
@@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <ctype.h>
#include <string.h>
#include <sys/file.h>
#include <stdlib.h>
diff --git a/bfd/ieee.c b/bfd/ieee.c
index cb7dca5..42a3d40 100644
--- a/bfd/ieee.c
+++ b/bfd/ieee.c
@@ -32,8 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libbfd.h"
#include "ieee.h"
#include "libieee.h"
-
-#include <ctype.h>
+#include "safe-ctype.h"
struct output_buffer_struct
{
@@ -1626,12 +1625,12 @@ ieee_object_p (abfd)
strcpy (family, "68332"); /* Guess it will be CPU32 */
}
}
- else if (toupper (processor[3]) == 'F') /* 68F333 */
- strcpy (family, "68332"); /* CPU32 */
- else if ((toupper (processor[3]) == 'C') /* Embedded controllers */
- && ((toupper (processor[2]) == 'E')
- || (toupper (processor[2]) == 'H')
- || (toupper (processor[2]) == 'L')))
+ else if (TOUPPER (processor[3]) == 'F') /* 68F333 */
+ strcpy (family, "68332"); /* CPU32 */
+ else if ((TOUPPER (processor[3]) == 'C') /* Embedded controllers */
+ && ((TOUPPER (processor[2]) == 'E')
+ || (TOUPPER (processor[2]) == 'H')
+ || (TOUPPER (processor[2]) == 'L')))
{
strcpy (family, "68");
strncat (family, processor + 4, 7);
diff --git a/bfd/ihex.c b/bfd/ihex.c
index 83808ee..fbfe63c 100644
--- a/bfd/ihex.c
+++ b/bfd/ihex.c
@@ -123,8 +123,7 @@ The MRI compiler uses this, which is a repeat of type 5:
#include "sysdep.h"
#include "libbfd.h"
#include "libiberty.h"
-
-#include <ctype.h>
+#include "safe-ctype.h"
static void ihex_init PARAMS ((void));
static boolean ihex_mkobject PARAMS ((bfd *));
@@ -249,7 +248,7 @@ ihex_bad_byte (abfd, lineno, c, error)
{
char buf[10];
- if (! isprint (c))
+ if (! ISPRINT (c))
sprintf (buf, "\\%03o", (unsigned int) c);
else
{
diff --git a/bfd/merge.c b/bfd/merge.c
index 150e936..2170e4e 100644
--- a/bfd/merge.c
+++ b/bfd/merge.c
@@ -26,8 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "libbfd.h"
#include "hashtab.h"
-#include <ctype.h>
-
struct sec_merge_sec_info;
/* An entry in the section merge hash table. */
diff --git a/bfd/oasys.c b/bfd/oasys.c
index dcb2b73..d8dc957 100644
--- a/bfd/oasys.c
+++ b/bfd/oasys.c
@@ -22,7 +22,7 @@
#define UNDERSCORE_HACK 1
#include "bfd.h"
#include "sysdep.h"
-#include <ctype.h>
+#include "safe-ctype.h"
#include "libbfd.h"
#include "oasys.h"
#include "liboasys.h"
@@ -1030,7 +1030,7 @@ oasys_write_sections (abfd)
for (s = abfd->sections; s != (asection *) NULL; s = s->next)
{
- if (!isdigit ((unsigned char) s->name[0]))
+ if (!ISDIGIT (s->name[0]))
{
(*_bfd_error_handler)
(_("%s: can not represent section `%s' in oasys"),
diff --git a/bfd/pdp11.c b/bfd/pdp11.c
index de12563..5c1d4d2 100644
--- a/bfd/pdp11.c
+++ b/bfd/pdp11.c
@@ -304,9 +304,9 @@ DESCRIPTION
#define KEEPIT udata.i
#include <string.h> /* For strchr and friends */
-#include <ctype.h>
#include "bfd.h"
#include "sysdep.h"
+#include "safe-ctype.h"
#include "bfdlink.h"
#include "libaout.h"
@@ -4176,7 +4176,7 @@ aout_link_write_symbols (finfo, input_bfd)
{
/* Skip the file number. */
++s;
- while (isdigit ((unsigned char) *s))
+ while (ISDIGIT (*s))
++s;
--s;
}
diff --git a/bfd/ppcboot.c b/bfd/ppcboot.c
index 478d55a..cd196b8 100644
--- a/bfd/ppcboot.c
+++ b/bfd/ppcboot.c
@@ -32,8 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
the file. objcopy cooperates by specially setting the start
address to zero by default. */
-#include <ctype.h>
-
+#include "safe-ctype.h"
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
@@ -279,7 +278,7 @@ mangle_name (abfd, suffix)
/* Change any non-alphanumeric characters to underscores. */
for (p = buf; *p; p++)
- if (! isalnum ((unsigned char) *p))
+ if (! ISALNUM (*p))
*p = '_';
return buf;
diff --git a/bfd/som.c b/bfd/som.c
index 0ea1353..de3db50 100644
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -31,12 +31,12 @@
#include "libbfd.h"
#include "som.h"
+#include "safe-ctype.h"
#include <sys/param.h>
#include <signal.h>
#include <machine/reg.h>
#include <sys/file.h>
-#include <ctype.h>
/* Magic not defined in standard HP-UX header files until 8.0 */
@@ -4672,13 +4672,13 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count)
c = *cp++;
/* If this is a variable, push it on the stack. */
- if (isupper (c))
+ if (ISUPPER (c))
push (var (c));
/* If this is a lower case letter, then it represents
additional data from the fixup stream to be pushed onto
the stack. */
- else if (islower (c))
+ else if (ISLOWER (c))
{
int bits = (c - 'a') * 8;
for (v = 0; c > 'a'; --c)
@@ -4689,10 +4689,10 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count)
}
/* A decimal constant. Push it on the stack. */
- else if (isdigit (c))
+ else if (ISDIGIT (c))
{
v = c - '0';
- while (isdigit (*cp))
+ while (ISDIGIT (*cp))
v = (v * 10) + (*cp++ - '0');
push (v);
}
@@ -5438,7 +5438,7 @@ som_decode_symclass (symbol)
else
return '?';
if (symbol->flags & BSF_GLOBAL)
- c = toupper (c);
+ c = TOUPPER (c);
return c;
}
diff --git a/bfd/srec.c b/bfd/srec.c
index 0987051..54706ac 100644
--- a/bfd/srec.c
+++ b/bfd/srec.c
@@ -108,7 +108,7 @@ DESCRIPTION
#include "sysdep.h"
#include "libbfd.h"
#include "libiberty.h"
-#include <ctype.h>
+#include "safe-ctype.h"
static void srec_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
static void srec_print_symbol
@@ -291,7 +291,7 @@ srec_bad_byte (abfd, lineno, c, error)
{
char buf[10];
- if (! isprint (c))
+ if (! ISPRINT (c))
sprintf (buf, "\\%03o", (unsigned int) c);
else
{
@@ -418,7 +418,7 @@ srec_scan (abfd)
*p++ = c;
while ((c = srec_get_byte (abfd, &error)) != EOF
- && ! isspace (c))
+ && ! ISSPACE (c))
{
if ((bfd_size_type) (p - symbuf) >= alc)
{
diff --git a/bfd/stabs.c b/bfd/stabs.c
index ea7e486..f54d658 100644
--- a/bfd/stabs.c
+++ b/bfd/stabs.c
@@ -26,8 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
#include "libbfd.h"
#include "aout/stab_gnu.h"
-
-#include <ctype.h>
+#include "safe-ctype.h"
/* Stabs entries use a 12 byte format:
4 byte string table index
@@ -364,7 +363,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo)
{
/* Skip the file number. */
++str;
- while (isdigit ((unsigned char) *str))
+ while (ISDIGIT (*str))
++str;
--str;
}
diff --git a/bfd/syms.c b/bfd/syms.c
index 9c8922b..b334c11 100644
--- a/bfd/syms.c
+++ b/bfd/syms.c
@@ -308,6 +308,7 @@ CODE_FRAGMENT
#include "bfd.h"
#include "sysdep.h"
#include "libbfd.h"
+#include "safe-ctype.h"
#include "bfdlink.h"
#include "aout/stab_gnu.h"
@@ -556,13 +557,6 @@ coff_section_type (s)
return '?';
}
-#ifndef islower
-#define islower(c) ((c) >= 'a' && (c) <= 'z')
-#endif
-#ifndef toupper
-#define toupper(c) (islower(c) ? ((c) & ~0x20) : (c))
-#endif
-
/*
FUNCTION
bfd_decode_symclass
@@ -617,7 +611,7 @@ bfd_decode_symclass (symbol)
else
return '?';
if (symbol->flags & BSF_GLOBAL)
- c = toupper (c);
+ c = TOUPPER (c);
return c;
/* We don't have to handle these cases just yet, but we will soon:
diff --git a/bfd/vms-gsd.c b/bfd/vms-gsd.c
index 2ee015f..538c148 100644
--- a/bfd/vms-gsd.c
+++ b/bfd/vms-gsd.c
@@ -21,8 +21,6 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include <ctype.h>
-
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"
diff --git a/bfd/vms-hdr.c b/bfd/vms-hdr.c
index c6278c1..fedfe75 100644
--- a/bfd/vms-hdr.c
+++ b/bfd/vms-hdr.c
@@ -24,11 +24,10 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include <ctype.h>
-
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"
+#include "safe-ctype.h"
#include "libbfd.h"
#include "vms.h"
@@ -303,8 +302,7 @@ _bfd_vms_write_hdr (abfd, objtype)
fptr = fout;
while (*fptr != 0)
{
- if (islower (*fptr))
- *fptr = toupper (*fptr);
+ *fptr = TOUPPER (*fptr);
fptr++;
if ((*fptr == ';')
|| ((fptr - fout) > 31))
diff --git a/bfd/vms-tir.c b/bfd/vms-tir.c
index fc9d23d..e4ce47f 100644
--- a/bfd/vms-tir.c
+++ b/bfd/vms-tir.c
@@ -33,8 +33,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
qw quadword (8 byte, 64 bit)
da data stream */
-#include <ctype.h>
-
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"