diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-07-06 19:40:02 +0400 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-07-06 19:40:02 +0400 |
commit | 4cc10643282ac0879e85352c33b87b2db1e526b3 (patch) | |
tree | 4a93ac449975c917e7b5826247740f51a4d095bf /output/outbin.c | |
parent | faf23d1302cd74ad961cf5b1c7311841e9f50b28 (diff) | |
download | nasm-4cc10643282ac0879e85352c33b87b2db1e526b3.tar.gz |
outbin: Cleanup bin_cleanup
No need for 'q' variable.
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'output/outbin.c')
-rw-r--r-- | output/outbin.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/output/outbin.c b/output/outbin.c index 6a90aa0d..4012cc9c 100644 --- a/output/outbin.c +++ b/output/outbin.c @@ -538,15 +538,17 @@ static void bin_cleanup(int debuginfo) saa_rewind(s->contents); /* Apply relocations. */ list_for_each(r, relocs) { - uint8_t *p, *q, mydata[8]; + uint8_t *p, mydata[8]; int64_t l; - int b; + int b; + + nasm_assert(r->bytes <= 8); saa_fread(r->target->contents, r->posn, mydata, r->bytes); - p = q = mydata; + p = mydata; l = 0; for (b = r->bytes - 1; b >= 0; b--) - l = (l << 8) + p[b]; + l = (l << 8) + mydata[b]; s = find_section_by_index(r->secref); if (s) { @@ -563,7 +565,7 @@ static void bin_cleanup(int debuginfo) l -= s->vstart; } - WRITEADDR(q, l, r->bytes); + WRITEADDR(p, l, r->bytes); saa_fwrite(r->target->contents, r->posn, mydata, r->bytes); } |