diff --git a/platform/macosx/love-framework.xcodeproj/project.pbxproj b/platform/macosx/love-framework.xcodeproj/project.pbxproj index 84e5457de..352ad4137 100644 --- a/platform/macosx/love-framework.xcodeproj/project.pbxproj +++ b/platform/macosx/love-framework.xcodeproj/project.pbxproj @@ -2345,11 +2345,16 @@ ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; DEAD_CODE_STRIPPING = YES; FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; GCC_OPTIMIZATION_LEVEL = 3; GCC_PREPROCESSOR_DEFINITIONS = LOVE_MACOSX_USE_FRAMEWORKS; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; @@ -2381,11 +2386,16 @@ ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = LOVE_MACOSX_USE_FRAMEWORKS; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; @@ -2417,11 +2427,16 @@ ARCHS = "$(ARCHS_STANDARD_64_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; DEAD_CODE_STRIPPING = YES; FRAMEWORK_SEARCH_PATHS = /Library/Frameworks; GCC_OPTIMIZATION_LEVEL = 3; GCC_PREPROCESSOR_DEFINITIONS = LOVE_MACOSX_USE_FRAMEWORKS; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; diff --git a/src/modules/audio/openal/Source.cpp b/src/modules/audio/openal/Source.cpp index 237cf02b1..e9ef1a434 100644 --- a/src/modules/audio/openal/Source.cpp +++ b/src/modules/audio/openal/Source.cpp @@ -468,8 +468,8 @@ void Source::getDirection(float *v) const void Source::setCone(float innerAngle, float outerAngle, float outerVolume) { - cone.innerAngle = LOVE_TODEG(innerAngle); - cone.outerAngle = LOVE_TODEG(outerAngle); + cone.innerAngle = (int) LOVE_TODEG(innerAngle); + cone.outerAngle = (int) LOVE_TODEG(outerAngle); cone.outerVolume = outerVolume; if (valid) diff --git a/src/modules/math/MathModule.cpp b/src/modules/math/MathModule.cpp index ed096ebd7..2f92bf075 100644 --- a/src/modules/math/MathModule.cpp +++ b/src/modules/math/MathModule.cpp @@ -198,14 +198,14 @@ bool Math::isConvex(const std::vector &polygon) **/ float Math::gammaToLinear(float c) const { - if (c > 1.0) - return 1.0; - else if (c < 0.0) - return 0.0; + if (c > 1.0f) + return 1.0f; + else if (c < 0.0f) + return 0.0f; else if (c <= 0.04045) - return c / 12.92; + return c / 12.92f; else - return powf((c + 0.055) / 1.055, 2.4); + return powf((c + 0.055f) / 1.055f, 2.4f); } /** @@ -213,14 +213,14 @@ float Math::gammaToLinear(float c) const **/ float Math::linearToGamma(float c) const { - if (c > 1.0) - return 1.0; - else if (c < 0.0) - return 0.0; - else if (c < 0.0031308) - return c * 12.92; + if (c > 1.0f) + return 1.0f; + else if (c < 0.0f) + return 0.0f; + else if (c < 0.0031308f) + return c * 12.92f; else - return 1.055 * powf(c, 0.41666) - 0.055; + return 1.055f * powf(c, 0.41666f) - 0.055f; } } // math diff --git a/src/modules/math/wrap_Math.cpp b/src/modules/math/wrap_Math.cpp index 50b78f956..093f30e42 100644 --- a/src/modules/math/wrap_Math.cpp +++ b/src/modules/math/wrap_Math.cpp @@ -259,7 +259,7 @@ static int getGammaArgs(lua_State *L, float color[4]) for (int i = 1; i <= n && i <= 4; i++) { lua_rawgeti(L, 1, i); - color[i - 1] = (float) luaL_checknumber(L, -1) / 255.0; + color[i - 1] = (float) luaL_checknumber(L, -1) / 255.0f; numcomponents++; } @@ -270,7 +270,7 @@ static int getGammaArgs(lua_State *L, float color[4]) int n = lua_gettop(L); for (int i = 1; i <= n && i <= 4; i++) { - color[i - 1] = (float) luaL_checknumber(L, i) / 255.0; + color[i - 1] = (float) luaL_checknumber(L, i) / 255.0f; numcomponents++; } } diff --git a/src/modules/physics/box2d/Fixture.cpp b/src/modules/physics/box2d/Fixture.cpp index 9b80ef222..9d5b8f6f1 100644 --- a/src/modules/physics/box2d/Fixture.cpp +++ b/src/modules/physics/box2d/Fixture.cpp @@ -202,7 +202,7 @@ uint16 Fixture::getBits(lua_State *L) { size_t bpos = (size_t)(lua_tointeger(L, i)-1); if (bpos >= 16) - return luaL_error(L, "Values must be in range 1-16."); + luaL_error(L, "Values must be in range 1-16."); b.set(bpos, true); } diff --git a/src/scripts/auto.lua b/src/scripts/auto.lua index 5d027e339..dbd8c6bd6 100644 --- a/src/scripts/auto.lua +++ b/src/scripts/auto.lua @@ -34,7 +34,8 @@ const unsigned char %s[] = { %s }; // [%s] -} // love]] +} // love +]] --formatting parameters: -- - input file name -- - c variable name diff --git a/src/scripts/boot.lua.h b/src/scripts/boot.lua.h index 5e6f539ad..0c2b2712b 100644 --- a/src/scripts/boot.lua.h +++ b/src/scripts/boot.lua.h @@ -5388,4 +5388,4 @@ const unsigned char boot_lua[] = 0x65, 0x74, 0x76, 0x61, 0x6c, 0x29, 0x20, 0x6f, 0x72, 0x20, 0x30, 0x0a, 0x65, 0x6e, 0x64, 0x0a, }; // [boot.lua] -} // love \ No newline at end of file +} // love diff --git a/src/scripts/graphics.lua.h b/src/scripts/graphics.lua.h index b89461c99..461742872 100644 --- a/src/scripts/graphics.lua.h +++ b/src/scripts/graphics.lua.h @@ -6626,4 +6626,4 @@ const unsigned char graphics_lua[] = 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x65, 0x6e, 0x64, 0x0a, }; // [graphics.lua] -} // love \ No newline at end of file +} // love