From b0843ec9ad6b4ea1bf1bd2b6ad5856ec525dd0cd Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Sun, 9 Jan 2011 06:19:31 -0500 Subject: [PATCH] Remove unnecessary cruft, make it compatible with gcc only and remove __GNU_C__ define check --- 7z/Portable.h | 12 +----------- general.h | 26 +------------------------- rcofile.h | 10 ---------- rcomain.h | 21 --------------------- rlzpack.c | 5 ----- vaghandler.c | 7 ------- vsmx.h | 10 ---------- 7 files changed, 2 insertions(+), 89 deletions(-) diff --git a/7z/Portable.h b/7z/Portable.h index 1d5788e..f07f3f7 100644 --- a/7z/Portable.h +++ b/7z/Portable.h @@ -2,17 +2,8 @@ #define __PORTABLE_H #include -#ifndef __GNU_C__ // MSVC -typedef __int16 INT16; -typedef unsigned __int16 UINT16; -typedef __int32 INT32; -typedef unsigned __int32 UINT32; -typedef __int64 INT64; -typedef unsigned __int64 UINT64; -typedef ptrdiff_t UINT_PTR; -typedef __int32 INT; -#else // gcc #include + typedef int16_t INT16; typedef uint16_t UINT16; typedef int32_t INT32; @@ -21,7 +12,6 @@ typedef int64_t INT64; typedef uint64_t UINT64; typedef uintptr_t UINT_PTR; typedef int32_t INT; -#endif typedef signed char INT8; typedef unsigned char UINT8; diff --git a/general.h b/general.h index 95ac3e2..198195d 100644 --- a/general.h +++ b/general.h @@ -4,6 +4,7 @@ //#define DISABLE_RLZ +#include #define APPNAME "Rcomage" #define APPNAME_VER "Rcomage v1.1.1" @@ -47,36 +48,19 @@ extern Bool quietMode; #define ALIGN_TO_4(n) (((n) + 3) & (~3)) //#define ALIGN_TO_4(n) (((n) + 3) >>2 <<2) // problem: upper 2 bits gets wiped too -#ifndef __GNU_C__ -typedef unsigned __int8 uint8; -typedef __int8 int8; -typedef unsigned __int16 uint16; -typedef __int16 int16; -typedef unsigned __int32 uint32; -typedef __int32 int32; -#else -#include typedef uint8_t uint8; typedef int8_t int8; typedef uint16_t uint16; typedef int16_t int16; typedef uint32_t uint32; typedef int32_t int32; -#endif - const uint32 UTF8_BOM = 0xBFBBEF; const uint16 UTF16_BOM = 0xFEFF; const uint32 UTF32_BOM = 0x0000FEFF; -#ifndef __GNU_C__ /* msvc */ -#define PACK_STRUCT(nam, struc) typedef struct struc nam -// need to use pragma directives whenever we use it... -#else /* gcc */ #define PACK_STRUCT(nam, struc) typedef struct struc __attribute__ ((packed)) nam -#endif - uint zlib_compress(void* src, uint srcLen, void* dest, uint destLen, int level, int strat); @@ -92,14 +76,6 @@ Bool is_prime(uint in); void get_temp_fname(char* out, const char* ext); -/* -#ifndef Z_OK -#define Z_OK 0 -#endif -#ifndef Z_DATA_ERROR -#define Z_DATA_ERROR -3 -#endif -*/ #define Z_USE_7Z 10 #ifdef WIN32 diff --git a/rcofile.h b/rcofile.h index eb39ba2..fb9b97f 100644 --- a/rcofile.h +++ b/rcofile.h @@ -4,13 +4,6 @@ #include "general.h" - -#ifndef __GNU_C__ -#pragma pack(push, 4) -#pragma pack(1) -#endif - - #define RCO_NULL_PTR 0xFFFFFFFF #define RCO_TABLE_MAIN 1 @@ -259,9 +252,6 @@ PACK_STRUCT(TextComprInfo, { uint32 unpackedLen; }); -#ifndef __GNU_C__ -#pragma pack(pop) -#endif #endif diff --git a/rcomain.h b/rcomain.h index af11337..2743069 100644 --- a/rcomain.h +++ b/rcomain.h @@ -235,22 +235,6 @@ void es_extraObjAnim(Bool isObj, int type, void* data, Bool isPS3); - - - - - - - - - - -#ifndef __GNU_C__ -#pragma pack(push, 4) -#pragma pack(1) -#endif - - PACK_STRUCT(RCOObjPos, { float posX; float posY; @@ -601,10 +585,5 @@ PACK_STRUCT(RCOAnimSSlideout, { }); */ -#ifndef __GNU_C__ -#pragma pack(pop) -#endif - - #endif diff --git a/rlzpack.c b/rlzpack.c index 0b27bf8..d428439 100644 --- a/rlzpack.c +++ b/rlzpack.c @@ -3,12 +3,7 @@ #include #include #include - -#ifndef __GNU_C__ // MSVC -typedef __int64 int64_t; -#else #include -#endif #define RLZI_WINDOW_SIZE 0x7FED // *4 = 130,996 bytes (128KB - 76 bytes) #define RLZI_DICTIONARY_SIZE 0x3FFFF // *4 = 1,048,572 bytes (1MB - 4 bytes) diff --git a/vaghandler.c b/vaghandler.c index 47b3376..fd73d59 100644 --- a/vaghandler.c +++ b/vaghandler.c @@ -19,10 +19,6 @@ const double f[5][2] = { { 0.0, 0.0 }, #define ROUND(x) ((int)(x<0 ? x-0.5 : x+0.5)) -#ifndef __GNU_C__ -#pragma pack(push, 4) -#pragma pack(1) -#endif #define VAG_SIGNATURE 0x70474156 #define VAG_VERSION 0x4000000 //0x2000000 @@ -64,9 +60,6 @@ PACK_STRUCT(WavHeader, { uint32 s2sig; // "data" uint32 s2size; // = numSamples * channels * bitDepth/8 OR size-36 }); -#ifndef __GNU_C__ -#pragma pack(pop) -#endif // TODO: sanity checks with lengths diff --git a/vsmx.h b/vsmx.h index 37f789d..871501b 100644 --- a/vsmx.h +++ b/vsmx.h @@ -2,12 +2,6 @@ #ifndef __VSMX_H__ #define __VSMX_H__ - -#ifndef __GNU_C__ -#pragma pack(push, 4) -#pragma pack(1) -#endif - typedef wchar_t wchar; #define VSMX_SIGNATURE 0x584D5356 // "VSMX" @@ -40,10 +34,6 @@ PACK_STRUCT(VSMXGroup, { } val; }); -#ifndef __GNU_C__ -#pragma pack(pop) -#endif - typedef struct { VSMXGroup* code; wchar *text, *prop; -- 2.39.5