mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Avoid warning C4146: unary minus operator applied to unsigned type, result still unsigned
modified: p_mach.cpp
This commit is contained in:
parent
c05fedcb76
commit
9c1bc99d7a
|
@ -1070,8 +1070,8 @@ void PackMachBase<T>::pack3(OutputFile *fo, Filter &ft) // append loader
|
||||||
len += sizeof(disp);
|
len += sizeof(disp);
|
||||||
|
|
||||||
char page[~PAGE_MASK]; memset(page, 0, sizeof(page));
|
char page[~PAGE_MASK]; memset(page, 0, sizeof(page));
|
||||||
fo->write(page, ~PAGE_MASK & -len);
|
fo->write(page, ~PAGE_MASK & (0u - len));
|
||||||
len += ~PAGE_MASK & -len;
|
len += ~PAGE_MASK & (0u - len);
|
||||||
segLINK.fileoff = len;
|
segLINK.fileoff = len;
|
||||||
|
|
||||||
threado_setPC(len + segTEXT.vmaddr); /* entry address */
|
threado_setPC(len + segTEXT.vmaddr); /* entry address */
|
||||||
|
@ -1716,7 +1716,7 @@ int PackMachBase<T>::canUnpack()
|
||||||
// Emulate the code
|
// Emulate the code
|
||||||
if (0xe8==b[0] && disp < bufsize
|
if (0xe8==b[0] && disp < bufsize
|
||||||
&& 0x5d==b[5+disp] && 0xe8==b[6+disp]) {
|
&& 0x5d==b[5+disp] && 0xe8==b[6+disp]) {
|
||||||
unsigned disp2 = - *(TE32 const *)&b[7+disp];
|
unsigned disp2 = 0u - *(TE32 const *)&b[7+disp];
|
||||||
if (disp2 < (12+disp) && 0x5b==b[11+disp-disp2]) {
|
if (disp2 < (12+disp) && 0x5b==b[11+disp-disp2]) {
|
||||||
struct b_info const *bptr = (struct b_info const *)&b[11+disp];
|
struct b_info const *bptr = (struct b_info const *)&b[11+disp];
|
||||||
// This is the folded stub.
|
// This is the folded stub.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user