cbfstool: avoid naming variables "index"
Those may collide with strings.h's index(), included transitively through system headers. Change-Id: I6b03236844509ea85cfcdc0a37acf1df97d4c5f3 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/12279 Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com> Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
parent
f7613ecacc
commit
172a14de8e
|
@ -1287,7 +1287,7 @@ int elf_writer_add_symbol(struct elf_writer *ew, const char *name,
|
||||||
Elf64_Addr value, Elf64_Word size,
|
Elf64_Addr value, Elf64_Word size,
|
||||||
int binding, int type)
|
int binding, int type)
|
||||||
{
|
{
|
||||||
int index;
|
int i;
|
||||||
Elf64_Sym sym = {
|
Elf64_Sym sym = {
|
||||||
.st_value = value,
|
.st_value = value,
|
||||||
.st_size = size,
|
.st_size = size,
|
||||||
|
@ -1299,15 +1299,15 @@ int elf_writer_add_symbol(struct elf_writer *ew, const char *name,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
index = elf_writer_add_string(ew, name);
|
i = elf_writer_add_string(ew, name);
|
||||||
if (index < 0)
|
if (i < 0)
|
||||||
return -1;
|
return -1;
|
||||||
sym.st_name = index;
|
sym.st_name = i;
|
||||||
|
|
||||||
index = elf_writer_section_index(ew, section_name);
|
i = elf_writer_section_index(ew, section_name);
|
||||||
if (index < 0)
|
if (i < 0)
|
||||||
return -1;
|
return -1;
|
||||||
sym.st_shndx = index;
|
sym.st_shndx = i;
|
||||||
|
|
||||||
ew->symtab.syms[ew->symtab.num_entries++] = sym;
|
ew->symtab.syms[ew->symtab.num_entries++] = sym;
|
||||||
|
|
||||||
|
@ -1316,16 +1316,16 @@ int elf_writer_add_symbol(struct elf_writer *ew, const char *name,
|
||||||
|
|
||||||
static int elf_sym_index(struct elf_writer *ew, const char *sym)
|
static int elf_sym_index(struct elf_writer *ew, const char *sym)
|
||||||
{
|
{
|
||||||
int index;
|
int j;
|
||||||
size_t i;
|
size_t i;
|
||||||
Elf64_Word st_name;
|
Elf64_Word st_name;
|
||||||
|
|
||||||
/* Determine index of symbol in the string table. */
|
/* Determine index of symbol in the string table. */
|
||||||
index = elf_writer_add_string(ew, sym);
|
j = elf_writer_add_string(ew, sym);
|
||||||
if (index < 0)
|
if (j < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
st_name = index;
|
st_name = j;
|
||||||
|
|
||||||
for (i = 0; i < ew->symtab.num_entries; i++)
|
for (i = 0; i < ew->symtab.num_entries; i++)
|
||||||
if (ew->symtab.syms[i].st_name == st_name)
|
if (ew->symtab.syms[i].st_name == st_name)
|
||||||
|
|
Loading…
Reference in New Issue