Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 49065
b: refs/heads/master
c: ca82018
h: refs/heads/master
i:
  49063: 802c6ce
v: v3
  • Loading branch information
Robert P. J. Day authored and Adrian Bunk committed Feb 17, 2007
1 parent 878facb commit c7aff51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d08df601a30df9e36c29f3214315f4f0c8784c68
refs/heads/master: ca820181fc187af316a18b2700582663662c4012
9 changes: 5 additions & 4 deletions trunk/arch/i386/boot/compressed/relocs.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <endian.h>

#define MAX_SHDRS 100
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
static Elf32_Ehdr ehdr;
static Elf32_Shdr shdr[MAX_SHDRS];
static Elf32_Sym *symtab[MAX_SHDRS];
Expand Down Expand Up @@ -71,7 +72,7 @@ static const char *sym_type(unsigned type)
#undef SYM_TYPE
};
const char *name = "unknown sym type name";
if (type < sizeof(type_name)/sizeof(type_name[0])) {
if (type < ARRAY_SIZE(type_name)) {
name = type_name[type];
}
return name;
Expand All @@ -87,7 +88,7 @@ static const char *sym_bind(unsigned bind)
#undef SYM_BIND
};
const char *name = "unknown sym bind name";
if (bind < sizeof(bind_name)/sizeof(bind_name[0])) {
if (bind < ARRAY_SIZE(bind_name)) {
name = bind_name[bind];
}
return name;
Expand All @@ -104,7 +105,7 @@ static const char *sym_visibility(unsigned visibility)
#undef SYM_VISIBILITY
};
const char *name = "unknown sym visibility name";
if (visibility < sizeof(visibility_name)/sizeof(visibility_name[0])) {
if (visibility < ARRAY_SIZE(visibility_name)) {
name = visibility_name[visibility];
}
return name;
Expand All @@ -128,7 +129,7 @@ static const char *rel_type(unsigned type)
#undef REL_TYPE
};
const char *name = "unknown type rel type name";
if (type < sizeof(type_name)/sizeof(type_name[0])) {
if (type < ARRAY_SIZE(type_name)) {
name = type_name[type];
}
return name;
Expand Down

0 comments on commit c7aff51

Please sign in to comment.