fix compiling on gcc 4.6 (too early to use 4.7.1...)

This commit is contained in:
niczkx 2012-07-30 18:47:21 -06:00
parent 39db801f93
commit 4c369bc823
24 changed files with 53 additions and 52 deletions

View File

@ -68,8 +68,8 @@ protected:
std::string m_appCompactName; std::string m_appCompactName;
std::string m_appVersion; std::string m_appVersion;
std::string m_startupOptions; std::string m_startupOptions;
bool m_running = false; stdext::boolean<false> m_running;
bool m_stopping = false; stdext::boolean<false> m_stopping;
stdext::boolean<false> m_terminated; stdext::boolean<false> m_terminated;
}; };

View File

@ -40,7 +40,7 @@ public:
private: private:
std::list<EventPtr> m_eventList; std::list<EventPtr> m_eventList;
int m_pollEventsSize; int m_pollEventsSize;
bool m_disabled = false; stdext::boolean<false> m_disabled;
std::priority_queue<ScheduledEventPtr, std::vector<ScheduledEventPtr>, lessScheduledEvent> m_scheduledEventList; std::priority_queue<ScheduledEventPtr, std::vector<ScheduledEventPtr>, lessScheduledEvent> m_scheduledEventList;
}; };

View File

@ -60,8 +60,8 @@ protected:
void inputEvent(const InputEvent& event); void inputEvent(const InputEvent& event);
private: private:
bool m_onInputEvent = false; stdext::boolean<false> m_onInputEvent;
bool m_mustRepaint = false; stdext::boolean<false> m_mustRepaint;
AdaptativeFrameCounter m_backgroundFrameCounter; AdaptativeFrameCounter m_backgroundFrameCounter;
AdaptativeFrameCounter m_foregroundFrameCounter; AdaptativeFrameCounter m_foregroundFrameCounter;
TexturePtr m_foreground; TexturePtr m_foreground;

View File

@ -63,10 +63,10 @@ protected:
friend class ModuleManager; friend class ModuleManager;
private: private:
bool m_loaded = false; stdext::boolean<false> m_loaded;
bool m_autoLoad = false; stdext::boolean<false> m_autoLoad;
bool m_reloadable = false; stdext::boolean<false> m_reloadable;
bool m_sandboxed = false; stdext::boolean<false> m_sandboxed;
int m_autoLoadPriority; int m_autoLoadPriority;
int m_sandboxEnv; int m_sandboxEnv;
std::tuple<std::string, std::string> m_onLoadFunc; std::tuple<std::string, std::string> m_onLoadFunc;

View File

@ -72,7 +72,7 @@ public:
private: private:
std::string m_workDir; std::string m_workDir;
std::string m_writeDir; std::string m_writeDir;
bool m_hasSearchPath = false; stdext::boolean<false> m_hasSearchPath;
std::deque<std::string> m_searchPaths; std::deque<std::string> m_searchPaths;
}; };

View File

@ -41,7 +41,7 @@ public:
private: private:
ticks_t m_startTicks; ticks_t m_startTicks;
bool m_stopped = false; stdext::boolean<false> m_stopped;
}; };
#endif #endif

View File

@ -48,7 +48,7 @@ private:
std::string m_text; std::string m_text;
Size m_textSize; Size m_textSize;
bool m_textMustRecache = true; stdext::boolean<true> m_textMustRecache;
CoordsBuffer m_textCoordsBuffer; CoordsBuffer m_textCoordsBuffer;
Rect m_textCachedScreenCoords; Rect m_textCachedScreenCoords;
BitmapFontPtr m_font; BitmapFontPtr m_font;

View File

@ -61,8 +61,8 @@ private:
Size m_oldViewportSize; Size m_oldViewportSize;
uint m_fbo; uint m_fbo;
uint m_prevBoundFbo; uint m_prevBoundFbo;
bool m_backuping = true; stdext::boolean<true> m_backuping;
bool m_smooth = true; stdext::boolean<true> m_smooth;
static uint boundFbo; static uint boundFbo;
}; };

View File

