1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

Use upx_uint16_t instead of unsigned short.

This commit is contained in:
Markus F.X.J. Oberhumer 2016-09-21 17:40:11 +02:00
parent 3bb654cc85
commit b3121e4534
6 changed files with 7 additions and 7 deletions

View File

@ -1352,7 +1352,7 @@ __acc_static_noinline void upx_sanity_check(void)
COMPILE_TIME_ASSERT(sizeof(UPX_VERSION_YEAR) == 4 + 1)
assert(strlen(UPX_VERSION_YEAR) == 4);
assert(memcmp(UPX_VERSION_DATE_ISO, UPX_VERSION_YEAR, 4) == 0);
assert(memcmp(&UPX_VERSION_DATE[strlen(UPX_VERSION_DATE) - 4], UPX_VERSION_YEAR, 4) == 0);
assert(memcmp(&UPX_VERSION_DATE[sizeof(UPX_VERSION_DATE)-1 - 4], UPX_VERSION_YEAR, 4) == 0);
#if 1
assert(TestBELE<LE16>::test());

View File

@ -87,7 +87,7 @@ protected:
upx_uint64_t xct_va; // minimum SHT_EXECINSTR virtual address
upx_uint64_t jni_onload_va; // runtime &JNI_OnLoad
unsigned short e_machine;
upx_uint16_t e_machine;
unsigned char ei_class;
unsigned char ei_data;
unsigned char ei_osabi;

View File

@ -601,7 +601,7 @@ void PackLinuxI386::patchLoaderChecksum()
// checksum for loader + p_info
lp->l_checksum = 0;
lp->l_magic = UPX_ELF_MAGIC;
set_te16(&lp->l_lsize, (unsigned short) lsize);
set_te16(&lp->l_lsize, (upx_uint16_t) lsize);
lp->l_version = (unsigned char) ph.version;
lp->l_format = (unsigned char) ph.format;
// INFO: lp->l_checksum is currently unused

View File

@ -561,7 +561,7 @@ void PackMachBase<T>::patchLoaderChecksum()
// checksum for loader; also some PackHeader info
lp->l_checksum = 0;
lp->l_magic = UPX_MAGIC_LE32; // LE32 always
set_te16(&lp->l_lsize, (unsigned short) lsize);
set_te16(&lp->l_lsize, (upx_uint16_t) lsize);
lp->l_version = (unsigned char) ph.version;
lp->l_format = (unsigned char) ph.format;
// INFO: lp->l_checksum is currently unused

View File

@ -426,7 +426,7 @@ bool PackPs1::findBssSection()
// check 18 opcodes for sw zero,0(x)
for (signed i = BSS_CHK_LIMIT; i >= 0; i--)
{
unsigned short op = p1[i] >> 16;
upx_uint16_t op = p1[i] >> 16;
if (IS_SW_ZERO(op))
{
// found! get reg (x) for bss_start
@ -434,7 +434,7 @@ bool PackPs1::findBssSection()
for (; i >= 0; i--)
{
bss_nfo *p = (bss_nfo *)(void *)&p1[i];
unsigned short op1 = p->op1, op2 = p->op2;
upx_uint16_t op1 = p->op1, op2 = p->op2;
// check for la (x),bss_start
if ((IS_LUI(op1) && REG2(op1) == reg) &&

View File

@ -235,7 +235,7 @@ PackUnix::patchLoaderChecksum()
l_info *const lp = &linfo;
// checksum for loader; also some PackHeader info
lp->l_magic = UPX_MAGIC_LE32; // LE32 always
set_te16(&lp->l_lsize, (unsigned short) lsize);
set_te16(&lp->l_lsize, (upx_uint16_t) lsize);
lp->l_version = (unsigned char) ph.version;
lp->l_format = (unsigned char) ph.format;
// INFO: lp->l_checksum is currently unused