summaryrefslogtreecommitdiff
path: root/output
diff options
context:
space:
mode:
authorKeith Kanios <spook@dynatos.net>2007-04-13 16:47:53 +0000
committerKeith Kanios <spook@dynatos.net>2007-04-13 16:47:53 +0000
commita6dfa78b7805673b2b4955a9f34e21825730f79d (patch)
treee92c44a08121248c0789b63d41908b402fcb891e /output
parent2cc61b34f0bc87010a649159f62d37d5ed529ee4 (diff)
downloadnasm-a6dfa78b7805673b2b4955a9f34e21825730f79d.tar.gz
nasm-a6dfa78b7805673b2b4955a9f34e21825730f79d.tar.bz2
nasm-a6dfa78b7805673b2b4955a9f34e21825730f79d.zip
Fixed distinction between char and int8_t data types.
Diffstat (limited to 'output')
-rw-r--r--output/outaout.c20
-rw-r--r--output/outas86.c26
-rw-r--r--output/outbin.c50
-rw-r--r--output/outcoff.c50
-rw-r--r--output/outdbg.c30
-rw-r--r--output/outelf.c72
-rw-r--r--output/outieee.c58
-rw-r--r--output/outmacho.c58
-rw-r--r--output/outobj.c68
-rw-r--r--output/outrdf.c40
-rw-r--r--output/outrdf2.c36
11 files changed, 254 insertions, 254 deletions
diff --git a/output/outaout.c b/output/outaout.c
index e250767..b6164f5 100644
--- a/output/outaout.c
+++ b/output/outaout.c
@@ -43,7 +43,7 @@ struct Symbol {
int32_t segment; /* back-reference used by gsym_reloc */
struct Symbol *next; /* list of globals in each section */
struct Symbol *nextfwd; /* list of unresolved-size symbols */
- int8_t *name; /* for unresolved-size symbols */
+ char *name; /* for unresolved-size symbols */
int32_t symnum; /* index into symbol table */
};
@@ -218,7 +218,7 @@ static void aout_cleanup(int debuginfo)
saa_free(strs);
}
-static int32_t aout_section_names(int8_t *name, int pass, int *bits)
+static int32_t aout_section_names(char *name, int pass, int *bits)
{
/*
* Default to 32 bits.
@@ -239,8 +239,8 @@ static int32_t aout_section_names(int8_t *name, int pass, int *bits)
return NO_SEG;
}
-static void aout_deflabel(int8_t *name, int32_t segment, int32_t offset,
- int is_global, int8_t *special)
+static void aout_deflabel(char *name, int32_t segment, int32_t offset,
+ int is_global, char *special)
{
int pos = strslen + 4;
struct Symbol *sym;
@@ -269,7 +269,7 @@ static void aout_deflabel(int8_t *name, int32_t segment, int32_t offset,
if (!strcmp((*s)->name, name)) {
struct tokenval tokval;
expr *e;
- int8_t *p = special;
+ char *p = special;
while (*p && !isspace(*p))
p++;
@@ -356,7 +356,7 @@ static void aout_deflabel(int8_t *name, int32_t segment, int32_t offset,
struct tokenval tokval;
expr *e;
int fwd = FALSE;
- int8_t *saveme = stdscan_bufptr; /* bugfix? fbk 8/10/00 */
+ char *saveme = stdscan_bufptr; /* bugfix? fbk 8/10/00 */
if (!bsd) {
error(ERR_NONFATAL, "Linux a.out does not support"
@@ -886,24 +886,24 @@ static int32_t aout_segbase(int32_t segment)
return segment;
}
-static int aout_directive(int8_t *directive, int8_t *value, int pass)
+static int aout_directive(char *directive, char *value, int pass)
{
return 0;
}
-static void aout_filename(int8_t *inname, int8_t *outname, efunc error)
+static void aout_filename(char *inname, char *outname, efunc error)
{
standard_extension(inname, outname, ".o", error);
}
-static const int8_t *aout_stdmac[] = {
+static const char *aout_stdmac[] = {
"%define __SECT__ [section .text]",
"%macro __NASM_CDecl__ 1",
"%endmacro",
NULL
};
-static int aout_set_info(enum geninfo type, int8_t **val)
+static int aout_set_info(enum geninfo type, char **val)
{
return 0;
}
diff --git a/output/outas86.c b/output/outas86.c
index b75fd5f..c2c5e92 100644
--- a/output/outas86.c
+++ b/output/outas86.c
@@ -57,7 +57,7 @@ struct Section {
struct Piece *head, *last, **tail;
};
-static int8_t as86_module[FILENAME_MAX];
+static char as86_module[FILENAME_MAX];
static struct Section stext, sdata;
static uint32_t bsslen;
@@ -78,7 +78,7 @@ static efunc error;
static void as86_write(void);
static void as86_write_section(struct Section *, int);
-static int as86_add_string(int8_t *name);
+static int as86_add_string(char *name);
static void as86_sect_write(struct Section *, const uint8_t *,
uint32_t);
@@ -135,7 +135,7 @@ static void as86_cleanup(int debuginfo)
saa_free(strs);
}
-static int32_t as86_section_names(int8_t *name, int pass, int *bits)
+static int32_t as86_section_names(char *name, int pass, int *bits)
{
/*
* Default is 16 bits.
@@ -156,7 +156,7 @@ static int32_t as86_section_names(int8_t *name, int pass, int *bits)
return NO_SEG;
}
-static int as86_add_string(int8_t *name)
+static int as86_add_string(char *name)
{
int pos = strslen;
int length = strlen(name);
@@ -167,8 +167,8 @@ static int as86_add_string(int8_t *name)
return pos;
}
-static void as86_deflabel(int8_t *name, int32_t segment, int32_t offset,
- int is_global, int8_t *special)
+static void as86_deflabel(char *name, int32_t segment, int32_t offset,
+ int is_global, char *special)
{
struct Symbol *sym;
@@ -505,7 +505,7 @@ static void as86_write_section(struct Section *sect, int index)
*/
length = p->bytes;
do {
- int8_t buf[64];
+ char buf[64];
int32_t tmplen = (length > 64 ? 64 : length);
fputc(0x40 | (tmplen & 0x3F), as86fp);
saa_rnbytes(sect->data, buf, tmplen);
@@ -576,14 +576,14 @@ static int32_t as86_segbase(int32_t segment)
return segment;
}
-static int as86_directive(int8_t *directive, int8_t *value, int pass)
+static int as86_directive(char *directive, char *value, int pass)
{
return 0;
}
-static void as86_filename(int8_t *inname, int8_t *outname, efunc error)
+static void as86_filename(char *inname, char *outname, efunc error)
{
- int8_t *p;
+ char *p;
if ((p = strrchr(inname, '.')) != NULL) {
strncpy(as86_module, inname, p - inname);
@@ -594,18 +594,18 @@ static void as86_filename(int8_t *inname, int8_t *outname, efunc error)
standard_extension(inname, outname, ".o", error);
}
-static const int8_t *as86_stdmac[] = {
+static const char *as86_stdmac[] = {
"%define __SECT__ [section .text]",
"%macro __NASM_CDecl__ 1",
"%endmacro",
NULL
};
-static int as86_set_info(enum geninfo type, int8_t **val)
+static int as86_set_info(enum geninfo type, char **val)
{
return 0;
}
-void as86_linenumber(int8_t *name, int32_t segment, int32_t offset, int is_main,
+void as86_linenumber(char *name, int32_t segment, int32_t offset, int is_main,
int lineno)
{
}
diff --git a/output/outbin.c b/output/outbin.c
index cd46752..89465e3 100644
--- a/output/outbin.c
+++ b/output/outbin.c
@@ -76,12 +76,12 @@ static efunc error;
/* This struct is used to keep track of symbols for map-file generation. */
static struct bin_label {
- int8_t *name;
+ char *name;
struct bin_label *next;
} *no_seg_labels, **nsl_tail;
static struct Section {
- int8_t *name;
+ char *name;
struct SAA *contents;
int32_t length; /* section length in bytes */
@@ -91,8 +91,8 @@ static struct Section {
uint32_t valign; /* notional section alignment */
uint32_t start; /* section start address */
uint32_t vstart; /* section virtual start address */
- int8_t *follows; /* the section that this one will follow */
- int8_t *vfollows; /* the section that this one will notionally follow */
+ char *follows; /* the section that this one will follow */
+ char *vfollows; /* the section that this one will notionally follow */
int32_t start_index; /* NASM section id for non-relocated version */
int32_t vstart_index; /* the NASM section id */
@@ -120,8 +120,8 @@ static struct Reloc {
struct Section *target;
} *relocs, **reloctail;
-extern int8_t *stdscan_bufptr;
-extern int lookup_label(int8_t *label, int32_t *segment, int32_t *offset);
+extern char *stdscan_bufptr;
+extern int lookup_label(char *label, int32_t *segment, int32_t *offset);
static uint8_t format_mode; /* 0 = original bin, 1 = extended bin */
static int32_t current_section; /* only really needed if format_mode = 0 */
@@ -134,9 +134,9 @@ static int origin_defined;
#define MAP_SECTIONS 4
#define MAP_SYMBOLS 8
static int map_control = 0;
-static int8_t *infile, *outfile;
+static char *infile, *outfile;
-static const int8_t *bin_stdmac[] = {
+static const char *bin_stdmac[] = {
"%define __SECT__ [section .text]",
"%imacro org 1+.nolist",
"[org %1]",
@@ -161,7 +161,7 @@ static void add_reloc(struct Section *s, int32_t bytes, int32_t secref,
r->target = s;
}
-static struct Section *find_section_by_name(const int8_t *name)
+static struct Section *find_section_by_name(const char *name)
{
struct Section *s;
@@ -181,7 +181,7 @@ static struct Section *find_section_by_index(int32_t index)
return s;
}
-static struct Section *create_section(int8_t *name)
+static struct Section *create_section(char *name)
{ /* Create a new section. */
last_section->next = nasm_malloc(sizeof(struct Section));
last_section->next->ifollows = last_section;
@@ -583,7 +583,7 @@ static void bin_cleanup(int debuginfo)
/* Step 7: Generate the map file. */
if (map_control) {
- const int8_t *not_defined = { "not defined" };
+ const char *not_defined = { "not defined" };
/* Display input and output file names. */
fprintf(rf, "\n- NASM Map file ");
@@ -835,8 +835,8 @@ static void bin_out(int32_t segto, const void *data, uint32_t type,
}
}
-static void bin_deflabel(int8_t *name, int32_t segment, int32_t offset,
- int is_global, int8_t *special)
+static void bin_deflabel(char *name, int32_t segment, int32_t offset,
+ int is_global, char *special)
{
(void)segment; /* Don't warn that this parameter is unused */
(void)offset; /* Don't warn that this parameter is unused */
@@ -876,13 +876,13 @@ enum { ATTRIB_START, ATTRIB_ALIGN, ATTRIB_FOLLOWS,
ATTRIB_NOBITS, ATTRIB_PROGBITS
};
-static int bin_read_attribute(int8_t **line, int *attribute,
+static int bin_read_attribute(char **line, int *attribute,
uint32_t *value)
{
expr *e;
int attrib_name_size;
struct tokenval tokval;
- int8_t *exp;
+ char *exp;
/* Skip whitespace. */
while (**line && isspace(**line))
@@ -938,7 +938,7 @@ static int bin_read_attribute(int8_t **line, int *attribute,
(*line)++;
}
} else {
- int8_t c;
+ char c;
int pcount = 1;
/* Full expression (delimited by parenthesis) */
@@ -1004,11 +1004,11 @@ static int bin_read_attribute(int8_t **line, int *attribute,
return 1;
}
-static void bin_assign_attributes(struct Section *sec, int8_t *astring)
+static void bin_assign_attributes(struct Section *sec, char *astring)
{
int attribute, check;
uint32_t value;
- int8_t *p;
+ char *p;
while (1) { /* Get the next attribute. */
check = bin_read_attribute(&astring, &attribute, &value);
@@ -1196,7 +1196,7 @@ static void bin_define_section_labels()
{
static int labels_defined = 0;
struct Section *sec;
- int8_t *label_name;
+ char *label_name;
size_t base_len;
if (labels_defined)
@@ -1222,9 +1222,9 @@ static void bin_define_section_labels()
labels_defined = 1;
}
-static int32_t bin_secname(int8_t *name, int pass, int *bits)
+static int32_t bin_secname(char *name, int pass, int *bits)
{
- int8_t *p;
+ char *p;
struct Section *sec;
/* bin_secname is called with *name = NULL at the start of each
@@ -1288,7 +1288,7 @@ static int32_t bin_secname(int8_t *name, int pass, int *bits)
return current_section;
}
-static int bin_directive(int8_t *directive, int8_t *args, int pass)
+static int bin_directive(char *directive, char *args, int pass)
{
/* Handle ORG directive */
if (!nasm_stricmp(directive, "org")) {
@@ -1323,7 +1323,7 @@ static int bin_directive(int8_t *directive, int8_t *args, int pass)
/* The 'map' directive allows the user to generate section
* and symbol information to stdout, stderr, or to a file. */
else if (format_mode && !nasm_stricmp(directive, "map")) {
- int8_t *p;
+ char *p;
if (pass != 1)
return 1;
@@ -1370,7 +1370,7 @@ static int bin_directive(int8_t *directive, int8_t *args, int pass)
return 0;
}
-static void bin_filename(int8_t *inname, int8_t *outname, efunc error)
+static void bin_filename(char *inname, char *outname, efunc error)
{
standard_extension(inname, outname, "", error);
infile = inname;
@@ -1382,7 +1382,7 @@ static int32_t bin_segbase(int32_t segment)
return segment;
}
-static int bin_set_info(enum geninfo type, int8_t **val)
+static int bin_set_info(enum geninfo type, char **val)
{
return 0;
}
diff --git a/output/outcoff.c b/output/outcoff.c
index bdcc4ce..78331ea 100644
--- a/output/outcoff.c
+++ b/output/outcoff.c
@@ -77,7 +77,7 @@ struct Reloc {
};
struct Symbol {
- int8_t name[9];
+ char name[9];
int32_t strpos; /* string table position of name */
int section; /* section number where it's defined
* - in COFF codes, not NASM codes */
@@ -87,7 +87,7 @@ struct Symbol {
static FILE *coffp;
static efunc error;
-static int8_t coff_infile[FILENAME_MAX];
+static char coff_infile[FILENAME_MAX];
struct Section {
struct SAA *data;
@@ -96,7 +96,7 @@ struct Section {
int32_t index;
struct Reloc *head, **tail;
uint32_t flags; /* section flags */
- int8_t name[9];
+ char name[9];
int32_t pos, relpos;
};
@@ -126,7 +126,7 @@ static void coff_gen_init(FILE *, efunc);
static void coff_sect_write(struct Section *, const uint8_t *,
uint32_t);
static void coff_write(void);
-static void coff_section_header(int8_t *, int32_t, int32_t, int32_t, int32_t, int, int32_t);
+static void coff_section_header(char *, int32_t, int32_t, int32_t, int32_t, int, int32_t);
static void coff_write_relocs(struct Section *);
static void coff_write_symbols(void);
@@ -197,7 +197,7 @@ static void coff_cleanup(int debuginfo)
saa_free(strs);
}
-static int coff_make_section(int8_t *name, uint32_t flags)
+static int coff_make_section(char *name, uint32_t flags)
{
struct Section *s;
@@ -227,9 +227,9 @@ static int coff_make_section(int8_t *name, uint32_t flags)
return nsects - 1;
}
-static int32_t coff_section_names(int8_t *name, int pass, int *bits)
+static int32_t coff_section_names(char *name, int pass, int *bits)
{
- int8_t *p;
+ char *p;
uint32_t flags, align_and = ~0L, align_or = 0L;
int i;
@@ -261,7 +261,7 @@ static int32_t coff_section_names(int8_t *name, int pass, int *bits)
while (*p && isspace(*p))
p++;
while (*p) {
- int8_t *q = p;
+ char *q = p;
while (*p && !isspace(*p))
p++;
if (*p)
@@ -350,8 +350,8 @@ static int32_t coff_section_names(int8_t *name, int pass, int *bits)
return sects[i]->index;
}
-static void coff_deflabel(int8_t *name, int32_t segment, int32_t offset,
- int is_global, int8_t *special)
+static void coff_deflabel(char *name, int32_t segment, int32_t offset,
+ int is_global, char *special)
{
int pos = strslen + 4;
struct Symbol *sym;
@@ -589,7 +589,7 @@ static void coff_sect_write(struct Section *sect,
typedef struct tagString {
struct tagString *Next;
int len;
- int8_t *String;
+ char *String;
} STRING;
#define EXPORT_SECTION_NAME ".drectve"
@@ -601,14 +601,14 @@ typedef struct tagString {
static STRING *Exports = NULL;
static struct Section *directive_sec;
-void AddExport(int8_t *name)
+void AddExport(char *name)
{
STRING *rvp = Exports, *newS;
newS = (STRING *) nasm_malloc(sizeof(STRING));
newS->len = strlen(name);
newS->Next = NULL;
- newS->String = (int8_t *)nasm_malloc(newS->len + 1);
+ newS->String = (char *)nasm_malloc(newS->len + 1);
strcpy(newS->String, name);
if (rvp == NULL) {
int i;
@@ -641,7 +641,7 @@ void BuildExportTable(void)
if (rvp == NULL)
return;
while (rvp) {
- len = sprintf((int8_t *)buf, "-export:%s ", rvp->String);
+ len = sprintf((char *)buf, "-export:%s ", rvp->String);
coff_sect_write(directive_sec, buf, len);
rvp = rvp->Next;
}
@@ -655,10 +655,10 @@ void BuildExportTable(void)
Exports = NULL;
}
-static int coff_directives(int8_t *directive, int8_t *value, int pass)
+static int coff_directives(char *directive, char *value, int pass)
{
if (!strcmp(directive, "export")) {
- int8_t *q, *name;
+ char *q, *name;
if (pass == 2)
return 1; /* ignore in pass two */
@@ -752,11 +752,11 @@ static void coff_write(void)
saa_fpwrite(strs, coffp);
}
-static void coff_section_header(int8_t *name, int32_t vsize,
+static void coff_section_header(char *name, int32_t vsize,
int32_t datalen, int32_t datapos,
int32_t relpos, int nrelocs, int32_t flags)
{
- int8_t padname[8];
+ char padname[8];
memset(padname, 0, 8);
strncpy(padname, name, 8);
@@ -795,10 +795,10 @@ static void coff_write_relocs(struct Section *s)
}
}
-static void coff_symbol(int8_t *name, int32_t strpos, int32_t value,
+static void coff_symbol(char *name, int32_t strpos, int32_t value,
int section, int type, int aux)
{
- int8_t padname[8];
+ char padname[8];
if (name) {
memset(padname, 0, 8);
@@ -817,7 +817,7 @@ static void coff_symbol(int8_t *name, int32_t strpos, int32_t value,
static void coff_write_symbols(void)
{
- int8_t filename[18];
+ char filename[18];
uint32_t i;
/*
@@ -862,19 +862,19 @@ static int32_t coff_segbase(int32_t segment)
return segment;
}
-static void coff_std_filename(int8_t *inname, int8_t *outname, efunc error)
+static void coff_std_filename(char *inname, char *outname, efunc error)
{
strcpy(coff_infile, inname);
standard_extension(inname, outname, ".o", error);
}
-static void coff_win32_filename(int8_t *inname, int8_t *outname, efunc error)
+static void coff_win32_filename(char *inname, char *outname, efunc error)
{
strcpy(coff_infile, inname);
standard_extension(inname, outname, ".obj", error);
}
-static const int8_t *coff_stdmac[] = {
+static const char *coff_stdmac[] = {
"%define __SECT__ [section .text]",
"%macro __NASM_CDecl__ 1",
"%endmacro",
@@ -884,7 +884,7 @@ static const int8_t *coff_stdmac[] = {
NULL
};
-static int coff_set_info(enum geninfo type, int8_t **val)
+static int coff_set_info(enum geninfo type, char **val)
{
return 0;
}
diff --git a/output/outdbg.c b/output/outdbg.c
index d7bcb48..045ad37 100644
--- a/output/outdbg.c
+++ b/output/outdbg.c
@@ -22,7 +22,7 @@
struct Section {
struct Section *next;
int32_t number;
- int8_t *name;
+ char *name;
} *dbgsect;
FILE *dbgf;
@@ -55,7 +55,7 @@ static void dbg_cleanup(int debuginfo)
fclose(dbgf);
}
-static int32_t dbg_section_names(int8_t *name, int pass, int *bits)
+static int32_t dbg_section_names(char *name, int pass, int *bits)
{
int seg;
@@ -70,7 +70,7 @@ static int32_t dbg_section_names(int8_t *name, int pass, int *bits)
seg = seg_alloc());
else {
int n = strcspn(name, " \t");
- int8_t *sname = nasm_strndup(name, n);
+ char *sname = nasm_strndup(name, n);
struct Section *s;
seg = NO_SEG;
@@ -91,8 +91,8 @@ static int32_t dbg_section_names(int8_t *name, int pass, int *bits)
return seg;
}
-static void dbg_deflabel(int8_t *name, int32_t segment, int32_t offset,
- int is_global, int8_t *special)
+static void dbg_deflabel(char *name, int32_t segment, int32_t offset,
+ int is_global, char *special)
{
fprintf(dbgf, "deflabel %s := %08lx:%08lx %s (%d)%s%s\n",
name, segment, offset,
@@ -119,7 +119,7 @@ static void dbg_out(int32_t segto, void *data, uint32_t type,
fprintf(dbgf, "raw data = ");
while (realbytes--) {
id = *(uint8_t *)data;
- data = (int8_t *)data + 1;
+ data = (char *)data + 1;
fprintf(dbgf, "%02x ", id);
}
fprintf(dbgf, "\n");
@@ -127,7 +127,7 @@ static void dbg_out(int32_t segto, void *data, uint32_t type,
case OUT_ADDRESS:
ldata = 0; /* placate gcc */
if (realbytes == 1)
- ldata = *((int8_t *)data);
+ ldata = *((char *)data);
else if (realbytes == 2)
ldata = *((int16_t *)data);
else if (realbytes == 4)
@@ -154,26 +154,26 @@ static int32_t dbg_segbase(int32_t segment)
return segment;
}
-static int dbg_directive(int8_t *directive, int8_t *value, int pass)
+static int dbg_directive(char *directive, char *value, int pass)
{
fprintf(dbgf, "directive [%s] value [%s] (pass %d)\n",
directive, value, pass);
return 1;
}
-static void dbg_filename(int8_t *inname, int8_t *outname, efunc error)
+static void dbg_filename(char *inname, char *outname, efunc error)
{
standard_extension(inname, outname, ".dbg", error);
}
-static int dbg_set_info(enum geninfo type, int8_t **val)
+static int dbg_set_info(enum geninfo type, char **val)
{
(void)type;
(void)val;
return 0;
}
-int8_t *types[] = {
+char *types[] = {
"unknown", "label", "byte", "word", "dword", "float", "qword", "tbyte"
};
void dbgdbg_init(struct ofmt *of, void *id, FILE * fp, efunc error)
@@ -188,12 +188,12 @@ static void dbgdbg_cleanup(void)
{
}
-static void dbgdbg_linnum(const int8_t *lnfname, int32_t lineno, int32_t segto)
+static void dbgdbg_linnum(const char *lnfname, int32_t lineno, int32_t segto)
{
fprintf(dbgf, "dbglinenum %s(%ld) := %08lx\n", lnfname, lineno, segto);
}
-static void dbgdbg_deflabel(int8_t *name, int32_t segment,
- int32_t offset, int is_global, int8_t *special)
+static void dbgdbg_deflabel(char *name, int32_t segment,
+ int32_t offset, int is_global, char *special)
{
fprintf(dbgf, "dbglabel %s := %08lx:%08lx %s (%d)%s%s\n",
name,
@@ -201,7 +201,7 @@ static void dbgdbg_deflabel(int8_t *name, int32_t segment,
is_global == 2 ? "common" : is_global ? "global" : "local",
is_global, special ? ": " : "", special);
}
-static void dbgdbg_define(const int8_t *type, const int8_t *params)
+static void dbgdbg_define(const char *type, const char *params)
{
fprintf(dbgf, "dbgdirective [%s] value [%s]\n", type, params);
}
diff --git a/output/outelf.c b/output/outelf.c
index e185c7e..103479c 100644
--- a/output/outelf.c
+++ b/output/outelf.c
@@ -56,7 +56,7 @@ struct Symbol {
int32_t globnum; /* symbol table offset if global */
struct Symbol *next; /* list of globals in each section */
struct Symbol *nextfwd; /* list of unresolved-size symbols */
- int8_t *name; /* used temporarily if in above list */
+ char *name; /* used temporarily if in above list */
};
#define SHT_PROGBITS 1
@@ -73,7 +73,7 @@ struct Section {
int type; /* SHT_PROGBITS or SHT_NOBITS */
int align; /* alignment: power of two */
uint32_t flags; /* section flags */
- int8_t *name;
+ char *name;
struct SAA *rel;
int32_t rellen;
struct Reloc *head, **tail;
@@ -85,7 +85,7 @@ static struct Section **sects;
static int nsects, sectlen;
#define SHSTR_DELTA 256
-static int8_t *shstrtab;
+static char *shstrtab;
static int shstrtablen, shstrtabsize;
static struct SAA *syms;
@@ -104,7 +104,7 @@ static evalfunc evaluate;
static struct Symbol *fwds;
-static int8_t elf_module[FILENAME_MAX];
+static char elf_module[FILENAME_MAX];
extern struct ofmt of_elf;
@@ -122,7 +122,7 @@ extern struct ofmt of_elf;
#define SEG_ALIGN 16 /* alignment of sections in file */
#define SEG_ALIGN_1 (SEG_ALIGN-1)
-static const int8_t align_str[SEG_ALIGN] = ""; /* ANSI will pad this with 0s */
+static const char align_str[SEG_ALIGN] = ""; /* ANSI will pad this with 0s */
#define ELF_MAX_SECTIONS 16 /* really 10, but let's play safe */
static struct ELF_SECTDATA {
@@ -141,7 +141,7 @@ static void elf_section_header(int, int, int, void *, int, int32_t, int, int,
static void elf_write_sections(void);
static struct SAA *elf_build_symtab(int32_t *, int32_t *);
static struct SAA *elf_build_reltab(int32_t *, struct Reloc *);
-static void add_sectname(int8_t *, int8_t *);
+static void add_sectname(char *, char *);
/* this stuff is needed for the stabs debugging format */
#define N_SO 0x64 /* ID for main source file */
@@ -166,13 +166,13 @@ struct erel {
struct symlininfo {
int offset;
int section; /* section index */
- int8_t *name; /* shallow-copied pointer of section name */
+ char *name; /* shallow-copied pointer of section name */
};
struct linelist {
struct symlininfo info;
int line;
- int8_t *filename;
+ char *filename;
struct linelist *next;
struct linelist *last;
};
@@ -181,7 +181,7 @@ static struct linelist *stabslines = 0;
static int stabs_immcall = 0;
static int currentline = 0;
static int numlinestabs = 0;
-static int8_t *stabs_filename = 0;
+static char *stabs_filename = 0;
static int symtabsection;
static uint8_t *stabbuf = 0, *stabstrbuf = 0, *stabrelbuf = 0;
static int stablen, stabstrlen, stabrellen;
@@ -189,9 +189,9 @@ static int stablen, stabstrlen, stabrellen;
static struct dfmt df_stabs;
void stabs_init(struct ofmt *, void *, FILE *, efunc);
-void stabs_linenum(const int8_t *filename, int32_t linenumber, int32_t);
-void stabs_deflabel(int8_t *, int32_t, int32_t, int, int8_t *);
-void stabs_directive(const int8_t *, const int8_t *);
+void stabs_linenum(const char *filename, int32_t linenumber, int32_t);
+void stabs_deflabel(char *, int32_t, int32_t, int, char *);
+void stabs_directive(const char *, const char *);
void stabs_typevalue(int32_t);
void stabs_output(int, void *);
void stabs_generate();
@@ -277,7 +277,7 @@ static void elf_cleanup(int debuginfo)
}
}
-static void add_sectname(int8_t *firsthalf, int8_t *secondhalf)
+static void add_sectname(char *firsthalf, char *secondhalf)
{
int len = strlen(firsthalf) + strlen(secondhalf);
while (shstrtablen + len + 1 > shstrtabsize)
@@ -287,7 +287,7 @@ static void add_sectname(int8_t *firsthalf, int8_t *secondhalf)
shstrtablen += len + 1;
}
-static int elf_make_section(int8_t *name, int type, int flags, int align)
+static int elf_make_section(char *name, int type, int flags, int align)
{
struct Section *s;
@@ -319,9 +319,9 @@ static int elf_make_section(int8_t *name, int type, int flags, int align)
return nsects - 1;
}
-static int32_t elf_section_names(int8_t *name, int pass, int *bits)
+static int32_t elf_section_names(char *name, int pass, int *bits)
{
- int8_t *p;
+ char *p;
int flags_and, flags_or, type, align, i;
/*
@@ -342,7 +342,7 @@ static int32_t elf_section_names(int8_t *name, int pass, int *bits)
while (*p && isspace(*p))
p++;
while (*p) {
- int8_t *q = p;
+ char *q = p;
while (*p && !isspace(*p))
p++;
if (*p)
@@ -424,8 +424,8 @@ static int32_t elf_section_names(int8_t *name, int pass, int *bits)
return sects[i]->index;
}
-static void elf_deflabel(int8_t *name, int32_t segment, int32_t offset,
- int is_global, int8_t *special)
+static void elf_deflabel(char *name, int32_t segment, int32_t offset,
+ int is_global, char *special)
{
int pos = strslen;
struct Symbol *sym;
@@ -459,7 +459,7 @@ static void elf_deflabel(int8_t *name, int32_t segment, int32_t offset,
if (!strcmp((*s)->name, name)) {
struct tokenval tokval;
expr *e;
- int8_t *p = special;
+ char *p = special;
while (*p && !isspace(*p))
p++;
@@ -586,7 +586,7 @@ static void elf_deflabel(int8_t *name, int32_t segment, int32_t offset,
struct tokenval tokval;
expr *e;
int fwd = FALSE;
- int8_t *saveme = stdscan_bufptr; /* bugfix? fbk 8/10/00 */
+ char *saveme = stdscan_bufptr; /* bugfix? fbk 8/10/00 */
while (special[n] && isspace(special[n]))
n++;
@@ -917,9 +917,9 @@ static void elf_write(void)
{
int nsections, align;
int scount;
- int8_t *p;
+ char *p;
int commlen;
- int8_t comment[64];
+ char comment[64];
int i;
struct SAA *symtab;
@@ -1228,25 +1228,25 @@ static int32_t elf_segbase(int32_t segment)
return segment;
}
-static int elf_directive(int8_t *directive, int8_t *value, int pass)
+static int elf_directive(char *directive, char *value, int pass)
{
return 0;
}
-static void elf_filename(int8_t *inname, int8_t *outname, efunc error)
+static void elf_filename(char *inname, char *outname, efunc error)
{
strcpy(elf_module, inname);
standard_extension(inname, outname, ".o", error);
}
-static const int8_t *elf_stdmac[] = {
+static const char *elf_stdmac[] = {
"%define __SECT__ [section .text]",
"%macro __NASM_CDecl__ 1",
"%define $_%1 $%1",
"%endmacro",
NULL
};
-static int elf_set_info(enum geninfo type, int8_t **val)
+static int elf_set_info(enum geninfo type, char **val)
{
return 0;
}
@@ -1289,10 +1289,10 @@ void stabs_init(struct ofmt *of, void *id, FILE * fp, efunc error)
{
}
-void stabs_linenum(const int8_t *filename, int32_t linenumber, int32_t segto)
+void stabs_linenum(const char *filename, int32_t linenumber, int32_t segto)
{
if (!stabs_filename) {
- stabs_filename = (int8_t *)nasm_malloc(strlen(filename) + 1);
+ stabs_filename = (char *)nasm_malloc(strlen(filename) + 1);
strcpy(stabs_filename, filename);
} else {
if (strcmp(stabs_filename, filename)) {
@@ -1302,7 +1302,7 @@ void stabs_linenum(const int8_t *filename, int32_t linenumber, int32_t segto)
/* why not nasm_free(stabs_filename); we're done with the old one */
- stabs_filename = (int8_t *)nasm_malloc(strlen(filename) + 1);
+ stabs_filename = (char *)nasm_malloc(strlen(filename) + 1);
strcpy(stabs_filename, filename);
}
}
@@ -1310,12 +1310,12 @@ void stabs_linenum(const int8_t *filename, int32_t linenumber, int32_t segto)
currentline = linenumber;
}
-void stabs_deflabel(int8_t *name, int32_t segment, int32_t offset, int is_global,
- int8_t *special)
+void stabs_deflabel(char *name, int32_t segment, int32_t offset, int is_global,
+ char *special)
{
}
-void stabs_directive(const int8_t *directive, const int8_t *params)
+void stabs_directive(const char *directive, const char *params)
{
}
@@ -1367,14 +1367,14 @@ void stabs_generate(void)
{
int i, numfiles, strsize, numstabs = 0, currfile, mainfileindex;
uint8_t *sbuf, *ssbuf, *rbuf, *sptr, *rptr;
- int8_t **allfiles;
+ char **allfiles;
int *fileidx;
struct linelist *ptr;
ptr = stabslines;
- allfiles = (int8_t **)nasm_malloc(numlinestabs * sizeof(int8_t *));
+ allfiles = (char **)nasm_malloc(numlinestabs * sizeof(char *));
for (i = 0; i < numlinestabs; i++)
allfiles[i] = 0;
numfiles = 0;
@@ -1421,7 +1421,7 @@ void stabs_generate(void)
rptr = rbuf;
for (i = 0; i < numfiles; i++) {
- strcpy((int8_t *)ssbuf + fileidx[i], allfiles[i]);
+ strcpy((char *)ssbuf + fileidx[i], allfiles[i]);
}
ssbuf[0] = 0;
diff --git a/output/outieee.c b/output/outieee.c
index 7cea69f..ea124fe 100644
--- a/output/outieee.c
+++ b/output/outieee.c
@@ -52,7 +52,7 @@
#define ARRAY_BOT 0x1
-static int8_t ieee_infile[FILENAME_MAX];
+static char ieee_infile[FILENAME_MAX];
static int ieee_uppercase;
static efunc error;
@@ -76,7 +76,7 @@ struct LineNumber {
static struct FileName {
struct FileName *next;
- int8_t *name;
+ char *name;
int32_t index;
} *fnhead, **fntail;
@@ -88,7 +88,7 @@ static struct Array {
static struct ieeePublic {
struct ieeePublic *next;
- int8_t *name;
+ char *name;
int32_t offset;
int32_t segment; /* only if it's far-absolute */
int32_t index;
@@ -97,7 +97,7 @@ static struct ieeePublic {
static struct ieeeExternal {
struct ieeeExternal *next;
- int8_t *name;
+ char *name;
int32_t commonsize;
} *exthead, **exttail;
@@ -125,7 +125,7 @@ static struct ieeeSection {
} combine;
int32_t use32; /* is this segment 32-bit? */
struct ieeePublic *pubhead, **pubtail, *lochead, **loctail;
- int8_t *name;
+ char *name;
} *seghead, **segtail, *ieee_seg_needs_update;
struct ieeeObjData {
@@ -161,16 +161,16 @@ static void ieee_data_new(struct ieeeSection *);
static void ieee_write_fixup(int32_t, int32_t, struct ieeeSection *,
int, uint32_t, int32_t);
static void ieee_install_fixup(struct ieeeSection *, struct ieeeFixupp *);
-static int32_t ieee_segment(int8_t *, int, int *);
+static int32_t ieee_segment(char *, int, int *);
static void ieee_write_file(int debuginfo);
static void ieee_write_byte(struct ieeeSection *, int);
static void ieee_write_word(struct ieeeSection *, int);
static void ieee_write_dword(struct ieeeSection *, int32_t);
-static void ieee_putascii(int8_t *, ...);
+static void ieee_putascii(char *, ...);
static void ieee_putcs(int);
static int32_t ieee_putld(int32_t, int32_t, uint8_t *);
static int32_t ieee_putlr(struct ieeeFixupp *);
-static void ieee_unqualified_name(int8_t *, int8_t *);
+static void ieee_unqualified_name(char *, char *);
/*
* pup init
@@ -196,7 +196,7 @@ static void ieee_init(FILE * fp, efunc errfunc, ldfunc ldef, evalfunc eval)
checksum = 0;
of_ieee.current_dfmt->init(&of_ieee, NULL, fp, errfunc);
}
-static int ieee_set_info(enum geninfo type, int8_t **val)
+static int ieee_set_info(enum geninfo type, char **val)
{
(void)type;
(void)val;
@@ -252,8 +252,8 @@ static void ieee_cleanup(int debuginfo)
/*
* callback for labels
*/
-static void ieee_deflabel(int8_t *name, int32_t segment,
- int32_t offset, int is_global, int8_t *special)
+static void ieee_deflabel(char *name, int32_t segment,
+ int32_t offset, int is_global, char *special)
{
/*
* We have three cases:
@@ -651,7 +651,7 @@ static void ieee_install_fixup(struct ieeeSection *seg,
/*
* segment registry
*/
-static int32_t ieee_segment(int8_t *name, int pass, int *bits)
+static int32_t ieee_segment(char *name, int pass, int *bits)
{
/*
* We call the label manager here to define a name for the new
@@ -668,7 +668,7 @@ static int32_t ieee_segment(int8_t *name, int pass, int *bits)
} else {
struct ieeeSection *seg;
int ieee_idx, attrs, rn_error;
- int8_t *p;
+ char *p;
/*
* Look for segment attributes.
@@ -805,7 +805,7 @@ static int32_t ieee_segment(int8_t *name, int pass, int *bits)
/*
* directives supported
*/
-static int ieee_directive(int8_t *directive, int8_t *value, int pass)
+static int ieee_directive(char *directive, char *value, int pass)
{
(void)value;
@@ -843,7 +843,7 @@ static int32_t ieee_segbase(int32_t segment)
/*
* filename
*/
-static void ieee_filename(int8_t *inname, int8_t *outname, efunc error)
+static void ieee_filename(char *inname, char *outname, efunc error)
{
strcpy(ieee_infile, inname);
standard_extension(inname, outname, ".o", error);
@@ -860,7 +860,7 @@ static void ieee_write_file(int debuginfo)
struct ieeeObjData *data;
struct ieeeFixupp *fix;
struct Array *arr;
- static int8_t boast[] = "The Netwide Assembler " NASM_VER;
+ static char boast[] = "The Netwide Assembler " NASM_VER;
int i;
/*
@@ -908,8 +908,8 @@ static void ieee_write_file(int debuginfo)
if (!debuginfo && !strcmp(seg->name, "??LINE"))
seg = seg->next;
while (seg) {
- int8_t buf[256];
- int8_t attrib;
+ char buf[256];
+ char attrib;
switch (seg->combine) {
case CMB_PUBLIC:
default:
@@ -958,7 +958,7 @@ static void ieee_write_file(int debuginfo)
i = 1;
for (seg = seghead; seg; seg = seg->next) {
for (pub = seg->pubhead; pub; pub = pub->next) {
- int8_t buf[256];
+ char buf[256];
ieee_unqualified_name(buf, pub->name);
ieee_putascii("NI%X,%02X%s.\r\n", i, strlen(buf), buf);
if (pub->segment == -1)
@@ -979,7 +979,7 @@ static void ieee_write_file(int debuginfo)
pub = fpubhead;
i = 1;
while (pub) {
- int8_t buf[256];
+ char buf[256];
ieee_unqualified_name(buf, pub->name);
ieee_putascii("NI%X,%02X%s.\r\n", i, strlen(buf), buf);
if (pub->segment == -1)
@@ -1003,7 +1003,7 @@ static void ieee_write_file(int debuginfo)
ext = exthead;
i = 1;
while (ext) {
- int8_t buf[256];
+ char buf[256];
ieee_unqualified_name(buf, ext->name);
ieee_putascii("NX%X,%02X%s.\r\n", i++, strlen(buf), buf);
ext = ext->next;
@@ -1030,7 +1030,7 @@ static void ieee_write_file(int debuginfo)
i = 1;
for (seg = seghead; seg && debuginfo; seg = seg->next) {
for (loc = seg->lochead; loc; loc = loc->next) {
- int8_t buf[256];
+ char buf[256];
ieee_unqualified_name(buf, loc->name);
ieee_putascii("NN%X,%02X%s.\r\n", i, strlen(buf), buf);
if (loc->segment == -1)
@@ -1114,9 +1114,9 @@ static void ieee_write_dword(struct ieeeSection *seg, int32_t data)
ieee_write_byte(seg, (data >> 16) & 0xFF);
ieee_write_byte(seg, (data >> 24) & 0xFF);
}
-static void ieee_putascii(int8_t *format, ...)
+static void ieee_putascii(char *format, ...)
{
- int8_t buffer[256];
+ char buffer[256];
int i, l;
va_list ap;
@@ -1189,7 +1189,7 @@ static int32_t ieee_putlr(struct ieeeFixupp *p)
* becomes an issue if real mode code is used. A pure 32-bit linker could
* get away without defining the virtual mode...
*/
- int8_t buf[40];
+ char buf[40];
int32_t size = p->size;
switch (p->ftype) {
case FT_SEG:
@@ -1241,7 +1241,7 @@ static int32_t ieee_putlr(struct ieeeFixupp *p)
/* Dump all segment data (text and fixups )*/
-static void ieee_unqualified_name(int8_t *dest, int8_t *source)
+static void ieee_unqualified_name(char *dest, char *source)
{
if (ieee_uppercase) {
while (*source)
@@ -1297,7 +1297,7 @@ static void dbgls_cleanup(void)
* so, we have to make sure the ??LINE segment is avaialbe
* as the first segment when this debug format is selected
*/
-static void dbgls_linnum(const int8_t *lnfname, int32_t lineno, int32_t segto)
+static void dbgls_linnum(const char *lnfname, int32_t lineno, int32_t segto)
{
struct FileName *fn;
struct ieeeSection *seg;
@@ -1344,8 +1344,8 @@ static void dbgls_linnum(const int8_t *lnfname, int32_t lineno, int32_t segto)
seg->currentpos);
}
-static void dbgls_deflabel(int8_t *name, int32_t segment,
- int32_t offset, int is_global, int8_t *special)
+static void dbgls_deflabel(char *name, int32_t segment,
+ int32_t offset, int is_global, char *special)
{
struct ieeeSection *seg;
int used_special; /* have we used the special text? */
diff --git a/output/outmacho.c b/output/outmacho.c
index 6d18fdb..5e71900 100644
--- a/output/outmacho.c
+++ b/output/outmacho.c
@@ -56,8 +56,8 @@ struct section {
int align;
/* data that goes into the file */
- int8_t sectname[16]; /* what this section is called */
- int8_t segname[16]; /* segment this section will be in */
+ char sectname[16]; /* what this section is called */
+ char segname[16]; /* segment this section will be in */
uint32_t size; /* in-memory and -file size */
uint32_t nreloc; /* relocation entry count */
uint32_t flags; /* type and attributes (masked) */
@@ -78,9 +78,9 @@ struct section {
static struct sectmap {
- const int8_t *nasmsect;
- const int8_t *segname;
- const int8_t *sectname;
+ const char *nasmsect;
+ const char *segname;
+ const char *sectname;
const int32_t flags;
} sectmap[] = { {
".text", "__TEXT", "__text", S_REGULAR|S_ATTR_SOME_INSTRUCTIONS}, {
@@ -111,7 +111,7 @@ struct reloc {
struct symbol {
/* nasm internal data */
struct symbol *next; /* next symbol in the list */
- int8_t *name; /* name of this symbol */
+ char *name; /* name of this symbol */
int32_t initial_snum; /* symbol number used above in
reloc */
int32_t snum; /* true snum for reloc */
@@ -205,7 +205,7 @@ static int exact_log2 (uint32_t align) {
if (align != (align & -align)) {
return -1;
} else {
-#if __GNUC__ >= 4
+#ifdef __GNUC__
return (align ? __builtin_ctzl (align) : 0);
#else
uint32_t result = 0;
@@ -219,8 +219,8 @@ static int exact_log2 (uint32_t align) {
}
}
-static struct section *get_section_by_name(const int8_t *segname,
- const int8_t *sectname)
+static struct section *get_section_by_name(const char *segname,
+ const char *sectname)
{
struct section *s;
@@ -242,8 +242,8 @@ static struct section *get_section_by_index(const int32_t index)
return s;
}
-static int32_t get_section_index_by_name(const int8_t *segname,
- const int8_t *sectname)
+static int32_t get_section_index_by_name(const char *segname,
+ const char *sectname)
{
struct section *s;
@@ -254,7 +254,7 @@ static int32_t get_section_index_by_name(const int8_t *segname,
return -1;
}
-static int8_t *get_section_name_by_index(const int32_t index)
+static char *get_section_name_by_index(const int32_t index)
{
struct section *s;
@@ -284,7 +284,7 @@ static uint8_t get_section_fileindex_by_index(const int32_t index)
static void macho_init(FILE * fp, efunc errfunc, ldfunc ldef,
evalfunc eval)
{
- int8_t zero = 0;
+ char zero = 0;
machofp = fp;
error = errfunc;
@@ -306,11 +306,11 @@ static void macho_init(FILE * fp, efunc errfunc, ldfunc ldef,
strs = saa_init(1L);
/* string table starts with a zero byte - don't ask why */
- saa_wbytes(strs, &zero, sizeof(int8_t));
+ saa_wbytes(strs, &zero, sizeof(char));
strslen = 1;
}
-static int macho_setinfo(enum geninfo type, int8_t **val)
+static int macho_setinfo(enum geninfo type, char **val)
{
return 0;
}
@@ -505,10 +505,10 @@ static void macho_output(int32_t secto, const void *data, uint32_t type,
}
}
-static int32_t macho_section(int8_t *name, int pass, int *bits)
+static int32_t macho_section(char *name, int pass, int *bits)
{
int32_t index, originalIndex;
- int8_t *sectionAttributes;
+ char *sectionAttributes;
struct sectmap *sm;
struct section *s;
@@ -525,7 +525,7 @@ static int32_t macho_section(int8_t *name, int pass, int *bits)
for (sm = sectmap; sm->nasmsect != NULL; ++sm) {
/* make lookup into section name translation table */
if (!strcmp(name, sm->nasmsect)) {
- int8_t *currentAttribute;
+ char *currentAttribute;
/* try to find section with that name */
originalIndex = index = get_section_index_by_name(sm->segname,
@@ -557,7 +557,7 @@ static int32_t macho_section(int8_t *name, int pass, int *bits)
&& (currentAttribute = strtok((char*)&sectionAttributes, " \t"))) {
if (0 != *currentAttribute) {
if (0 == strncasecmp("align=", currentAttribute, 6)) {
- int8_t *end;
+ char *end;
int newAlignment, value;
value = strtoul(currentAttribute + 6, (char**)&end, 0);
@@ -612,8 +612,8 @@ static int32_t macho_section(int8_t *name, int pass, int *bits)
return NO_SEG;
}
-static void macho_symdef(int8_t *name, int32_t section, int32_t offset,
- int is_global, int8_t *special)
+static void macho_symdef(char *name, int32_t section, int32_t offset,
+ int is_global, char *special)
{
struct symbol *sym;
@@ -689,17 +689,17 @@ static int32_t macho_segbase(int32_t section)
return section;
}
-static int macho_directive(int8_t *directive, int8_t *value, int pass)
+static int macho_directive(char *directive, char *value, int pass)
{
return 0;
}
-static void macho_filename(int8_t *inname, int8_t *outname, efunc error)
+static void macho_filename(char *inname, char *outname, efunc error)
{
standard_extension(inname, outname, ".o", error);
}
-static const int8_t *macho_stdmac[] = {
+static const char *macho_stdmac[] = {
"%define __SECT__ [section .text]",
"%macro __NASM_CDecl__ 1",
"%endmacro",
@@ -731,7 +731,7 @@ static void macho_layout_symbols (uint32_t *numsyms,
uint32_t i,j;
*numsyms = 0;
- *strtabsize = sizeof (int8_t);
+ *strtabsize = sizeof (char);
symp = &syms;
@@ -944,7 +944,7 @@ static void macho_write_section (void)
{
struct section *s, *s2;
struct reloc *r;
- int8_t *rel_paddata = "\0\0\0";
+ char *rel_paddata = "\0\0\0";
uint8_t fi, *p, *q, blk[4];
int32_t l;
@@ -1118,7 +1118,7 @@ static void macho_write (void)
** uint32_t command type == LC_SEGMENT
** uint32_t size of load command
** (including section load commands)
- ** int8_t[16] segment name
+ ** char[16] segment name
** uint32_t in-memory offset
** uint32_t in-memory size
** uint32_t in-file offset to data area
@@ -1130,8 +1130,8 @@ static void macho_write (void)
** uint32_t flags
**
** section commands
- ** int8_t[16] section name
- ** int8_t[16] segment name
+ ** char[16] section name
+ ** char[16] segment name
** uint32_t in-memory offset
** uint32_t in-memory size
** uint32_t in-file offset
diff --git a/output/outobj.c b/output/outobj.c
index b77cdae..f960183 100644
--- a/output/outobj.c
+++ b/output/outobj.c
@@ -379,7 +379,7 @@ static ObjRecord *obj_value(ObjRecord * orp, uint32_t val)
/*
* Writes a counted string
*/
-static ObjRecord *obj_name(ObjRecord * orp, int8_t *name)
+static ObjRecord *obj_name(ObjRecord * orp, char *name)
{
int len = strlen(name);
uint8_t *ptr;
@@ -459,7 +459,7 @@ static void ori_null(ObjRecord * orp)
* This concludes the low level section of outobj.c
*/
-static int8_t obj_infile[FILENAME_MAX];
+static char obj_infile[FILENAME_MAX];
static efunc error;
static evalfunc evaluate;
@@ -486,7 +486,7 @@ struct LineNumber {
static struct FileName {
struct FileName *next;
- int8_t *name;
+ char *name;
struct LineNumber *lnhead, **lntail;
int index;
} *fnhead, **fntail;
@@ -501,7 +501,7 @@ static struct Array {
static struct Public {
struct Public *next;
- int8_t *name;
+ char *name;
int32_t offset;
int32_t segment; /* only if it's far-absolute */
int type; /* only for local debug syms */
@@ -509,7 +509,7 @@ static struct Public {
static struct External {
struct External *next;
- int8_t *name;
+ char *name;
int32_t commonsize;
int32_t commonelem; /* element size if FAR, else zero */
int index; /* OBJ-file external index */
@@ -520,7 +520,7 @@ static struct External {
DEFWRT_GROUP /* a group */
} defwrt_type;
union {
- int8_t *string;
+ char *string;
struct Segment *seg;
struct Group *grp;
} defwrt_ptr;
@@ -549,36 +549,36 @@ static struct Segment {
} combine;
int32_t use32; /* is this segment 32-bit? */
struct Public *pubhead, **pubtail, *lochead, **loctail;
- int8_t *name;
- int8_t *segclass, *overlay; /* `class' is a C++ keyword :-) */
+ char *name;
+ char *segclass, *overlay; /* `class' is a C++ keyword :-) */
ObjRecord *orp;
} *seghead, **segtail, *obj_seg_needs_update;
static struct Group {
struct Group *next;
- int8_t *name;
+ char *name;
int32_t index; /* NASM segment id */
int32_t obj_index; /* OBJ-file group index */
int32_t nentries; /* number of elements... */
int32_t nindices; /* ...and number of index elts... */
union {
int32_t index;
- int8_t *name;
+ char *name;
} segs[GROUP_MAX]; /* ...in this */
} *grphead, **grptail, *obj_grp_needs_update;
static struct ImpDef {
struct ImpDef *next;
- int8_t *extname;
- int8_t *libname;
+ char *extname;
+ char *libname;
unsigned int impindex;
- int8_t *impname;
+ char *impname;
} *imphead, **imptail;
static struct ExpDef {
struct ExpDef *next;
- int8_t *intname;
- int8_t *extname;
+ char *intname;
+ char *extname;
unsigned int ordinal;
int flags;
} *exphead, **exptail;
@@ -595,9 +595,9 @@ struct ofmt of_obj;
/* The current segment */
static struct Segment *current_seg;
-static int32_t obj_segment(int8_t *, int, int *);
+static int32_t obj_segment(char *, int, int *);
static void obj_write_file(int debuginfo);
-static int obj_directive(int8_t *, int8_t *, int);
+static int obj_directive(char *, char *, int);
static void obj_init(FILE * fp, efunc errfunc, ldfunc ldef, evalfunc eval)
{
@@ -632,7 +632,7 @@ static void obj_init(FILE * fp, efunc errfunc, ldfunc ldef, evalfunc eval)
of_obj.current_dfmt->init(&of_obj, NULL, fp, errfunc);
}
-static int obj_set_info(enum geninfo type, int8_t **val)
+static int obj_set_info(enum geninfo type, char **val)
{
(void)type;
(void)val;
@@ -695,7 +695,7 @@ static void obj_cleanup(int debuginfo)
}
}
-static void obj_ext_set_defwrt(struct External *ext, int8_t *id)
+static void obj_ext_set_defwrt(struct External *ext, char *id)
{
struct Segment *seg;
struct Group *grp;
@@ -722,8 +722,8 @@ static void obj_ext_set_defwrt(struct External *ext, int8_t *id)
dws = ext;
}
-static void obj_deflabel(int8_t *name, int32_t segment,
- int32_t offset, int is_global, int8_t *special)
+static void obj_deflabel(char *name, int32_t segment,
+ int32_t offset, int is_global, char *special)
{
/*
* We have three cases:
@@ -888,7 +888,7 @@ static void obj_deflabel(int8_t *name, int32_t segment,
* We might have a default-WRT specification.
*/
if (!nasm_strnicmp(special, "wrt", 3)) {
- int8_t *p;
+ char *p;
int len;
special += 3;
special += strspn(special, " \t");
@@ -1255,7 +1255,7 @@ static void obj_write_fixup(ObjRecord * orp, int bytes,
obj_commit(forp);
}
-static int32_t obj_segment(int8_t *name, int pass, int *bits)
+static int32_t obj_segment(char *name, int pass, int *bits)
{
/*
* We call the label manager here to define a name for the new
@@ -1277,7 +1277,7 @@ static int32_t obj_segment(int8_t *name, int pass, int *bits)
struct Group *grp;
struct External **extp;
int obj_idx, i, attrs, rn_error;
- int8_t *p;
+ char *p;
/*
* Look for segment attributes.
@@ -1506,10 +1506,10 @@ static int32_t obj_segment(int8_t *name, int pass, int *bits)
}
}
-static int obj_directive(int8_t *directive, int8_t *value, int pass)
+static int obj_directive(char *directive, char *value, int pass)
{
if (!strcmp(directive, "group")) {
- int8_t *p, *q, *v;
+ char *p, *q, *v;
if (pass == 1) {
struct Group *grp;
struct Segment *seg;
@@ -1623,7 +1623,7 @@ static int obj_directive(int8_t *directive, int8_t *value, int pass)
return 1;
}
if (!strcmp(directive, "import")) {
- int8_t *q, *extname, *libname, *impname;
+ char *q, *extname, *libname, *impname;
if (pass == 2)
return 1; /* ignore in pass two */
@@ -1669,7 +1669,7 @@ static int obj_directive(int8_t *directive, int8_t *value, int pass)
return 1;
}
if (!strcmp(directive, "export")) {
- int8_t *q, *extname, *intname, *v;
+ char *q, *extname, *intname, *v;
struct ExpDef *export;
int flags = 0;
unsigned int ordinal = 0;
@@ -1797,7 +1797,7 @@ static int32_t obj_segbase(int32_t segment)
return segment; /* no special treatment */
}
-static void obj_filename(int8_t *inname, int8_t *outname, efunc lerror)
+static void obj_filename(char *inname, char *outname, efunc lerror)
{
strcpy(obj_infile, inname);
standard_extension(inname, outname, ".obj", lerror);
@@ -1813,7 +1813,7 @@ static void obj_write_file(int debuginfo)
struct External *ext;
struct ImpDef *imp;
struct ExpDef *export;
- static int8_t boast[] = "The Netwide Assembler " NASM_VER;
+ static char boast[] = "The Netwide Assembler " NASM_VER;
int lname_idx;
ObjRecord *orp;
@@ -2290,7 +2290,7 @@ void obj_fwrite(ObjRecord * orp)
fputc((-cksum) & 0xFF, ofp);
}
-static const int8_t *obj_stdmac[] = {
+static const char *obj_stdmac[] = {
"%define __SECT__ [section .text]",
"%imacro group 1+.nolist",
"[group %1]",
@@ -2351,7 +2351,7 @@ static void dbgbi_cleanup(void)
}
}
-static void dbgbi_linnum(const int8_t *lnfname, int32_t lineno, int32_t segto)
+static void dbgbi_linnum(const char *lnfname, int32_t lineno, int32_t segto)
{
struct FileName *fn;
struct LineNumber *ln;
@@ -2402,8 +2402,8 @@ static void dbgbi_linnum(const int8_t *lnfname, int32_t lineno, int32_t segto)
fn->lntail = &ln->next;
}
-static void dbgbi_deflabel(int8_t *name, int32_t segment,
- int32_t offset, int is_global, int8_t *special)
+static void dbgbi_deflabel(char *name, int32_t segment,
+ int32_t offset, int is_global, char *special)
{
struct Segment *seg;
diff --git a/output/outrdf.c b/output/outrdf.c
index 624cc72..3c72652 100644
--- a/output/outrdf.c
+++ b/output/outrdf.c
@@ -30,7 +30,7 @@
typedef int16_t int16; /* not sure if this will be required to be altered
at all... best to typedef it just in case */
-static const int8_t *RDOFFId = "RDOFF1"; /* written to start of RDOFF files */
+static const char *RDOFFId = "RDOFF1"; /* written to start of RDOFF files */
/* the records that can be found in the RDOFF header */
@@ -42,39 +42,39 @@ static const int8_t *RDOFFId = "RDOFF1"; /* written to start of RDOFF files */
* 32764. */
struct RelocRec {
- int8_t type; /* must be 1 */
- int8_t segment; /* only 0 for code, or 1 for data supported,
+ char type; /* must be 1 */
+ char segment; /* only 0 for code, or 1 for data supported,
* but add 64 for relative refs (ie do not require
* reloc @ loadtime, only linkage) */
int32_t offset; /* from start of segment in which reference is loc'd */
- int8_t length; /* 1 2 or 4 bytes */
+ char length; /* 1 2 or 4 bytes */
int16 refseg; /* segment to which reference refers to */
};
struct ImportRec {
- int8_t type; /* must be 2 */
+ char type; /* must be 2 */
int16 segment; /* segment number allocated to the label for reloc
* records - label is assumed to be at offset zero
* in this segment, so linker must fix up with offset
* of segment and of offset within segment */
- int8_t label[33]; /* zero terminated... should be written to file until
+ char label[33]; /* zero terminated... should be written to file until
* the zero, but not after it - max len = 32 chars */
};
struct ExportRec {
- int8_t type; /* must be 3 */
- int8_t segment; /* segment referred to (0/1) */
+ char type; /* must be 3 */
+ char segment; /* segment referred to (0/1) */
int32_t offset; /* offset within segment */
- int8_t label[33]; /* zero terminated as above. max len = 32 chars */
+ char label[33]; /* zero terminated as above. max len = 32 chars */
};
struct DLLRec {
- int8_t type; /* must be 4 */
- int8_t libname[128]; /* name of library to link with at load time */
+ char type; /* must be 4 */
+ char libname[128]; /* name of library to link with at load time */
};
struct BSSRec {
- int8_t type; /* must be 5 */
+ char type; /* must be 5 */
int32_t amount; /* number of bytes BSS to reserve */
};
@@ -87,7 +87,7 @@ struct BSSRec {
typedef struct memorybuffer {
int length;
- int8_t buffer[BUF_BLOCK_LEN];
+ char buffer[BUF_BLOCK_LEN];
struct memorybuffer *next;
} memorybuffer;
@@ -209,7 +209,7 @@ static void rdf_init(FILE * fp, efunc errfunc, ldfunc ldef, evalfunc eval)
bsslength = 0;
}
-static int32_t rdf_section_names(int8_t *name, int pass, int *bits)
+static int32_t rdf_section_names(char *name, int pass, int *bits)
{
/*
* Default is 32 bits.
@@ -275,8 +275,8 @@ static void write_dll_rec(struct DLLRec *r)
membufwrite(header, r->libname, strlen(r->libname) + 1);
}
-static void rdf_deflabel(int8_t *name, int32_t segment, int32_t offset,
- int is_global, int8_t *special)
+static void rdf_deflabel(char *name, int32_t segment, int32_t offset,
+ int is_global, char *special)
{
struct ExportRec r;
struct ImportRec ri;
@@ -493,7 +493,7 @@ static int32_t rdf_segbase(int32_t segment)
return segment;
}
-static int rdf_directive(int8_t *directive, int8_t *value, int pass)
+static int rdf_directive(char *directive, char *value, int pass)
{
struct DLLRec r;
@@ -509,12 +509,12 @@ static int rdf_directive(int8_t *directive, int8_t *value, int pass)
return 0;
}
-static void rdf_filename(int8_t *inname, int8_t *outname, efunc error)
+static void rdf_filename(char *inname, char *outname, efunc error)
{
standard_extension(inname, outname, ".rdf", error);
}
-static int8_t *rdf_stdmac[] = {
+static char *rdf_stdmac[] = {
"%define __SECT__ [section .text]",
"%imacro library 1+.nolist",
"[library %1]",
@@ -524,7 +524,7 @@ static int8_t *rdf_stdmac[] = {
NULL
};
-static int rdf_set_info(enum geninfo type, int8_t **val)
+static int rdf_set_info(enum geninfo type, char **val)
{
return 0;
}
diff --git a/output/outrdf2.c b/output/outrdf2.c
index 62adf9c..15f9b3a 100644
--- a/output/outrdf2.c
+++ b/output/outrdf2.c
@@ -28,7 +28,7 @@
#include "rdoff/rdoff.h"
/* This signature is written to start of RDOFF files */
-static const int8_t *RDOFF2Id = RDOFF2_SIGNATURE;
+static const char *RDOFF2Id = RDOFF2_SIGNATURE;
/* Note that whenever a segment is referred to in the RDOFF file, its number
* is always half of the segment number that NASM uses to refer to it; this
@@ -39,7 +39,7 @@ static const int8_t *RDOFF2Id = RDOFF2_SIGNATURE;
#define COUNT_SEGTYPES 9
-static int8_t *segmenttypes[COUNT_SEGTYPES] = {
+static char *segmenttypes[COUNT_SEGTYPES] = {
"null", "text", "code", "data",
"comment", "lcomment", "pcomment",
"symdebug", "linedebug"
@@ -70,7 +70,7 @@ static FILE *ofile;
static efunc error;
static struct seginfo {
- int8_t *segname;
+ char *segname;
int segnumber;
uint16_t segtype;
uint16_t segreserved;
@@ -127,10 +127,10 @@ static void rdf2_init(FILE * fp, efunc errfunc, ldfunc ldef, evalfunc eval)
headerlength = 0;
}
-static int32_t rdf2_section_names(int8_t *name, int pass, int *bits)
+static int32_t rdf2_section_names(char *name, int pass, int *bits)
{
int i;
- int8_t *p, *q;
+ char *p, *q;
int code = -1;
int reserved = 0;
@@ -223,7 +223,7 @@ static int32_t rdf2_section_names(int8_t *name, int pass, int *bits)
*/
static void write_reloc_rec(struct RelocRec *r)
{
- int8_t buf[4], *b;
+ char buf[4], *b;
if (r->refseg != (uint16_t) NO_SEG && (r->refseg & 1)) /* segment base ref */
r->type = RDFREC_SEGRELOC;
@@ -248,7 +248,7 @@ static void write_reloc_rec(struct RelocRec *r)
*/
static void write_export_rec(struct ExportRec *r)
{
- int8_t buf[4], *b;
+ char buf[4], *b;
r->segment >>= 1;
@@ -265,7 +265,7 @@ static void write_export_rec(struct ExportRec *r)
static void write_import_rec(struct ImportRec *r)
{
- int8_t buf[4], *b;
+ char buf[4], *b;
r->segment >>= 1;
@@ -284,7 +284,7 @@ static void write_import_rec(struct ImportRec *r)
*/
static void write_bss_rec(struct BSSRec *r)
{
- int8_t buf[4], *b;
+ char buf[4], *b;
saa_wbytes(header, &r->type, 1);
saa_wbytes(header, &r->reclen, 1);
@@ -299,7 +299,7 @@ static void write_bss_rec(struct BSSRec *r)
*/
static void write_common_rec(struct CommonRec *r)
{
- int8_t buf[4], *b;
+ char buf[4], *b;
r->segment >>= 1;
@@ -343,15 +343,15 @@ static void write_modname_rec(struct ModRec *r)
/*
* Handle export, import and common records.
*/
-static void rdf2_deflabel(int8_t *name, int32_t segment, int32_t offset,
- int is_global, int8_t *special)
+static void rdf2_deflabel(char *name, int32_t segment, int32_t offset,
+ int is_global, char *special)
{
struct ExportRec r;
struct ImportRec ri;
struct CommonRec ci;
static int farsym = 0;
static int i;
- int8_t symflags = 0;
+ char symflags = 0;
int len;
/* Check if the label length is OK */
@@ -462,7 +462,7 @@ static void rdf2_deflabel(int8_t *name, int32_t segment, int32_t offset,
static void membufwrite(int segment, const void *data, int bytes)
{
int i;
- int8_t buf[4], *b;
+ char buf[4], *b;
for (i = 0; i < nsegments; i++) {
if (segments[i].segnumber == segment)
@@ -704,7 +704,7 @@ static int32_t rdf2_segbase(int32_t segment)
/*
* Handle RDOFF2 specific directives
*/
-static int rdf2_directive(int8_t *directive, int8_t *value, int pass)
+static int rdf2_directive(char *directive, char *value, int pass)
{
int n;
@@ -739,12 +739,12 @@ static int rdf2_directive(int8_t *directive, int8_t *value, int pass)
return 0;
}
-static void rdf2_filename(int8_t *inname, int8_t *outname, efunc error)
+static void rdf2_filename(char *inname, char *outname, efunc error)
{
standard_extension(inname, outname, ".rdf", error);
}
-static const int8_t *rdf2_stdmac[] = {
+static const char *rdf2_stdmac[] = {
"%define __SECT__ [section .text]",
"%imacro library 1+.nolist",
"[library %1]",
@@ -757,7 +757,7 @@ static const int8_t *rdf2_stdmac[] = {
NULL
};
-static int rdf2_set_info(enum geninfo type, int8_t **val)
+static int rdf2_set_info(enum geninfo type, char **val)
{
return 0;
}