[xmoto] 02/07: Build with gcc 5 (partially updated to svn 3421).
Stephen Kitt
skitt at moszumanska.debian.org
Sun Mar 20 23:07:50 UTC 2016
This is an automated email from the git hooks/post-receive script.
skitt pushed a commit to branch master
in repository xmoto.
commit db31f38dbacc7e2b04c30f41872189b9b4cc2caa
Author: Stephen Kitt <steve at sk2.org>
Date: Sun Mar 20 23:43:09 2016 +0100
Build with gcc 5 (partially updated to svn 3421).
---
debian/changelog | 2 +
debian/control | 1 -
debian/patches/series | 1 +
debian/patches/svn3421.patch | 485 +++++++++++++++++++++++++++++++++++++++++++
debian/rules | 3 +-
5 files changed, 489 insertions(+), 3 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index d87694b..ac03ca9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
xmoto (0.5.11+dfsg-6) UNRELEASED; urgency=medium
* Switch to https: VCS URIs (see #810378).
+ * Pull in part of upstream's svn version 3421 to build with gcc 5.
+ (Closes: #818782.)
-- Stephen Kitt <skitt at debian.org> Fri, 22 Jan 2016 19:03:31 +0100
diff --git a/debian/control b/debian/control
index 83e696e..5edad0a 100644
--- a/debian/control
+++ b/debian/control
@@ -10,7 +10,6 @@ Build-Depends: autotools-dev,
debhelper (>= 9),
dh-autoreconf,
dpkg-dev (>= 1.13.19),
- g++-4.9,
libbz2-dev,
libcurl4-gnutls-dev,
libgl1-mesa-dev | libgl-dev,
diff --git a/debian/patches/series b/debian/patches/series
index 744e498..25ef264 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@ sa_restorer-removal.patch
utf8.patch
reproducible.patch
string-constants.patch
+svn3421.patch
diff --git a/debian/patches/svn3421.patch b/debian/patches/svn3421.patch
new file mode 100644
index 0000000..6fcdd26
--- /dev/null
+++ b/debian/patches/svn3421.patch
@@ -0,0 +1,485 @@
+Description: Fix several warnings
+
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,7 @@
++X-Moto 0.5.12 201
++--------------------------------
++ * remove several warnings (including replacing hash_map by unordered_map)
++
+ X-Moto 0.5.11 2014-03-29
+ --------------------------------
+ * handles lua 5.2 library loading changes
+--- a/src/states/StateOptions.cpp
++++ b/src/states/StateOptions.cpp
+@@ -728,7 +728,7 @@
+ i_screen->getDispWidth(),
+ i_screen->getDispHeight());
+
+- UIWindow *v_window, *v_frame;
++ UIWindow *v_window;
+ UIStatic* v_someText;
+ UITabView* v_tabview;
+ UIButton* v_button;
+@@ -750,11 +750,11 @@
+ v_tabview->setTabContextHelp(3, CONTEXTHELP_DB_OPTIONS);
+ v_tabview->setTabContextHelp(4, CONTEXTHELP_LANGUAGE_OPTIONS);
+
+- v_frame = makeWindowOptions_general(v_tabview);
+- v_frame = makeWindowOptions_rooms(v_tabview);
+- v_frame = makeWindowOptions_ghosts(v_tabview);
+- v_frame = makeWindowOptions_db(v_tabview);
+- v_frame = makeWindowOptions_language(v_tabview);
++ makeWindowOptions_general(v_tabview);
++ makeWindowOptions_rooms(v_tabview);
++ makeWindowOptions_ghosts(v_tabview);
++ makeWindowOptions_db(v_tabview);
++ makeWindowOptions_language(v_tabview);
+
+ v_button = new UIButton(v_window, 20, v_window->getPosition().nHeight-68, GAMETEXT_DEFAULTS, 115, 57);
+ v_button->setID("DEFAULTS_BUTTON");
+@@ -2134,7 +2134,6 @@
+ }
+
+ void StateOptions::createRoomsList(UIList *pList) {
+- UIListEntry *pEntry;
+ std::string v_selected_roomName = "";
+ char **v_result;
+ unsigned int nrow;
+@@ -2157,7 +2156,7 @@
+ for(unsigned int i=0; i<nrow; i++) {
+ v_roomId = xmDatabase::instance("main")->getResult(v_result, 2, i, 0);
+ v_roomName = xmDatabase::instance("main")->getResult(v_result, 2, i, 1);
+- pEntry = pList->addEntry(v_roomName, reinterpret_cast<void *>(new std::string(v_roomId)));
++ pList->addEntry(v_roomName, reinterpret_cast<void *>(new std::string(v_roomId)));
+ }
+ xmDatabase::instance("main")->read_DB_free(v_result);
+
+@@ -2165,7 +2164,7 @@
+ for(unsigned int i=0; i<nrow; i++) {
+ v_roomId = xmDatabase::instance("main")->getResult(v_result, 2, i, 0);
+ v_roomName = xmDatabase::instance("main")->getResult(v_result, 2, i, 1);
+- pEntry = pList->addEntry(v_roomName, reinterpret_cast<void *>(new std::string(v_roomId)));
++ pList->addEntry(v_roomName, reinterpret_cast<void *>(new std::string(v_roomId)));
+ }
+ xmDatabase::instance("main")->read_DB_free(v_result);
+
+--- a/src/drawlib/DrawLibOpenGL.cpp
++++ b/src/drawlib/DrawLibOpenGL.cpp
+@@ -80,7 +80,7 @@
+ /* a glyph from other glyphs */
+ /*kejo:why not just grrr create a copy contructor*/
+ GLFontGlyph(const std::string& i_value,
+- HashNamespace::hash_map<const char*, GLFontGlyphLetter*, HashNamespace::hash<const char*>, hashcmp_str>& i_glyphsLetters);
++ HashNamespace::unordered_map<std::string, GLFontGlyphLetter*>& i_glyphsLetters);
+ virtual ~GLFontGlyph();
+
+ std::string Value() const;
+@@ -132,11 +132,11 @@
+ private:
+ std::vector<std::string> m_glyphsKeys;
+ std::vector<GLFontGlyph*> m_glyphsValues;
+- HashNamespace::hash_map<const char*, GLFontGlyph*, HashNamespace::hash<const char*>, hashcmp_str> m_glyphs;
++ HashNamespace::unordered_map<std::string, GLFontGlyph*> m_glyphs;
+
+ std::vector<std::string> m_glyphsLettersKeys;
+ std::vector<GLFontGlyphLetter*> m_glyphsLettersValues;
+- HashNamespace::hash_map<const char*, GLFontGlyphLetter*, HashNamespace::hash<const char*>, hashcmp_str> m_glyphsLetters;
++ HashNamespace::unordered_map<std::string, GLFontGlyphLetter*> m_glyphsLetters;
+
+ unsigned int getLonguestLineSize(const std::string& i_value, unsigned int i_start = 0, unsigned int i_nbLinesToRead = -1);
+ };
+@@ -825,7 +825,7 @@
+ }
+
+ GLFontGlyph::GLFontGlyph(const std::string& i_value,
+- HashNamespace::hash_map<const char*, GLFontGlyphLetter*, HashNamespace::hash<const char*>, hashcmp_str>& i_glyphsLetters) {
++ HashNamespace::unordered_map<std::string, GLFontGlyphLetter*>& i_glyphsLetters) {
+ GLFontGlyph* v_glyph;
+ std::string v_char;
+
+@@ -850,7 +850,7 @@
+ v_maxHeight = 0;
+ v_curWidth = 0;
+ } else {
+- v_glyph = i_glyphsLetters[v_char.c_str()];
++ v_glyph = i_glyphsLetters[v_char];
+ if(v_glyph != NULL) {
+ if(v_glyph->realHeight() > v_maxHeight)
+ v_maxHeight = v_glyph->realHeight();
+@@ -927,7 +927,7 @@
+ /* i added the m_glyphsList because the iterator on the hashmap
+ often produces segfault on delete it->second */
+ //printf("BEGIN ~GLFontManager()\n");
+- //HashNamespace::hash_map<const char*, GLFontGlyph*, HashNamespace::hash<const char*>, hashcmp_str, std::allocator<GLFontGlyph*> >::iterator it;
++ //HashNamespace::unordered_map<std::string, GLFontGlyph*>::iterator it;
+ //for (it = m_glyphs.begin(); it != m_glyphs.end(); it++) {
+ // delete it->second;
+ //}
+@@ -967,7 +967,7 @@
+ GLFontGlyph *v_glyph;
+ GLFontGlyphLetter *v_glyphLetter;
+
+- v_glyph = m_glyphs[i_string.c_str()];
++ v_glyph = m_glyphs[i_string];
+ if(v_glyph != NULL) return v_glyph;
+
+ /* make sure that chars exists into the hashmap before continuing */
+@@ -976,11 +976,11 @@
+ while(n < i_string.size()) {
+ v_char = utf8::getNextChar(i_string, n);
+ if(v_char != "\n") {
+- if(m_glyphsLetters[v_char.c_str()] == NULL) {
++ if(m_glyphsLetters[v_char] == NULL) {
+ v_glyphLetter = new GLFontGlyphLetter(v_char, m_ttf, m_fixedFontSize);
+ m_glyphsLettersKeys.push_back(v_char);
+ m_glyphsLettersValues.push_back(v_glyphLetter);
+- m_glyphsLetters[m_glyphsLettersKeys[m_glyphsLettersKeys.size()-1].c_str()] = v_glyphLetter;
++ m_glyphsLetters[m_glyphsLettersKeys[m_glyphsLettersKeys.size()-1]] = v_glyphLetter;
+ }
+ }
+ }
+@@ -989,7 +989,7 @@
+ v_glyph = new GLFontGlyph(i_string, m_glyphsLetters);
+ m_glyphsKeys.push_back(i_string);
+ m_glyphsValues.push_back(v_glyph);
+- m_glyphs[m_glyphsKeys[m_glyphsKeys.size()-1].c_str()] = v_glyph;
++ m_glyphs[m_glyphsKeys[m_glyphsKeys.size()-1]] = v_glyph;
+
+ return v_glyph;
+ }
+@@ -1078,7 +1078,7 @@
+ v_y -= v_lineHeight + UTF8_INTERLINE_SPACE;
+ v_lineHeight = 0;
+ } else {
+- v_glyphLetter = m_glyphsLetters[v_char.c_str()];
++ v_glyphLetter = m_glyphsLetters[v_char];
+ if(v_glyphLetter != NULL) {
+ if(v_glyphLetter->realHeight() > v_lineHeight)
+ v_lineHeight = v_glyphLetter->realHeight();
+@@ -1145,7 +1145,7 @@
+ return v_longuest_linesize;
+ }
+ } else {
+- v_glyphLetter = m_glyphsLetters[v_char.c_str()];
++ v_glyphLetter = m_glyphsLetters[v_char];
+ if(v_glyphLetter != NULL) {
+ v_current_linesize += v_glyphLetter->realWidth() + UTF8_INTERCHAR_SPACE;
+ }
+--- a/src/VXml.cpp
++++ b/src/VXml.cpp
+@@ -39,7 +39,6 @@
+ }
+
+ void XMLDocument::XMLDocumentErrorFunc(void* ctx, const char* msg, ...) {
+- XMLDocument* v_xml = (XMLDocument*) ctx;
+ va_list List;
+ char cBuf[2048];
+
+--- a/src/WWW.h
++++ b/src/WWW.h
+@@ -30,10 +30,6 @@
+ #include <stdio.h>
+ #include <curl/curl.h>
+
+-#if !defined(WIN32) && !defined(__APPLE__) && !defined(__MACH__)
+- //#define USE_HASH_MAP // removed because it seems to segfault i don't know why when i refresh levels using F5 and quit
+-#endif
+-
+ #include "WWWAppInterface.h"
+ #include "Theme.h"
+ #include "XMSession.h"
+@@ -62,27 +58,6 @@
+
+ #define WWW_AGENT ("xmoto-" + XMBuild::getVersionString(true))
+
+-#if defined(USE_HASH_MAP)
+- #ifdef __GNUC__
+- #if (__GNUC__ >= 3)
+- #include <ext/hash_map>
+- namespace HashNamespace=__gnu_cxx;
+- #else
+- #include <hash_map>
+- #define HashNamespace std
+- #endif
+- #else // #ifdef __GNUC__
+- #include <hash_map>
+- namespace HashNamespace=std;
+- #endif
+-
+- struct highscore_str {
+- bool operator()(const char* s1, const char* s2) {
+- return strcmp(s1, s2) == 0;
+- }
+- };
+-#endif
+-
+ struct f_curl_download_data {
+ WWWAppInterface *v_WebApp;
+ int v_nb_files_to_download;
+--- a/src/VBezier.cpp
++++ b/src/VBezier.cpp
+@@ -97,14 +97,7 @@
+ ===========================================================================*/
+ void BezierShape::finishCreation() {
+ /* Okay, create shape curves */
+- for(unsigned int i=0;i<m_nNumPoints;i++) {
+- /* Next point? */
+- int j;
+- if(i+1 == m_nNumPoints)
+- j=0;
+- else
+- j=i+1;
+-
++ for(unsigned int i=0;i<m_nNumPoints;i++) {
+ /* Do this curve */
+ m_pCurves[i].setP(0,m_pPoints[i].Pos);
+ m_pCurves[i].setP(1,m_pPoints[i].c2);
+--- a/src/Renderer.cpp
++++ b/src/Renderer.cpp
+@@ -1365,7 +1365,6 @@
+
+ int nStrawberriesLeft = i_scene->getLevelSrc()->countToTakeEntities();
+ int nQuantity = 0;
+- Vector2i bottomLeft = i_scene->getCamera()->getDispBottomLeft();
+ int height = i_scene->getCamera()->getDispHeight();
+
+ if(XMSession::instance()->ugly() == false) {
+@@ -2768,7 +2767,6 @@
+ DrawLib* pDrawlib = GameApp::instance()->getDrawLib();
+
+ Biker* pBiker = i_scene->getCamera()->getPlayerToFollow();
+- Vector2i bottomLeft = i_scene->getCamera()->getDispBottomLeft();
+
+ /* render game time */
+ FontManager* v_fm = pDrawlib->getFontMedium();
+--- a/src/Packager.cpp
++++ b/src/Packager.cpp
+@@ -193,7 +193,7 @@
+ fclose(fp);
+
+ /* Info */
+- printf("%d files scheduled for packaging!\n",FileList.size());
++ printf("%lu files scheduled for packaging!\n",FileList.size());
+ printf("Creating package '%s'...\n", BinFile.c_str());
+
+ /* Do it */
+--- a/src/helpers/Color.h
++++ b/src/helpers/Color.h
+@@ -24,7 +24,7 @@
+ typedef unsigned int Color;
+
+ #define MAKE_COLOR(red, green, blue, alpha) \
+- ((Color)(alpha|(((Color)blue)<<8)|(((Color)green)<<16)|(((Color)red)<<24)))
++ ((Color)((alpha)|(((Color)blue)<<8)|(((Color)green)<<16)|(((Color)red)<<24)))
+
+ #define GET_ALPHA(color) \
+ ((Color)((color)&0xff))
+--- a/src/Locales.cpp
++++ b/src/Locales.cpp
+@@ -88,6 +88,11 @@
+
+ cs = bind_textdomain_codeset(PACKAGE_LANG, "UTF-8");
+
++ if(cs == NULL) {
++ /* outch not enough memory, no real thing to do */
++ return locale;
++ }
++
+ return locale;
+
+ #endif
+--- a/src/LevelsManager.cpp
++++ b/src/LevelsManager.cpp
+@@ -659,15 +659,13 @@
+
+ i_db->levels_add_begin(true);
+ for(unsigned int i=0; i<LvlFiles.size(); i++) {
+- bool bCached = false;
+-
+ /* add the level from the unloaded levels if possible to make it faster */
+ if(i_db->levels_add_fast(LvlFiles[i], v_levelName, true) == false) {
+ Level *v_level = new Level();
+
+ try {
+ v_level->setFileName(LvlFiles[i]);
+- bCached = v_level->loadReducedFromFile(i_loadMainLayerOnly);
++ v_level->loadReducedFromFile(i_loadMainLayerOnly);
+
+ v_levelName = v_level->Name();
+
+@@ -702,10 +700,8 @@
+ void LevelsManager::addExternalLevel(std::string i_levelFile, xmDatabase *i_db, bool i_loadMainLayerOnly) {
+ Level *v_level = new Level();
+ try {
+- bool bCached = false;
+-
+ v_level->setFileName(i_levelFile);
+- bCached = v_level->loadReducedFromFile(i_loadMainLayerOnly);
++ v_level->loadReducedFromFile(i_loadMainLayerOnly);
+
+ // Check for ID conflict
+ if(doesLevelExist(v_level->Id(), i_db)) {
+@@ -741,7 +737,6 @@
+ i_db->levels_add_begin(false);
+
+ for(unsigned int i=0; i<LvlFiles.size(); i++) {
+- bool bCached = false;
+ int v_isExternal;
+
+ v_isExternal = LvlFiles[i].find("Levels/MyLevels/") != std::string::npos;
+@@ -755,7 +750,7 @@
+
+ try {
+ v_level->setFileName(LvlFiles[i]);
+- bCached = v_level->loadReducedFromFile(i_loadMainLayerOnly);
++ v_level->loadReducedFromFile(i_loadMainLayerOnly);
+
+ // Check for ID conflict
+ if(doesLevelExist(v_level->Id(), i_db)) {
+@@ -873,7 +868,6 @@
+
+ /* new */
+ for(unsigned int i=0; i<NewLvl.size(); i++) {
+- bool bCached = false;
+ v_level = new Level();
+
+ try {
+@@ -881,7 +875,7 @@
+ current++;
+
+ v_level->setFileName(NewLvl[i]);
+- bCached = v_level->loadReducedFromFile(i_loadMainLayerOnly);
++ v_level->loadReducedFromFile(i_loadMainLayerOnly);
+
+ // Check for ID conflict
+ if(doesLevelExist(v_level->Id(), i_db)) {
+@@ -907,12 +901,11 @@
+
+ /* updated */
+ for(unsigned int i=0; i<UpdatedLvl.size(); i++) {
+- bool bCached = false;
+ v_level = new Level();
+
+ try {
+ v_level->setFileName(UpdatedLvl[i]);
+- bCached = v_level->loadReducedFromFile(i_loadMainLayerOnly);
++ v_level->loadReducedFromFile(i_loadMainLayerOnly);
+
+ pCaller->setTaskProgress(current * total);
+ pCaller->setBeingDownloadedInformation(v_level->Name());
+--- a/src/VTexture.h
++++ b/src/VTexture.h
+@@ -135,7 +135,7 @@
+
+ void cleanUnregistredTextures();
+
+- HashNamespace::hash_map<const char*, int*, HashNamespace::hash<const char*>, hashcmp_str> m_textureSizeCache;
++ HashNamespace::unordered_map<std::string, int*> m_textureSizeCache;
+ std::vector<std::string> m_textureSizeCacheKeys;
+ std::vector<int*> m_textureSizeCacheValues;
+
+--- a/src/include/xm_hashmap.h
++++ b/src/include/xm_hashmap.h
+@@ -1,25 +1,6 @@
+ #ifndef __XMHASHMAP_H__
+ #define __XMHASHMAP_H__
+
+-#ifdef __GNUC__
+-#if (__GNUC__ >= 3)
+-#include <ext/hash_map>
+- namespace HashNamespace=__gnu_cxx;
+-#else
+-#include <hash_map>
+-#define HashNamespace std
+-#endif
+-#else // #ifdef __GNUC__
+-#include <hash_map>
+-namespace HashNamespace=std;
+-#endif
+-struct hashcmp_str {
+- bool operator()(const char* s1, const char* s2) {
+- if(s1 == NULL || s2 == NULL) {
+- return false;
+- }
+- return strcmp(s1, s2) == 0;
+- }
+-};
+-
++#include <tr1/unordered_map>
++namespace HashNamespace=std::tr1;
+ #endif
+--- a/src/gui/basic/GUIButton.cpp
++++ b/src/gui/basic/GUIButton.cpp
+@@ -29,8 +29,6 @@
+ Painting
+ ===========================================================================*/
+ void UIButton::paint(void) {
+- int xm=0,ym=0;
+-
+ bool bDisabled = isDisabled();
+ bool bActive = isActive();
+
+@@ -68,7 +66,6 @@
+ }
+ break;
+ }
+- xm=2; ym=2;
+ } else {
+ switch(m_Type) {
+ case UI_BUTTON_TYPE_LARGE:
+--- a/src/xmscene/Level.cpp
++++ b/src/xmscene/Level.cpp
+@@ -1221,8 +1221,6 @@
+ /* Spawn initial entities */
+ for(unsigned int i=0; i<m_entities.size(); i++) {
+ m_entities[i]->loadToPlay(m_scriptSource);
+- Vector2f v = m_entities[i]->DynamicPosition();
+-
+ m_pCollisionSystem->addEntity(m_entities[i]);
+
+ if(m_entities[i]->IsToTake()){
+--- a/src/xmscene/GhostTrail.cpp
++++ b/src/xmscene/GhostTrail.cpp
+@@ -65,7 +65,6 @@
+ // now lets try real linear interpolation
+ Vector2f v_P_old = m_trailData[0],
+ v_P_new,
+- v_vecCum = Vector2f(0,0),
+ v_vecTmp;
+ float v_time = TRAIL_INTERPOLATION_STEP;
+
+--- a/src/xmscene/BikePlayer.cpp
++++ b/src/xmscene/BikePlayer.cpp
+@@ -120,11 +120,8 @@
+ }
+
+ /* controler */
+- bool bChangeDir = false;
+ if(m_BikeC->ChangeDir()) {
+ m_BikeC->setChangeDir(false);
+- bChangeDir = true;
+-
+ m_bikeState->Dir = m_bikeState->Dir==DD_LEFT?DD_RIGHT:DD_LEFT; /* switch */
+ m_changeDirPer = 0.0;
+ }
+--- a/src/VTexture.cpp
++++ b/src/VTexture.cpp
+@@ -307,7 +307,7 @@
+ int* v_val;
+
+ // cache
+- v_val = m_textureSizeCache[p_fileName.c_str()];
++ v_val = m_textureSizeCache[p_fileName];
+ if(v_val != NULL) {
+ return *v_val;
+ }
+@@ -331,7 +331,7 @@
+ #endif
+ m_textureSizeCacheKeys.push_back(p_fileName);
+ m_textureSizeCacheValues.push_back(v_val);
+- m_textureSizeCache[m_textureSizeCacheKeys[m_textureSizeCacheKeys.size()-1].c_str()] = v_val;
++ m_textureSizeCache[m_textureSizeCacheKeys[m_textureSizeCacheKeys.size()-1]] = v_val;
+
+ }
+
diff --git a/debian/rules b/debian/rules
index f263ead..b224143 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,5 +13,4 @@ override_dh_auto_configure:
--bindir=\$${prefix}/games \
--datadir=\$${prefix}/share/games \
--mandir=\$${prefix}/share/man \
- --localedir=\$${prefix}/share/games/locale \
- CXX=g++-4.9
+ --localedir=\$${prefix}/share/games/locale
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/xmoto.git
More information about the Pkg-games-commits
mailing list