@ -77,16 +77,16 @@ private:
int m_maxTextureSize; int m_maxTextureSize;
int m_alphaBits; int m_alphaBits;
bool m_ok = false; stdext::boolean<false> m_ok;
bool m_useDrawArrays = true; stdext::boolean<true> m_useDrawArrays;
bool m_useFBO = true; stdext::boolean<true> m_useFBO;
bool m_useHardwareBuffers = false; stdext::boolean<false> m_useHardwareBuffers;
bool m_useBilinearFiltering = true; stdext::boolean<true> m_useBilinearFiltering;
bool m_useNonPowerOfTwoTextures = true; stdext::boolean<true> m_useNonPowerOfTwoTextures;
bool m_useMipmaps = true; stdext::boolean<true> m_useMipmaps;
bool m_useHardwareMipmaps = true; stdext::boolean<true> m_useHardwareMipmaps;
bool m_useClampToEdge = true; stdext::boolean<true> m_useClampToEdge;
bool m_cacheBackbuffer = true; stdext::boolean<true> m_cacheBackbuffer;
PainterEngine m_prefferedPainterEngine; PainterEngine m_prefferedPainterEngine;
PainterEngine m_selectedPainterEngine; PainterEngine m_selectedPainterEngine;
}; };

View File

@ -72,7 +72,7 @@ private:
void updateGlTextureState(); void updateGlTextureState();
GLenum m_matrixMode; GLenum m_matrixMode;
bool m_textureEnabled = false; stdext::boolean<false> m_textureEnabled;
}; };
extern PainterOGL1 *g_painterOGL1; extern PainterOGL1 *g_painterOGL1;

View File

@ -63,10 +63,10 @@ protected:
Size m_size; Size m_size;
Size m_glSize; Size m_glSize;
Matrix3 m_transformMatrix; Matrix3 m_transformMatrix;
bool m_hasMipmaps = false; stdext::boolean<false> m_hasMipmaps;
bool m_smooth = false; stdext::boolean<false> m_smooth;
bool m_upsideDown = false; stdext::boolean<false> m_upsideDown;
bool m_repeat = false; stdext::boolean<false> m_repeat;
}; };
#endif #endif

View File

@ -111,11 +111,11 @@ protected:
InputEvent m_inputEvent; InputEvent m_inputEvent;
stdext::boolean<false> m_mouseButtonStates[4]; stdext::boolean<false> m_mouseButtonStates[4];
bool m_created = false; stdext::boolean<false> m_created;
bool m_visible = false; stdext::boolean<false> m_visible;
bool m_focused = false; stdext::boolean<false> m_focused;
bool m_fullscreen = false; stdext::boolean<false> m_fullscreen;
bool m_maximized = false; stdext::boolean<false> m_maximized;
std::function<void()> m_onClose; std::function<void()> m_onClose;
OnResizeCallback m_onResize; OnResizeCallback m_onResize;

View File

@ -61,8 +61,8 @@ private:
SoundSourcePtr m_musicSource; SoundSourcePtr m_musicSource;
ALCdevice *m_device; ALCdevice *m_device;
ALCcontext *m_context; ALCcontext *m_context;
bool m_musicEnabled = false; stdext::boolean<false> m_musicEnabled;
bool m_soundEnabled = false; stdext::boolean<false> m_soundEnabled;
std::string m_currentMusic; std::string m_currentMusic;
}; };

View File

@ -56,7 +56,7 @@ private:
SoundFilePtr m_soundFile; SoundFilePtr m_soundFile;
std::array<SoundBufferPtr,STREAM_FRAGMENTS> m_buffers; std::array<SoundBufferPtr,STREAM_FRAGMENTS> m_buffers;
DownMix m_downMix; DownMix m_downMix;
bool m_looping = false; stdext::boolean<false> m_looping;
}; };
#endif #endif

View File

@ -34,6 +34,7 @@
namespace stdext { namespace stdext {
class attrib_storage { class attrib_storage {
public: public:
attrib_storage() : m_attribs(nullptr), m_size(0) { }
~attrib_storage() { if(m_attribs) delete[] m_attribs; } ~attrib_storage() { if(m_attribs) delete[] m_attribs; }
template<typename T> template<typename T>
@ -74,8 +75,8 @@ public:
} }
private: private:
std::tuple<uint8, boost::any>* m_attribs = nullptr; std::tuple<uint8, boost::any>* m_attribs;
uint8 m_size = 0; uint8 m_size;
}; };
// restore memory alignment // restore memory alignment

