projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
05a87df
)
Fixed numerous issues that caused errors in clang
author
Ingo Ruhnke
<grumbel@gmail.com>
Sun, 31 Aug 2014 06:12:18 +0000
(08:12 +0200)
committer
Ingo Ruhnke
<grumbel@gmail.com>
Sun, 31 Aug 2014 06:26:45 +0000
(08:26 +0200)
16 files changed:
CMakeLists.txt
patch
|
blob
|
history
external/tinygettext/src/plural_forms.cpp
patch
|
blob
|
history
src/addon/downloader.cpp
patch
|
blob
|
history
src/badguy/kugelblitz.cpp
patch
|
blob
|
history
src/badguy/kugelblitz.hpp
patch
|
blob
|
history
src/badguy/treewillowisp.cpp
patch
|
blob
|
history
src/object/block.cpp
patch
|
blob
|
history
src/object/bullet.cpp
patch
|
blob
|
history
src/object/camera.cpp
patch
|
blob
|
history
src/object/infoblock.cpp
patch
|
blob
|
history
src/object/player.cpp
patch
|
blob
|
history
src/supertux/savegame.cpp
patch
|
blob
|
history
src/util/utf8_iterator.cpp
patch
|
blob
|
history
src/video/drawing_context.hpp
patch
|
blob
|
history
src/video/gl/gl_painter.hpp
patch
|
blob
|
history
src/video/gl/gl_texture.cpp
patch
|
blob
|
history
diff --git
a/CMakeLists.txt
b/CMakeLists.txt
index
f8bd259
..
f46bb2d
100644
(file)
--- a/
CMakeLists.txt
+++ b/
CMakeLists.txt
@@
-273,8
+273,8
@@
IF(CMAKE_COMPILER_IS_GNUCC)
# fails on MinGW:
# -ansi
# fails on clang:
# fails on MinGW:
# -ansi
# fails on clang:
- # -Wlogical-op
- SET(SUPERTUX2_EXTRA_WARNING_FLAGS "-fdiagnostics-show-option -pedantic -Wno-long-long -Wcast-align -Wdisabled-optimization -Winit-self -Winvalid-pch -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wstack-protector -Wformat=2 -Weffc++ -Wctor-dtor-privacy
-Wstrict-null-sentinel
-Wno-unused-parameter -Wshadow -Wnon-virtual-dtor -Wcast-qual")
+ # -Wlogical-op
-Wstrict-null-sentinel
+ SET(SUPERTUX2_EXTRA_WARNING_FLAGS "-fdiagnostics-show-option -pedantic -Wno-long-long -Wcast-align -Wdisabled-optimization -Winit-self -Winvalid-pch -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wstack-protector -Wformat=2 -Weffc++ -Wctor-dtor-privacy -Wno-unused-parameter -Wshadow -Wnon-virtual-dtor -Wcast-qual")
ENDIF(WARNINGS)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
ENDIF(WARNINGS)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
diff --git
a/external/tinygettext/src/plural_forms.cpp
b/external/tinygettext/src/plural_forms.cpp
index
5a2fd55
..
d9aa7f3
100644
(file)
--- a/
external/tinygettext/src/plural_forms.cpp
+++ b/
external/tinygettext/src/plural_forms.cpp
@@
-46,7
+46,7
@@
unsigned int plural4_ar(int n) { return static_cast<unsigned int>( n==1 ? 0 : n=
PluralForms
PluralForms::from_string(const std::string& str)
{
PluralForms
PluralForms::from_string(const std::string& str)
{
- static std::unordered_map<std::string,
struct
PluralForms> plural_forms;
+ static std::unordered_map<std::string, PluralForms> plural_forms;
if (plural_forms.empty())
{
if (plural_forms.empty())
{
@@
-73,7
+73,7
@@
PluralForms::from_string(const std::string& str)
if (!isspace(str[i]))
space_less_str += str[i];
if (!isspace(str[i]))
space_less_str += str[i];
- std::unordered_map<std::string,
struct
PluralForms>::const_iterator it= plural_forms.find(space_less_str);
+ std::unordered_map<std::string, PluralForms>::const_iterator it= plural_forms.find(space_less_str);
if (it != plural_forms.end())
{
return it->second;
if (it != plural_forms.end())
{
return it->second;
diff --git
a/src/addon/downloader.cpp
b/src/addon/downloader.cpp
index
574254f
..
d948541
100644
(file)
--- a/
src/addon/downloader.cpp
+++ b/
src/addon/downloader.cpp
@@
-82,8
+82,8
@@
public:
m_id(id),
m_url(url),
m_handle(),
m_id(id),
m_url(url),
m_handle(),
- m_error_buffer({
'\0'
}),
- m_status(new TransferStatus(downloader, id)),
+ m_error_buffer({
{'\0'}
}),
+ m_status(new TransferStatus(
m_
downloader, id)),
m_fout(PHYSFS_openWrite(outfile.c_str()), PHYSFS_close)
{
if (!m_fout)
m_fout(PHYSFS_openWrite(outfile.c_str()), PHYSFS_close)
{
if (!m_fout)
diff --git
a/src/badguy/kugelblitz.cpp
b/src/badguy/kugelblitz.cpp
index
da2c6e0
..
cfc900f
100644
(file)
--- a/
src/badguy/kugelblitz.cpp
+++ b/
src/badguy/kugelblitz.cpp
@@
-40,7
+40,6
@@
Kugelblitz::Kugelblitz(const Reader& reader) :
movement_timer(),
lifetime(),
direction(),
movement_timer(),
lifetime(),
direction(),
- state(),
light(0.0f,0.0f,0.0f),
lightsprite(SpriteManager::current()->create("images/objects/lightmap_light/lightmap_light.sprite"))
{
light(0.0f,0.0f,0.0f),
lightsprite(SpriteManager::current()->create("images/objects/lightmap_light/lightmap_light.sprite"))
{
diff --git
a/src/badguy/kugelblitz.hpp
b/src/badguy/kugelblitz.hpp
index
b235aec
..
6b6f61c
100644
(file)
--- a/
src/badguy/kugelblitz.hpp
+++ b/
src/badguy/kugelblitz.hpp
@@
-46,7
+46,6
@@
private:
Timer movement_timer;
Timer lifetime;
int direction;
Timer movement_timer;
Timer lifetime;
int direction;
- State state;
Color light;
SpritePtr lightsprite;
};
Color light;
SpritePtr lightsprite;
};
diff --git
a/src/badguy/treewillowisp.cpp
b/src/badguy/treewillowisp.cpp
index
3de20e0
..
3dd74f1
100644
(file)
--- a/
src/badguy/treewillowisp.cpp
+++ b/
src/badguy/treewillowisp.cpp
@@
-26,7
+26,6
@@
#include <math.h>
static const std::string TREEWILLOSOUND = "sounds/willowisp.wav";
#include <math.h>
static const std::string TREEWILLOSOUND = "sounds/willowisp.wav";
-static const float SUCKSPEED = 25;
TreeWillOWisp::TreeWillOWisp(GhostTree* tree_, const Vector& pos,
float radius_, float speed_) :
TreeWillOWisp::TreeWillOWisp(GhostTree* tree_, const Vector& pos,
float radius_, float speed_) :
diff --git
a/src/object/block.cpp
b/src/object/block.cpp
index
1e24271
..
c8d5338
100644
(file)
--- a/
src/object/block.cpp
+++ b/
src/object/block.cpp
@@
-29,7
+29,6
@@
static const float BOUNCY_BRICK_MAX_OFFSET = 8;
static const float BOUNCY_BRICK_SPEED = 90;
static const float BOUNCY_BRICK_MAX_OFFSET = 8;
static const float BOUNCY_BRICK_SPEED = 90;
-static const float EPSILON = .0001f;
static const float BUMP_ROTATION_ANGLE = 10;
Block::Block(SpritePtr newsprite) :
static const float BUMP_ROTATION_ANGLE = 10;
Block::Block(SpritePtr newsprite) :
diff --git
a/src/object/bullet.cpp
b/src/object/bullet.cpp
index
46c5260
..
b26bd35
100644
(file)
--- a/
src/object/bullet.cpp
+++ b/
src/object/bullet.cpp
@@
-24,7
+24,6
@@
namespace {
const float BULLET_XM = 600;
namespace {
const float BULLET_XM = 600;
-const float BULLET_STARTING_YM = 0;
}
Bullet::Bullet(const Vector& pos, float xm, int dir, BonusType type_) :
}
Bullet::Bullet(const Vector& pos, float xm, int dir, BonusType type_) :
diff --git
a/src/object/camera.cpp
b/src/object/camera.cpp
index
abca4a7
..
28afe6b
100644
(file)
--- a/
src/object/camera.cpp
+++ b/
src/object/camera.cpp
@@
-230,7
+230,6
@@
Camera::scroll_to(const Vector& goal, float scrolltime)
}
static const float CAMERA_EPSILON = .00001f;
}
static const float CAMERA_EPSILON = .00001f;
-static const float MAX_SPEED_Y = 140;
void
Camera::update(float elapsed_time)
void
Camera::update(float elapsed_time)
diff --git
a/src/object/infoblock.cpp
b/src/object/infoblock.cpp
index
2bbb42f
..
d927f45
100644
(file)
--- a/
src/object/infoblock.cpp
+++ b/
src/object/infoblock.cpp
@@
-25,13
+25,6
@@
#include "video/drawing_context.hpp"
#include "sprite/sprite.hpp"
#include "video/drawing_context.hpp"
#include "sprite/sprite.hpp"
-namespace {
-const float SCROLL_DELAY = 0.5;
-const float SCROLL_DISTANCE = 16;
-const float WIDTH = 400;
-const float HEIGHT = 200;
-}
-
InfoBlock::InfoBlock(const Reader& lisp) :
Block(SpriteManager::current()->create("images/objects/bonus_block/infoblock.sprite")),
message(),
InfoBlock::InfoBlock(const Reader& lisp) :
Block(SpriteManager::current()->create("images/objects/bonus_block/infoblock.sprite")),
message(),
diff --git
a/src/object/player.cpp
b/src/object/player.cpp
index
ab375d7
..
efcc99e
100644
(file)
--- a/
src/object/player.cpp
+++ b/
src/object/player.cpp
@@
-40,7
+40,6
@@
//#define SWIMMING
namespace {
//#define SWIMMING
namespace {
-static const int TILES_FOR_BUTTJUMP = 3;
static const float BUTTJUMP_MIN_VELOCITY_Y = 400.0f;
static const float SHOOTING_TIME = .150f;
static const float BUTTJUMP_MIN_VELOCITY_Y = 400.0f;
static const float SHOOTING_TIME = .150f;
@@
-88,8
+87,6
@@
static const float ICE_ACCELERATION_MULTIPLIER = 0.25f;
/** time of the kick (kicking mriceblock) animation */
static const float KICK_TIME = .3f;
/** time of the kick (kicking mriceblock) animation */
static const float KICK_TIME = .3f;
-/** time of tux cheering (currently unused) */
-static const float CHEER_TIME = 1.0f;
/** if Tux cannot unduck for this long, he will get hurt */
static const float UNDUCK_HURT_TIME = 0.25f;
/** if Tux cannot unduck for this long, he will get hurt */
static const float UNDUCK_HURT_TIME = 0.25f;
diff --git
a/src/supertux/savegame.cpp
b/src/supertux/savegame.cpp
index
df484ec
..
b181901
100644
(file)
--- a/
src/supertux/savegame.cpp
+++ b/
src/supertux/savegame.cpp
@@
-17,6
+17,8
@@
#include "supertux/savegame.hpp"
#include "supertux/savegame.hpp"
+#include <algorithm>
+
#include "lisp/lisp.hpp"
#include "lisp/parser.hpp"
#include "lisp/writer.hpp"
#include "lisp/lisp.hpp"
#include "lisp/parser.hpp"
#include "lisp/writer.hpp"
diff --git
a/src/util/utf8_iterator.cpp
b/src/util/utf8_iterator.cpp
index
01234d2
..
fa3b198
100644
(file)
--- a/
src/util/utf8_iterator.cpp
+++ b/
src/util/utf8_iterator.cpp
@@
-94,7
+94,7
@@
UTF8Iterator::UTF8Iterator(const std::string& text_) :
try {
chr = decode_utf8(text, pos);
} catch (std::exception) {
try {
chr = decode_utf8(text, pos);
} catch (std::exception) {
- log_debug << "Malformed utf-8 sequence beginning with " << *(
(const uint32_t*)
(text.c_str() + pos)) << " found " << std::endl;
+ log_debug << "Malformed utf-8 sequence beginning with " << *(
reinterpret_cast<const uint32_t*>
(text.c_str() + pos)) << " found " << std::endl;
chr = 0;
}
}
chr = 0;
}
}
@@
-110,7
+110,7
@@
UTF8Iterator::operator++() {
try {
chr = decode_utf8(text, pos);
} catch (std::exception) {
try {
chr = decode_utf8(text, pos);
} catch (std::exception) {
- log_debug << "Malformed utf-8 sequence beginning with " << *(
(const uint32_t*)
(text.c_str() + pos)) << " found " << std::endl;
+ log_debug << "Malformed utf-8 sequence beginning with " << *(
reinterpret_cast<const uint32_t*>
(text.c_str() + pos)) << " found " << std::endl;
chr = 0;
++pos;
}
chr = 0;
++pos;
}
diff --git
a/src/video/drawing_context.hpp
b/src/video/drawing_context.hpp
index
ef55b8f
..
53e171a
100644
(file)
--- a/
src/video/drawing_context.hpp
+++ b/
src/video/drawing_context.hpp
@@
-30,7
+30,7
@@
#include "video/font_ptr.hpp"
#include "video/texture.hpp"
#include "video/font_ptr.hpp"
#include "video/texture.hpp"
-
class
DrawingRequest;
+
struct
DrawingRequest;
class Surface;
class Texture;
class VideoSystem;
class Surface;
class Texture;
class VideoSystem;
diff --git
a/src/video/gl/gl_painter.hpp
b/src/video/gl/gl_painter.hpp
index
0345e15
..
bb3dd75
100644
(file)
--- a/
src/video/gl/gl_painter.hpp
+++ b/
src/video/gl/gl_painter.hpp
@@
-26,7
+26,7
@@
using namespace gl;
#include "SDL_opengl.h"
#endif
#include "SDL_opengl.h"
#endif
-
class
DrawingRequest;
+
struct
DrawingRequest;
class GLPainter
{
class GLPainter
{
diff --git
a/src/video/gl/gl_texture.cpp
b/src/video/gl/gl_texture.cpp
index
3a6d18f
..
443fa01
100644
(file)
--- a/
src/video/gl/gl_texture.cpp
+++ b/
src/video/gl/gl_texture.cpp
@@
-23,10
+23,12
@@
namespace {
namespace {
+#ifdef GL_VERSION_ES_CM_1_0
inline bool is_power_of_2(int v)
{
return (v & (v-1)) == 0;
}
inline bool is_power_of_2(int v)
{
return (v & (v-1)) == 0;
}
+#endif
inline int next_power_of_two(int val)
{
inline int next_power_of_two(int val)
{