From c03ce4b1c704ef638374f56bbb9692db0e4e354c Mon Sep 17 00:00:00 2001 From: smatz Date: Mon, 1 Jun 2009 11:49:46 +0000 Subject: (svn r16492) -Remove: support for gcc2. It hasn't been able to compile OTTD for months. All attempts to do another workaround failed. --- src/blitter/32bpp_optimized.hpp | 2 +- src/blitter/8bpp_optimized.hpp | 2 +- src/debug.h | 12 ++---------- src/gamelog.cpp | 2 +- src/newgrf_text.cpp | 2 +- src/script/squirrel_class.hpp | 8 -------- src/script/squirrel_helper_type.hpp | 2 +- src/signal.cpp | 3 +-- src/spritecache.cpp | 2 +- src/spritecache.h | 2 +- src/stdafx.h | 8 -------- src/strings.cpp | 2 +- src/table/sprites.h | 2 +- 13 files changed, 12 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/blitter/32bpp_optimized.hpp b/src/blitter/32bpp_optimized.hpp index c8b994d9c..344659c85 100644 --- a/src/blitter/32bpp_optimized.hpp +++ b/src/blitter/32bpp_optimized.hpp @@ -12,7 +12,7 @@ class Blitter_32bppOptimized : public Blitter_32bppSimple { public: struct SpriteData { uint32 offset[ZOOM_LVL_COUNT][2]; - byte data[VARARRAY_SIZE]; + byte data[]; }; /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); diff --git a/src/blitter/8bpp_optimized.hpp b/src/blitter/8bpp_optimized.hpp index 85a7b06ad..a7c8ea186 100644 --- a/src/blitter/8bpp_optimized.hpp +++ b/src/blitter/8bpp_optimized.hpp @@ -12,7 +12,7 @@ class Blitter_8bppOptimized : public Blitter_8bppBase { public: struct SpriteData { uint32 offset[ZOOM_LVL_COUNT]; ///< offsets (from .data) to streams for different zoom levels - byte data[VARARRAY_SIZE]; ///< data, all zoomlevels + byte data[]; ///< data, all zoomlevels }; /* virtual */ void Draw(Blitter::BlitterParams *bp, BlitterMode mode, ZoomLevel zoom); diff --git a/src/debug.h b/src/debug.h index b21cd6434..8963c2efd 100644 --- a/src/debug.h +++ b/src/debug.h @@ -20,17 +20,9 @@ */ #ifdef NO_DEBUG_MESSAGES - #if defined(__GNUC__) && (__GNUC__ < 3) - #define DEBUG(name, level, args...) { } - #else - #define DEBUG(name, level, ...) { } - #endif + #define DEBUG(name, level, ...) { } #else /* NO_DEBUG_MESSAGES */ - #if defined(__GNUC__) && (__GNUC__ < 3) - #define DEBUG(name, level, args...) if ((level == 0) || ( _debug_ ## name ## _level >= level)) debug(#name, args) - #else - #define DEBUG(name, level, ...) if (level == 0 || _debug_ ## name ## _level >= level) debug(#name, __VA_ARGS__) - #endif + #define DEBUG(name, level, ...) if (level == 0 || _debug_ ## name ## _level >= level) debug(#name, __VA_ARGS__) extern int _debug_ai_level; extern int _debug_driver_level; diff --git a/src/gamelog.cpp b/src/gamelog.cpp index 55b6a7468..1198e20ed 100644 --- a/src/gamelog.cpp +++ b/src/gamelog.cpp @@ -591,7 +591,7 @@ void GamelogGRFAddList(const GRFConfig *newg) /** List of GRFs using array of pointers instead of linked list */ struct GRFList { uint n; - const GRFConfig *grf[VARARRAY_SIZE]; + const GRFConfig *grf[]; }; /** Generates GRFList diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index 0e5e620f7..50e111e4a 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -80,7 +80,7 @@ public: public: GRFText *next; byte langid; - char text[VARARRAY_SIZE]; + char text[]; }; diff --git a/src/script/squirrel_class.hpp b/src/script/squirrel_class.hpp index 20e838089..b8f098159 100644 --- a/src/script/squirrel_class.hpp +++ b/src/script/squirrel_class.hpp @@ -5,14 +5,6 @@ #ifndef SQUIRREL_CLASS_HPP #define SQUIRREL_CLASS_HPP -#if (__GNUC__ == 2) -/* GCC 2.95 doesn't like to have SQConvert::DefSQStaticCallback inside a - * template (it gives an internal error 373). Above that, it doesn't listen - * to 'using namespace' inside a function of a template. So for GCC 2.95 we - * do it in the global space to avoid compiler errors. */ -using namespace SQConvert; -#endif /* __GNUC__ == 2 */ - /** * The template to define classes in Squirrel. It takes care of the creation * and calling of such classes, to make the AI Layer cleaner while having a diff --git a/src/script/squirrel_helper_type.hpp b/src/script/squirrel_helper_type.hpp index c886d6700..3b340ad8e 100644 --- a/src/script/squirrel_helper_type.hpp +++ b/src/script/squirrel_helper_type.hpp @@ -7,7 +7,7 @@ struct Array { int32 size; - int32 array[VARARRAY_SIZE]; + int32 array[]; }; #endif /* SQUIRREL_HELPER_TYPE_HPP */ diff --git a/src/signal.cpp b/src/signal.cpp index f42819894..b7df907e6 100644 --- a/src/signal.cpp +++ b/src/signal.cpp @@ -19,8 +19,7 @@ enum { SIG_GLOB_UPDATE = 64, ///< how many items need to be in _globset to force update }; -/* need to typecast to compile with MorphOS */ -assert_compile((int)SIG_GLOB_UPDATE <= (int)SIG_GLOB_SIZE); +assert_compile(SIG_GLOB_UPDATE <= SIG_GLOB_SIZE); /** incidating trackbits with given enterdir */ static const TrackBitsByte _enterdir_to_trackbits[DIAGDIR_END] = { diff --git a/src/spritecache.cpp b/src/spritecache.cpp index 1be68f681..d93044d72 100644 --- a/src/spritecache.cpp +++ b/src/spritecache.cpp @@ -67,7 +67,7 @@ static SpriteCache *AllocateSpriteCache(uint index) struct MemBlock { size_t size; - byte data[VARARRAY_SIZE]; + byte data[]; }; static uint _sprite_lru_counter; diff --git a/src/spritecache.h b/src/spritecache.h index a8d0ce144..1d7c5d3b1 100644 --- a/src/spritecache.h +++ b/src/spritecache.h @@ -12,7 +12,7 @@ struct Sprite { uint16 width; int16 x_offs; int16 y_offs; - byte data[VARARRAY_SIZE]; + byte data[]; }; extern uint _sprite_cache_size; diff --git a/src/stdafx.h b/src/stdafx.h index d6b735cd9..24c9e799d 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -116,9 +116,6 @@ #define printf pspDebugScreenPrintf #endif /* PSP */ -/* by default we use [] var arrays */ -#define VARARRAY_SIZE - /* Stuff for GCC */ #if defined(__GNUC__) #define NORETURN __attribute__ ((noreturn)) @@ -129,11 +126,6 @@ /* Warn about functions using 'printf' format syntax. First argument determines which parameter * is the format string, second argument is start of values passed to printf. */ #define WARN_FORMAT(string, args) __attribute__ ((format (printf, string, args))) - - #if (__GNUC__ == 2) - #undef VARARRAY_SIZE - #define VARARRAY_SIZE 0 - #endif #endif /* __GNUC__ */ #if defined(__WATCOMC__) diff --git a/src/strings.cpp b/src/strings.cpp index 3adcc949d..9f2f5261a 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -45,7 +45,7 @@ static char *GetSpecialNameString(char *buff, int ind, int64 *argv, const char * static char *FormatString(char *buff, const char *str, int64 *argv, uint casei, const char *last); struct LanguagePack : public LanguagePackHeader { - char data[VARARRAY_SIZE]; // list of strings + char data[]; // list of strings }; static char **_langpack_offs; diff --git a/src/table/sprites.h b/src/table/sprites.h index c9ca6c98d..3f8e1f79b 100644 --- a/src/table/sprites.h +++ b/src/table/sprites.h @@ -1450,7 +1450,7 @@ enum SpriteMasks { assert_compile( (1 << TRANSPARENT_BIT & SPRITE_MASK) == 0 ); assert_compile( (1 << RECOLOUR_BIT & SPRITE_MASK) == 0 ); -assert_compile( !(TRANSPARENT_BIT == RECOLOUR_BIT) ); +assert_compile( TRANSPARENT_BIT != RECOLOUR_BIT ); assert_compile( (1 << TRANSPARENT_BIT & PALETTE_MASK) == 0); assert_compile( (1 << RECOLOUR_BIT & PALETTE_MASK) == 0 ); -- cgit v1.2.3-54-g00ecf