Minor fixes to make it possible to compile with MS Visual C++ 2005.
Unfortunately, MSVC++ is not fully C99 compliant; in particular, it
doesn't handle interspersed declarations and other code. Furthermore,
it chokes on some expressions in outelf64.c, which fortunately can be
easily substituted with simpler expressions.
static void bin_cleanup(int debuginfo)
{
- (void)debuginfo; /* placate optimizers */
struct Section *g, **gp;
struct Section *gs = NULL, **gsp;
struct Section *s, **sp;
uint64_t pend;
int h;
+ (void)debuginfo; /* placate optimizers */
+
#ifdef DEBUG
fprintf(stdout,
"bin_cleanup: Sections were initially referenced in this order:\n");
void stabs32_directive(const char *, const char *);
void stabs32_typevalue(int32_t);
void stabs32_output(int, void *);
-void stabs32_generate();
-void stabs32_cleanup();
+void stabs32_generate(void);
+void stabs32_cleanup(void);
/* end of stabs debugging stuff */
static int elf_directive(char *directive, char *value, int pass)
{
- (void)directive;
- (void)value;
- (void)pass;
- return 0;
+ (void)directive;
+ (void)value;
+ (void)pass;
+ return 0;
}
static void elf_filename(char *inname, char *outname, efunc error)
void stabs32_linenum(const char *filename, int32_t linenumber, int32_t segto)
{
(void)segto;
+
if (!stabs_filename) {
stabs_filename = (char *)nasm_malloc(strlen(filename) + 1);
strcpy(stabs_filename, filename);
stabstrbuf = ssbuf;
}
-void stabs32_cleanup()
+void stabs32_cleanup(void)
{
struct linelist *ptr, *del;
if (!stabslines)
void stabs64_directive(const char *, const char *);
void stabs64_typevalue(int32_t);
void stabs64_output(int, void *);
-void stabs64_generate();
-void stabs64_cleanup();
+void stabs64_generate(void);
+void stabs64_cleanup(void);
/* end of stabs debugging stuff */
(void)directive;
(void)value;
(void)pass;
- return 0;
+ return 0;
}
static void elf_filename(char *inname, char *outname, efunc error)
/* member must be adjusted by adding 3 */
WRITEDLONG(rptr, (int64_t)(sptr - sbuf) - 4);
- WRITEDLONG(rptr, ((int64_t)(ptr->info.section + 3) << 32) | R_X86_64_32);
+ WRITELONG(rptr, R_X86_64_32);
+ WRITELONG(rptr, ptr->info.section + 3);
numstabs++;
currfile = mainfileindex;
/* relocation table entry */
WRITEDLONG(rptr, (int64_t)(sptr - sbuf) - 4);
- WRITEDLONG(rptr, ((int64_t)(ptr->info.section + 3) << 32) | R_X86_64_32);
+ WRITELONG(rptr, R_X86_64_32);
+ WRITELONG(rptr, ptr->info.section + 3);
}
WRITE_STAB(sptr, 0, N_SLINE, 0, ptr->line, ptr->info.offset);
/* relocation table entry */
WRITEDLONG(rptr, (int64_t)(sptr - sbuf) - 4);
- WRITEDLONG(rptr, ((int64_t)(ptr->info.section + 3) << 32) | R_X86_64_32);
+ WRITELONG(rptr, R_X86_64_32);
+ WRITELONG(rptr, ptr->info.section + 3);
ptr = ptr->next;
static int32_t macho_section(char *name, int pass, int *bits)
{
-
- (void)pass;
-
int32_t index, originalIndex;
char *sectionAttributes;
struct sectmap *sm;
struct section *s;
+ (void)pass;
+
/* Default to 32 bits. */
if (!name) {
*bits = 32;
static void rdf2_init(FILE * fp, efunc errfunc, ldfunc ldef, evalfunc eval)
{
-
+ int segtext, segdata, segbss;
+
(void)ldef;
(void)eval;
maxbits = 64;
- int segtext, segdata, segbss;
-
/* set up the initial segments */
segments[0].segname = ".text";
segments[0].segnumber = 0;
static int32_t rdf2_section_names(char *name, int pass, int *bits)
{
-
- (void)pass;
-
int i;
char *p, *q;
int code = -1;
int reserved = 0;
+ (void)pass;
+
/*
* Default is 32 bits, in the text segment.
*/