aboutsummaryrefslogtreecommitdiff
path: root/bfd/srec.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>1994-02-27 23:28:48 +0000
committerStan Shebs <shebs@codesourcery.com>1994-02-27 23:28:48 +0000
commit4c8d6c9f4f5ee90a766c6e711828d37f75efc3c7 (patch)
tree9ac1916b2466cba521142dbb94eb297d4ab4e309 /bfd/srec.c
parent7636cf204f838c86628d18e946c703655aaebfb3 (diff)
downloadgdb-4c8d6c9f4f5ee90a766c6e711828d37f75efc3c7.zip
gdb-4c8d6c9f4f5ee90a766c6e711828d37f75efc3c7.tar.gz
gdb-4c8d6c9f4f5ee90a766c6e711828d37f75efc3c7.tar.bz2
Sun Feb 27 15:22:36 1994 Stan Shebs (shebs@andros.cygnus.com)
* srec.c (hex_value): Always set to a size of 256 bytes. (srec_init): Cosmetic changes.
Diffstat (limited to 'bfd/srec.c')
-rw-r--r--bfd/srec.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/bfd/srec.c b/bfd/srec.c
index 6c6f875..c4a1ce5 100644
--- a/bfd/srec.c
+++ b/bfd/srec.c
@@ -107,11 +107,13 @@ DESCRIPTION
#include "sysdep.h"
#include "libbfd.h"
-/* Macros for converting between hex and binary */
+/* Macros for converting between hex and binary. */
static CONST char digs[] = "0123456789ABCDEF";
-static char hex_value[1 + (unsigned char) ~0];
+/* Table that gets filled in with numbers corresponding to hex chars. */
+
+static char hex_value[256];
#define NOT_HEX 20
#define NIBBLE(x) hex_value[(unsigned char)(x)]
@@ -122,7 +124,7 @@ static char hex_value[1 + (unsigned char) ~0];
ch += ((x) & 0xff);
#define ISHEX(x) (hex_value[(unsigned char)(x)] != NOT_HEX)
-
+/* Initialize by filling in the hex conversion array. */
static void
DEFUN_VOID (srec_init)
@@ -132,18 +134,15 @@ DEFUN_VOID (srec_init)
if (inited == false)
{
-
inited = true;
for (i = 0; i < sizeof (hex_value); i++)
{
hex_value[i] = NOT_HEX;
}
-
for (i = 0; i < 10; i++)
{
hex_value[i + '0'] = i;
-
}
for (i = 0; i < 6; i++)
{