all: misc cleanups
This commit is contained in:
@@ -42,9 +42,6 @@
|
||||
#if (ACC_CC_MSC && (_MSC_VER < 1900))
|
||||
# pragma warning(disable: 4127) // warning C4127: conditional expression is constant
|
||||
#endif
|
||||
#if (ACC_CC_INTELC_GNUC)
|
||||
# pragma warning(error: 424) // #424: extra ";" ignored
|
||||
#endif
|
||||
|
||||
|
||||
void lzma_compress_config_t::reset()
|
||||
|
||||
+2
-2
@@ -295,9 +295,9 @@ typedef upx_int64_t upx_off_t;
|
||||
#define CLANG_FORMAT_DUMMY_STATEMENT /*empty*/
|
||||
|
||||
#if defined(_WIN32) && defined(__MINGW32__) && defined(__GNUC__) && !defined(__clang__)
|
||||
# define attribute_format(a,b) __attribute__((__format__(__gnu_printf__,a,b)));
|
||||
# define attribute_format(a,b) __attribute__((__format__(__gnu_printf__,a,b)))
|
||||
#elif (ACC_CC_CLANG || ACC_CC_GNUC)
|
||||
# define attribute_format(a,b) __attribute__((__format__(__printf__,a,b)));
|
||||
# define attribute_format(a,b) __attribute__((__format__(__printf__,a,b)))
|
||||
#else
|
||||
# define attribute_format(a,b) /*empty*/
|
||||
#endif
|
||||
|
||||
+3
-3
@@ -36,9 +36,9 @@ LeFile::LeFile(InputFile *f) :
|
||||
fif(f), fof(nullptr),
|
||||
le_offset(0), exe_offset(0)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(sizeof(le_header_t) == 196);
|
||||
COMPILE_TIME_ASSERT(sizeof(le_object_table_entry_t) == 24);
|
||||
COMPILE_TIME_ASSERT(sizeof(le_pagemap_entry_t) == 4);
|
||||
COMPILE_TIME_ASSERT(sizeof(le_header_t) == 196)
|
||||
COMPILE_TIME_ASSERT(sizeof(le_object_table_entry_t) == 24)
|
||||
COMPILE_TIME_ASSERT(sizeof(le_pagemap_entry_t) == 4)
|
||||
memset(&ih,0,sizeof ih);
|
||||
memset(&oh,0,sizeof oh);
|
||||
iobject_table = oobject_table = nullptr;
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ __packed_struct(Mach_command) // generic prefix
|
||||
Word data[2]; // because cmdsize >= 16
|
||||
#define WANT_MACH_SEGMENT_ENUM 1
|
||||
#include "p_mach_enum.h"
|
||||
__packed_struct_end();
|
||||
__packed_struct_end()
|
||||
|
||||
template <class TMachITypes>
|
||||
__packed_struct(Mach_segment_command)
|
||||
|
||||
+1
-1
@@ -151,7 +151,7 @@ bool PackPs1::readBkupHeader()
|
||||
return true;
|
||||
}
|
||||
|
||||
#define INIT_BH_BKUP(p, l) {(p)->id = '1'; (p)->len = l;}
|
||||
#define INIT_BH_BKUP(p, l) ACC_BLOCK_BEGIN {(p)->id = '1'; (p)->len = l;} ACC_BLOCK_END
|
||||
#define ADLER16(a) (((a) >> 16) ^ ((a) & 0xffff))
|
||||
|
||||
void PackPs1::putBkupHeader(const unsigned char *src, unsigned char *dst, unsigned *len)
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ static const
|
||||
PackTmt::PackTmt(InputFile *f) : super(f)
|
||||
{
|
||||
bele = &N_BELE_RTP::le_policy;
|
||||
COMPILE_TIME_ASSERT(sizeof(tmt_header_t) == 44);
|
||||
COMPILE_TIME_ASSERT(sizeof(tmt_header_t) == 44)
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ static const CLANG_FORMAT_DUMMY_STATEMENT
|
||||
|
||||
PackTos::PackTos(InputFile *f) : super(f) {
|
||||
bele = &N_BELE_RTP::be_policy;
|
||||
COMPILE_TIME_ASSERT(FH_SIZE == 28);
|
||||
COMPILE_TIME_ASSERT(FH_SIZE == 28)
|
||||
COMPILE_TIME_ASSERT_ALIGNED1(tos_header_t)
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -49,11 +49,11 @@
|
||||
PackUnix::PackUnix(InputFile *f) :
|
||||
super(f), exetype(0), blocksize(0), overlay_offset(0), lsize(0)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(sizeof(Elf32_Ehdr) == 52);
|
||||
COMPILE_TIME_ASSERT(sizeof(Elf32_Phdr) == 32);
|
||||
COMPILE_TIME_ASSERT(sizeof(b_info) == 12);
|
||||
COMPILE_TIME_ASSERT(sizeof(l_info) == 12);
|
||||
COMPILE_TIME_ASSERT(sizeof(p_info) == 12);
|
||||
COMPILE_TIME_ASSERT(sizeof(Elf32_Ehdr) == 52)
|
||||
COMPILE_TIME_ASSERT(sizeof(Elf32_Phdr) == 32)
|
||||
COMPILE_TIME_ASSERT(sizeof(b_info) == 12)
|
||||
COMPILE_TIME_ASSERT(sizeof(l_info) == 12)
|
||||
COMPILE_TIME_ASSERT(sizeof(p_info) == 12)
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ PackVmlinuzI386::PackVmlinuzI386(InputFile *f) :
|
||||
, filter_len(0)
|
||||
{
|
||||
bele = &N_BELE_RTP::le_policy;
|
||||
COMPILE_TIME_ASSERT(sizeof(boot_sect_t) == 0x250);
|
||||
COMPILE_TIME_ASSERT(sizeof(boot_sect_t) == 0x250)
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -873,7 +873,7 @@ void PeFile::addStubImports()
|
||||
|
||||
void PeFile::processImports2(unsigned myimport, unsigned) // pass 2
|
||||
{
|
||||
COMPILE_TIME_ASSERT(sizeof(import_desc) == 20);
|
||||
COMPILE_TIME_ASSERT(sizeof(import_desc) == 20)
|
||||
|
||||
if (!ilinker)
|
||||
return;
|
||||
@@ -2599,7 +2599,7 @@ void PeFile::pack0(OutputFile *fo, ht &ih, ht &oh,
|
||||
callProcessRelocs(rel, ic);
|
||||
|
||||
// when the resource is put alone into section 3
|
||||
const unsigned res_start = (ic + oam1) &~ oam1;;
|
||||
const unsigned res_start = (ic + oam1) &~ oam1;
|
||||
if (last_section_rsrc_only)
|
||||
callProcessResources(res, ic = res_start);
|
||||
|
||||
|
||||
+20
-20
@@ -143,34 +143,34 @@ struct Span_is_convertible
|
||||
|
||||
#if 1
|
||||
// char => char
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<char, char>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<char, const char>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<const char, const char>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<const char, char>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<char, char>::value))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<char, const char>::value))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<const char, const char>::value))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<const char, char>::value))
|
||||
|
||||
// void => void
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<void, void>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<void, const void>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<const void, const void>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<const void, void>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<void, void>::value))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<void, const void>::value))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<const void, const void>::value))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<const void, void>::value))
|
||||
|
||||
// char => void
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<char, void>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<char, const void>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<const char, const void>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<const char, void>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<char, void>::value))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<char, const void>::value))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((Span_is_convertible<const char, const void>::value))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<const char, void>::value))
|
||||
|
||||
// void => char
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<void, char>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<void, const char>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<const void, const char>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<const void, char>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<void, char>::value))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<void, const char>::value))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<const void, const char>::value))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<const void, char>::value))
|
||||
|
||||
// char => int
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(!(Span_is_convertible<char, int>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(!(Span_is_convertible<char, const int>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(!(Span_is_convertible<const char, const int>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<const char, int>::value));
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(!(Span_is_convertible<char, int>::value))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(!(Span_is_convertible<char, const int>::value))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER(!(Span_is_convertible<const char, const int>::value))
|
||||
ACC_COMPILE_TIME_ASSERT_HEADER((!Span_is_convertible<const char, int>::value))
|
||||
#endif
|
||||
|
||||
/*************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user