View File

@ -27,8 +27,8 @@
// clang is supported // clang is supported
#undef _GLIBCXX_USE_FLOAT128 #undef _GLIBCXX_USE_FLOAT128
#elif defined(__GNUC__) #elif defined(__GNUC__)
#if !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) #if !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#error "Sorry, you need gcc 4.7 or greater to compile." #error "Sorry, you need gcc 4.6 or greater to compile."
#endif #endif
#else #else
#error "Compiler not supported." #error "Compiler not supported."

View File

@ -41,7 +41,7 @@ public:
bool isUIBoxLayout() { return true; } bool isUIBoxLayout() { return true; }
protected: protected:
bool m_fitChildren = false; stdext::boolean<false> m_fitChildren;
int m_spacing; int m_spacing;
}; };

View File

@ -55,9 +55,9 @@ private:
int m_cellSpacing; int m_cellSpacing;
int m_numColumns; int m_numColumns;
int m_numLines; int m_numLines;
bool m_autoSpacing = false; stdext::boolean<false> m_autoSpacing;
bool m_fitChildren = false; stdext::boolean<false> m_fitChildren;
bool m_flow = false; stdext::boolean<false> m_flow;
}; };
#endif #endif

View File

@ -39,7 +39,7 @@ public:
protected: protected:
bool internalUpdate(); bool internalUpdate();
bool m_alignRight = false; stdext::boolean<false> m_alignRight;
}; };
#endif #endif

View File

@ -58,8 +58,8 @@ protected:
virtual bool internalUpdate() = 0; virtual bool internalUpdate() = 0;
int m_updateDisabled; int m_updateDisabled;
bool m_updating = false; stdext::boolean<false> m_updating;
bool m_updateScheduled = false; stdext::boolean<false> m_updateScheduled;
UIWidgetPtr m_parentWidget; UIWidgetPtr m_parentWidget;
}; };

View File

@ -82,8 +82,8 @@ private:
UIWidgetPtr m_draggingWidget; UIWidgetPtr m_draggingWidget;
UIWidgetPtr m_hoveredWidget; UIWidgetPtr m_hoveredWidget;
UIWidgetPtr m_pressedWidget; UIWidgetPtr m_pressedWidget;
bool m_hoverUpdateScheduled = false; stdext::boolean<false> m_hoverUpdateScheduled;
bool m_drawDebugBoxes = false; stdext::boolean<false> m_drawDebugBoxes;
std::unordered_map<std::string, OTMLNodePtr> m_styles; std::unordered_map<std::string, OTMLNodePtr> m_styles;
UIWidgetList m_destroyedWidgets; UIWidgetList m_destroyedWidgets;
ScheduledEventPtr m_checkEvent; ScheduledEventPtr m_checkEvent;

View File

@ -98,6 +98,7 @@ bool Creatures::m_loadCreatureBuffer(TiXmlElement* attrib, const CreatureTypePtr
return true; return true;
Outfit out; Outfit out;
out.setCategory(ThingCategoryCreature);
int32 type; int32 type;
if(!attrib->Attribute("type").empty()) if(!attrib->Attribute("type").empty())
type = attrib->readType<int32>("type"); type = attrib->readType<int32>("type");

View File

@ -122,7 +122,7 @@ void Map::loadOtbm(const std::string& fileName)
setHouseFile(fileName.substr(0, fileName.rfind('/') + 1) + tmp); setHouseFile(fileName.substr(0, fileName.rfind('/') + 1) + tmp);
break; break;
default: default:
stdext::throw_exception(stdext::format("Invalid attribute '%c'", attribute)); stdext::throw_exception(stdext::format("Invalid attribute '%d'", (int)attribute));
} }
} }

View File

@ -129,7 +129,6 @@ enum clientVersion_t
CLIENT_VERSION_960 = 40 CLIENT_VERSION_960 = 40
}; };
enum { enum {
OTCM_SIGNATURE = 0x4D43544F, OTCM_SIGNATURE = 0x4D43544F,
OTCM_VERSION = 1 OTCM_VERSION = 1