src: use 'byte' instead of 'upx_byte'; NFCI

This commit is contained in:
Markus F.X.J. Oberhumer
2023-02-21 19:27:23 +01:00
parent 4a8efd2e2f
commit e1edc5f50a
50 changed files with 535 additions and 513 deletions
+10 -10
View File
@@ -32,8 +32,8 @@
**************************************************************************/
#define CT16(f, cond, addvalue, get, set) \
upx_byte *b = f->buf; \
upx_byte *b_end = b + f->buf_len - 3; \
byte *b = f->buf; \
byte *b_end = b + f->buf_len - 3; \
do { \
if (cond) \
{ \
@@ -211,8 +211,8 @@ static int s_ct16_e8e9_bswap_be(Filter *f)
**************************************************************************/
#define CT32(f, cond, addvalue, get, set) \
upx_byte *b = f->buf; \
upx_byte *b_end = b + f->buf_len - 5; \
byte *b = f->buf; \
byte *b_end = b + f->buf_len - 5; \
do { \
if (cond) \
{ \
@@ -388,8 +388,8 @@ static int s_ct32_e8e9_bswap_be(Filter *f)
**************************************************************************/
#define CT24ARM_LE(f, cond, addvalue, get, set) \
upx_byte *b = f->buf; \
upx_byte *b_end = b + f->buf_len - 4; \
byte *b = f->buf; \
byte *b_end = b + f->buf_len - 4; \
do { \
if (cond) \
{ \
@@ -424,8 +424,8 @@ static int s_ct24arm_le(Filter *f)
#undef CT24ARM_LE
#define CT24ARM_BE(f, cond, addvalue, get, set) \
upx_byte *b = f->buf; \
upx_byte *b_end = b + f->buf_len - 4; \
byte *b = f->buf; \
byte *b_end = b + f->buf_len - 4; \
do { \
if (cond) \
{ \
@@ -464,8 +464,8 @@ static int s_ct24arm_be(Filter *f)
**************************************************************************/
#define CT26ARM_LE(f, cond, addvalue, get, set) \
upx_byte *b = f->buf; \
upx_byte *b_end = b + f->buf_len - 4; \
byte *b = f->buf; \
byte *b_end = b + f->buf_len - 4; \
do { \
if (cond) \
{ \
+3 -3
View File
@@ -35,10 +35,10 @@ static int F(Filter *f)
{
#ifdef U
// filter
upx_byte *b = f->buf;
byte *b = f->buf;
#else
// scan
const upx_byte *b = f->buf;
const byte *b = f->buf;
#endif
const unsigned addvalue = f->addvalue;
const unsigned size = f->buf_len;
@@ -141,7 +141,7 @@ static int F(Filter *f)
#ifdef U
static int U(Filter *f)
{
upx_byte *b = f->buf;
byte *b = f->buf;
const unsigned size5 = f->buf_len - 5;
const unsigned addvalue = f->addvalue;
const unsigned cto = (unsigned)f->cto << 24;
+3 -3
View File
@@ -39,10 +39,10 @@ static int F(Filter *f)
{
#ifdef U
// filter
upx_byte *b = f->buf;
byte *b = f->buf;
#else
// scan
const upx_byte *b = f->buf;
const byte *b = f->buf;
#endif
const unsigned addvalue = f->addvalue;
const unsigned size = f->buf_len;
@@ -140,7 +140,7 @@ static int F(Filter *f)
#ifdef U
static int U(Filter *f)
{
upx_byte *b = f->buf;
byte *b = f->buf;
const unsigned size5 = f->buf_len - 5;
const unsigned addvalue = f->addvalue;
const unsigned cto = (unsigned)f->cto << 24;
+3 -3
View File
@@ -98,10 +98,10 @@ static int F(Filter *f)
{
#ifdef U
// filter
upx_byte *const b = f->buf;
byte *const b = f->buf;
#else
// scan
const upx_byte *b = f->buf;
const byte *b = f->buf;
#endif
const unsigned size = f->buf_len;
@@ -268,7 +268,7 @@ static int U(Filter *f)
{
unsigned ic, jc;
upx_byte *const b = f->buf;
byte *const b = f->buf;
const unsigned size5 = f->buf_len - 5;
const unsigned cto = (unsigned)f->cto << 24;
unsigned lastcall = 0;
+3 -3
View File
@@ -39,10 +39,10 @@ static int F(Filter *f)
{
#ifdef U
// filter
upx_byte *b = f->buf;
byte *b = f->buf;
#else
// scan
const upx_byte *b = f->buf;
const byte *b = f->buf;
#endif
const unsigned addvalue = f->addvalue;
const unsigned size = f->buf_len;
@@ -141,7 +141,7 @@ static int F(Filter *f)
#ifdef U
static int U(Filter *f)
{
upx_byte *b = f->buf;
byte *b = f->buf;
const unsigned size5 = f->buf_len - 5;
const unsigned addvalue = f->addvalue;
const unsigned cto = (unsigned)f->cto << 24;
+4 -4
View File
@@ -32,8 +32,8 @@
**************************************************************************/
#define CTSW16(f, cond1, cond2, addvalue, get, set) \
upx_byte *b = f->buf; \
upx_byte *b_end = b + f->buf_len - 3; \
byte *b = f->buf; \
byte *b_end = b + f->buf_len - 3; \
do { \
if (cond1) \
{ \
@@ -102,8 +102,8 @@ static int s_ctsw16_e9_e8(Filter *f)
**************************************************************************/
#define CTSW32(f, cond1, cond2, addvalue, get, set) \
upx_byte *b = f->buf; \
upx_byte *b_end = b + f->buf_len - 5; \
byte *b = f->buf; \
byte *b_end = b + f->buf_len - 5; \
do { \
if (cond1) \
{ \
+2 -2
View File
@@ -31,7 +31,7 @@
//
**************************************************************************/
static int getcto(Filter *f, const unsigned char *buf, const int n=256)
static int getcto(Filter *f, const byte *buf, const int n=256)
{
int ic = n;
@@ -63,7 +63,7 @@ static int getcto(Filter *f, const unsigned char *buf, const int n=256)
//throwCantPack("call trick problem");
return -1;
f->cto = (unsigned char) ic;
f->cto = (byte) ic;
return ic;
}
+3 -3
View File
@@ -41,11 +41,11 @@ static int F(Filter *f)
{
#ifdef U
// filter
upx_byte *b = f->buf;
byte *b = f->buf;
const unsigned addvalue = f->addvalue;
#else
// scan
const upx_byte *b = f->buf;
const byte *b = f->buf;
#endif
const unsigned size = umin(f->buf_len, 0u - (~0u<<(32 - (6+ W_CTO))));
const unsigned size4 = size -4;
@@ -125,7 +125,7 @@ static int F(Filter *f)
#ifdef U
static int U(Filter *f)
{
upx_byte *b = f->buf;
byte *b = f->buf;
const unsigned size4 = umin(f->buf_len - 4, 0u - (~0u<<(32 - (6+ W_CTO))));
const unsigned addvalue = f->addvalue;
+2 -2
View File
@@ -32,7 +32,7 @@
**************************************************************************/
#define SUB(f, N, T, get, set) \
upx_byte *b = f->buf; \
byte *b = f->buf; \
unsigned l = f->buf_len / sizeof(T); \
int i; \
T d[N]; \
@@ -54,7 +54,7 @@
#define ADD(f, N, T, get, set) \
upx_byte *b = f->buf; \
byte *b = f->buf; \
unsigned l = f->buf_len / sizeof(T); \
int i; \
T d[N]; \
+4 -4
View File
@@ -32,8 +32,8 @@
**************************************************************************/
#define SW16(f, cond, get, set) \
upx_byte *b = f->buf; \
upx_byte *b_end = b + f->buf_len - 3; \
byte *b = f->buf; \
byte *b_end = b + f->buf_len - 3; \
do { \
if (cond) \
{ \
@@ -110,8 +110,8 @@ static int s_sw16_e8e9(Filter *f)
**************************************************************************/
#define SW32(f, cond, get, set) \
upx_byte *b = f->buf; \
upx_byte *b_end = b + f->buf_len - 5; \
byte *b = f->buf; \
byte *b_end = b + f->buf_len - 5; \
do { \
if (cond) \
{ \