diff options
author | norly <ny-git@enpas.org> | 2013-06-17 23:34:30 +0100 |
---|---|---|
committer | norly <ny-git@enpas.org> | 2013-06-17 23:39:12 +0100 |
commit | f88e1ad7d9db8a41abecc795200f21138af65c74 (patch) | |
tree | dc17e6153ae6ee4678b39f365f8c9d9b28bdde43 /src/modelops/layout.c | |
parent | 150d0c42d423fe49304d648e2c19ff08f6c2e0ad (diff) |
C90 compliance, except variadic macros and TODOs
Also removed a lot of dead code from the early days.
Diffstat (limited to 'src/modelops/layout.c')
-rw-r--r-- | src/modelops/layout.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/modelops/layout.c b/src/modelops/layout.c index e4b3fb1..8abc766 100644 --- a/src/modelops/layout.c +++ b/src/modelops/layout.c @@ -115,7 +115,7 @@ GElf_Addr elfu_mLayoutGetSpaceInPhdr(ElfuElf *me, GElf_Word size, GElf_Off endAddr = OFFS_END(last->phdr.p_vaddr, last->phdr.p_filesz); ElfuScn *ms; - ELFU_INFO("Expanding NOBITS at address 0x%jx...\n", endAddr); + ELFU_INFO("Expanding NOBITS at address 0x%x...\n", (unsigned)endAddr); CIRCLEQ_FOREACH(ms, &last->childScnList, elemChildScn) { if (ms->shdr.sh_offset == endOff) { @@ -124,7 +124,8 @@ GElf_Addr elfu_mLayoutGetSpaceInPhdr(ElfuElf *me, GElf_Word size, ms->data.d_buf = malloc(ms->shdr.sh_size); memset(ms->data.d_buf, '\0', ms->shdr.sh_size); if (!ms->data.d_buf) { - ELFU_WARN("mExpandNobits: Could not allocate %jd bytes for NOBITS expansion. Data may be inconsistent.\n", ms->shdr.sh_size); + ELFU_WARN("mExpandNobits: Could not allocate %u bytes for NOBITS expansion. Data may be inconsistent.\n", + (unsigned)ms->shdr.sh_size); assert(0); goto ERROR; } @@ -227,11 +228,14 @@ GElf_Addr elfu_mLayoutGetSpaceInPhdr(ElfuElf *me, GElf_Word size, static int cmpPhdrOffs(const void *mp1, const void *mp2) { + ElfuPhdr *p1; + ElfuPhdr *p2; + assert(mp1); assert(mp2); - ElfuPhdr *p1 = *(ElfuPhdr**)mp1; - ElfuPhdr *p2 = *(ElfuPhdr**)mp2; + p1 = *(ElfuPhdr**)mp1; + p2 = *(ElfuPhdr**)mp2; assert(p1); assert(p2); |