0
0
forked from aniani/nasm

output/codeview.c: remove C99-ism

Remove a C99-ism, specifically the use of a variable declaration
inside a for loop statement.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin
2017-02-23 18:43:31 -08:00
parent 9222364607
commit 3fa2558a69

View File

@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------- * /* ----------------------------------------------------------------------- *
* *
* Copyright 1996-2016 The NASM Authors - All Rights Reserved * Copyright 1996-2017 The NASM Authors - All Rights Reserved
* See the file AUTHORS included with the NASM distribution for * See the file AUTHORS included with the NASM distribution for
* the specific copyright holders. * the specific copyright holders.
* *
@@ -436,6 +436,7 @@ static void register_reloc(struct coff_Section *const sect,
{ {
struct coff_Reloc *r; struct coff_Reloc *r;
struct coff_Section *sec; struct coff_Section *sec;
uint32_t i;
r = *sect->tail = nasm_malloc(sizeof(struct coff_Reloc)); r = *sect->tail = nasm_malloc(sizeof(struct coff_Reloc));
sect->tail = &r->next; sect->tail = &r->next;
@@ -447,7 +448,7 @@ static void register_reloc(struct coff_Section *const sect,
r->type = type; r->type = type;
r->symbol = 0; r->symbol = 0;
for (int i = 0; i < coff_nsects; i++) { for (i = 0; i < (uint32_t)coff_nsects; i++) {
sec = coff_sects[i]; sec = coff_sects[i];
if (!strcmp(sym, sec->name)) { if (!strcmp(sym, sec->name)) {
return; return;
@@ -456,7 +457,7 @@ static void register_reloc(struct coff_Section *const sect,
} }
saa_rewind(coff_syms); saa_rewind(coff_syms);
for (uint32_t i = 0; i < coff_nsyms; i++) { for (i = 0; i < coff_nsyms; i++) {
struct coff_Symbol *s = saa_rstruct(coff_syms); struct coff_Symbol *s = saa_rstruct(coff_syms);
r->symbol++; r->symbol++;
if (s->strpos == -1 && !strcmp(sym, s->name)) { if (s->strpos == -1 && !strcmp(sym, s->name)) {