From 52aa658aaa817b05d43a622fef5571e51f969283 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Wed, 14 Jul 2010 20:03:09 +0200 Subject: [PATCH] Silence some compilation warnings. --- src/p_lx_elf.cpp | 12 ++++++------ src/p_w32pe.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/p_lx_elf.cpp b/src/p_lx_elf.cpp index 8e432d78..fa3d9e29 100644 --- a/src/p_lx_elf.cpp +++ b/src/p_lx_elf.cpp @@ -175,8 +175,8 @@ void PackLinuxElf::pack3(OutputFile *fo, Filter &ft) unsigned disp; unsigned const zero = 0; unsigned len = fo->getBytesWritten(); - fo->write(&zero, 3& -len); // ALIGN_UP 0 mod 4 - len += (3& -len); // 0 mod 4 + fo->write(&zero, 3& (0u-len)); // ALIGN_UP 0 mod 4 + len += (3& (0u-len)); // 0 mod 4 unsigned const t = 4 ^ (4 & len) ^ ((!!xct_off)<<2); // 0 or 4 fo->write(&zero, t); @@ -2262,8 +2262,8 @@ void PackLinuxElf32::pack4(OutputFile *fo, Filter &ft) overlay_offset = sz_elf_hdrs + sizeof(linfo); unsigned const zero = 0; unsigned len = fo->getBytesWritten(); - fo->write(&zero, 3& -len); // align to 0 mod 4 - len += 3& -len; + fo->write(&zero, 3& (0u-len)); // align to 0 mod 4 + len += 3& (0u-len); set_te32(&elfout.phdr[0].p_filesz, len); super::pack4(fo, ft); // write PackHeader and overlay_offset @@ -2325,8 +2325,8 @@ void PackLinuxElf64::pack4(OutputFile *fo, Filter &ft) overlay_offset = sz_elf_hdrs + sizeof(linfo); unsigned const zero = 0; unsigned len = fo->getBytesWritten(); - fo->write(&zero, 3& -len); // align to 0 mod 4 - len += 3& -len; + fo->write(&zero, 3& (0u-len)); // align to 0 mod 4 + len += 3& (0u-len); set_te64(&elfout.phdr[0].p_filesz, len); super::pack4(fo, ft); // write PackHeader and overlay_offset diff --git a/src/p_w32pe.cpp b/src/p_w32pe.cpp index 1bab5c2c..1318b6ef 100644 --- a/src/p_w32pe.cpp +++ b/src/p_w32pe.cpp @@ -273,7 +273,7 @@ void PackW32Pe::processTls(Reloc *rel,const Interval *iv,unsigned newaddr) // pa // add new relocation entries unsigned ic; //NEW: if TLS callbacks are used, relocate the VA of the callback chain, too - Stefan Widmann - for (ic = 0; ic < (use_tls_callbacks ? 16 : 12); ic += 4) + for (ic = 0; ic < (use_tls_callbacks ? 16u : 12u); ic += 4) rel->add(newaddr + ic,3); tls * const tlsp = (tls*) otls;