Opened 15 years ago

Closed 15 years ago

#269 closed defect (fixed)

Compile warnings: printf formats, unsigned/signed comparisons, etc

Reported by: Simon Brenner Owned by:
Priority: Nice to Have Milestone:
Component: Core engine Keywords:
Cc: Patch:

Description

Basically this:

NetClient.cpp
../../../source/network/NetClient.cpp: In static member function 'static bool CNetClient::OnError(void*, CFsmEvent*)':
../../../source/network/NetClient.cpp:253: warning: comparison between signed and unsigned integer expressions
../../../source/network/NetClient.cpp: In static member function 'static bool CNetClient::OnAuthenticate(void*, CFsmEvent*)':
../../../source/network/NetClient.cpp:367: warning: comparison between signed and unsigned integer expressions
NetServer.cpp
../../../source/network/NetServer.cpp: In static member function 'static bool CNetServer::OnError(void*, CFsmEvent*)':
../../../source/network/NetServer.cpp:395: warning: comparison between signed and unsigned integer expressions
Util.cpp
../../../source/ps/Util.cpp: In function 'void WriteSystemInfo()':
../../../source/ps/Util.cpp:96: warning: format '%d' expects type 'int', but argument 5 has type 'size_t'
../../../source/ps/Util.cpp:96: warning: format '%d' expects type 'int', but argument 6 has type 'size_t'
../../../source/ps/Util.cpp:96: warning: format '%d' expects type 'int', but argument 7 has type 'size_t'
../../../source/ps/Util.cpp:109: warning: format '%u' expects type 'unsigned int', but argument 3 has type 'size_t'
../../../source/ps/Util.cpp:109: warning: format '%u' expects type 'unsigned int', but argument 4 has type 'size_t'
CLogger.cpp
../../../source/ps/CLogger.cpp:171: warning: unused parameter 'category'
../../../source/ps/CLogger.cpp:188: warning: unused parameter 'category'
Parser.cpp
../../../source/ps/Parser.cpp: In member function 'bool CParserLine::ParseString(const CParser&, const std::string&)':
../../../source/ps/Parser.cpp:557: warning: comparison between signed and unsigned integer expressions
../../../source/ps/Parser.cpp:605: warning: comparison between signed and unsigned integer expressions
../../../source/ps/Parser.cpp:657: warning: comparison between signed and unsigned integer expressions
../../../source/ps/Parser.cpp:793: warning: comparison between signed and unsigned integer expressions
EntityManager.cpp
../../../source/simulation/EntityManager.cpp: In member function 'HEntity CEntityManager::Create(CEntityTemplate*, CVector3D, float, const std::set<CStr8, std::less<CStr8>, std::allocator<CStr8> >&, const CStrW*)':
../../../source/simulation/EntityManager.cpp:225: warning: comparison between signed and unsigned integer expressions
ScriptGlue.cpp
../../../source/scripting/ScriptGlue.cpp: In function 'void InitJsTimers()':
../../../source/scripting/ScriptGlue.cpp:648: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
Terrain.cpp
../../../source/graphics/Terrain.cpp: In member function 'void CTerrain::Resize(ssize_t)':
../../../source/graphics/Terrain.cpp:368: warning: comparison between signed and unsigned integer expressions
Renderer.cpp
../../../source/renderer/Renderer.cpp: In member function 'virtual CStr8 CRendererStatsTable::GetCellText(size_t, size_t)':
../../../source/renderer/Renderer.cpp:152: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
../../../source/renderer/Renderer.cpp:152: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
../../../source/renderer/Renderer.cpp:158: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
../../../source/renderer/Renderer.cpp:158: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
../../../source/renderer/Renderer.cpp:164: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
../../../source/renderer/Renderer.cpp:164: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
../../../source/renderer/Renderer.cpp:170: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
../../../source/renderer/Renderer.cpp:170: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
../../../source/renderer/Renderer.cpp:176: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
../../../source/renderer/Renderer.cpp:176: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int'
WaterManager.cpp
../../../source/renderer/WaterManager.cpp: In member function 'int WaterManager::LoadWaterTextures()':
../../../source/renderer/WaterManager.cpp:114: warning: format '%02d' expects type 'int', but argument 5 has type 'size_t'
../../../source/renderer/WaterManager.cpp:114: warning: format '%02d' expects type 'int', but argument 5 has type 'size_t'
../../../source/renderer/WaterManager.cpp:131: warning: format '%02d' expects type 'int', but argument 5 has type 'size_t'
../../../source/renderer/WaterManager.cpp:131: warning: format '%02d' expects type 'int', but argument 5 has type 'size_t'
MessagePasserImpl.cpp
../../../source/tools/atlas/GameInterface/MessagePasserImpl.cpp: In constructor 'MessagePasserImpl::MessagePasserImpl()':
../../../source/tools/atlas/GameInterface/MessagePasserImpl.cpp:37: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
ldbg.cpp
../../../source/lib/sysdep/os/linux/ldbg.cpp: In function 'void* debug_GetCaller(void*, const char*)':
../../../source/lib/sysdep/os/linux/ldbg.cpp:87: warning: unused variable 'bt_size'
../../../source/lib/sysdep/os/linux/ldbg.cpp: In function 'LibError debug_resolve_symbol_dladdr(void*, char*, char*, int*)':
../../../source/lib/sysdep/os/linux/ldbg.cpp:303: warning: format '%08x' expects type 'unsigned int', but argument 4 has type 'size_t'
../../../source/lib/sysdep/os/linux/ldbg.cpp:303: warning: format '%08x' expects type 'unsigned int', but argument 4 has type 'size_t'
item.cpp
../../../source/tools/atlas/wxJS/gui/control/item.cpp: In static member function 'static bool wxjs::gui::ControlItem::GetProperty(wxjs::Index*, JSContext*, JSObject*, int, jsval*)':
../../../source/tools/atlas/wxJS/gui/control/item.cpp:84: warning: comparison between signed and unsigned integer expressions
../../../source/tools/atlas/wxJS/gui/control/item.cpp: In static member function 'static bool wxjs::gui::ControlItem::SetProperty(wxjs::Index*, JSContext*, JSObject*, int, jsval*)':
../../../source/tools/atlas/wxJS/gui/control/item.cpp:108: warning: comparison between signed and unsigned integer expressions
../../../source/tools/atlas/wxJS/gui/control/item.cpp: In static member function 'static JSBool wxjs::gui::ControlItem::remove(JSContext*, JSObject*, uintN, jsval*, jsval*)':
../../../source/tools/atlas/wxJS/gui/control/item.cpp:145: warning: comparison between signed and unsigned integer expressions
../../../source/tools/atlas/wxJS/gui/control/item.cpp: In static member function 'static JSBool wxjs::gui::ControlItem::select(JSContext*, JSObject*, uintN, jsval*, jsval*)':
../../../source/tools/atlas/wxJS/gui/control/item.cpp:172: warning: comparison between signed and unsigned integer expressions
radioboxit.cpp
../../../source/tools/atlas/wxJS/gui/control/radioboxit.cpp: In static member function 'static bool wxjs::gui::RadioBoxItem::GetProperty(wxjs::Index*, JSContext*, JSObject*, int, jsval*)':
../../../source/tools/atlas/wxJS/gui/control/radioboxit.cpp:68: warning: comparison between signed and unsigned integer expressions
../../../source/tools/atlas/wxJS/gui/control/radioboxit.cpp:79: warning: comparison between signed and unsigned integer expressions
../../../source/tools/atlas/wxJS/gui/control/radioboxit.cpp: In static member function 'static bool wxjs::gui::RadioBoxItem::SetProperty(wxjs::Index*, JSContext*, JSObject*, int, jsval*)':
../../../source/tools/atlas/wxJS/gui/control/radioboxit.cpp:109: warning: comparison between signed and unsigned integer expressions
rect.cpp
../../../source/tools/atlas/wxJS/gui/misc/rect.cpp: In static member function 'static JSBool wxjs::gui::Rect::inside(JSContext*, JSObject*, uintN, jsval*, jsval*)':
../../../source/tools/atlas/wxJS/gui/misc/rect.cpp:464: warning: 'bool wxRect::Inside(int, int) const' is deprecated (declared at /usr/include/wx-2.8/wx/gdicmn.h:490)
../../../source/tools/atlas/wxJS/gui/misc/rect.cpp:477: warning: 'bool wxRect::Inside(const wxPoint&) const' is deprecated (declared at /usr/include/wx-2.8/wx/gdicmn.h:491)
sizer.cpp
../../../source/tools/atlas/wxJS/gui/misc/sizer.cpp: In static member function 'static JSBool wxjs::gui::Sizer::remove(JSContext*, JSObject*, uintN, jsval*, jsval*)':
../../../source/tools/atlas/wxJS/gui/misc/sizer.cpp:534: warning: 'virtual bool wxSizer::Remove(wxWindow*)' is deprecated (declared at /usr/include/wx-2.8/wx/sizer.h:513)
textline.cpp
../../../source/tools/atlas/wxJS/io/textline.cpp: In static member function 'static bool wxjs::io::TextLine::GetProperty(wxjs::Index*, JSContext*, JSObject*, int, jsval*)':
../../../source/tools/atlas/wxJS/io/textline.cpp:102: warning: comparison between signed and unsigned integer expressions
../../../source/tools/atlas/wxJS/io/textline.cpp: In static member function 'static bool wxjs::io::TextLine::SetProperty(wxjs::Index*, JSContext*, JSObject*, int, jsval*)':
../../../source/tools/atlas/wxJS/io/textline.cpp:134: warning: comparison between signed and unsigned integer expressions
../../../source/tools/atlas/wxJS/io/textline.cpp: In static member function 'static bool wxjs::io::TextLine::Enumerate(wxjs::Index*, JSContext*, JSObject*, JSIterateOp, jsval*, jsid*)':
../../../source/tools/atlas/wxJS/io/textline.cpp:186: warning: comparison between signed and unsigned integer expressions
DLLInterface.cpp
In file included from /usr/include/libxml2/libxml/parser.h:15,
from ../../../source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp:42:
/usr/include/libxml2/libxml/xmlversion.h:429:1: warning: "ATTRIBUTE_PRINTF" redefined
In file included from /usr/include/wx-2.8/wx/wxprec.h:13,
from ../../../source/tools/atlas/AtlasUI/Misc/precompiled.h:43,
from ../../../source/tools/atlas/AtlasUI/Misc/precompiled.cpp:18:
/usr/include/wx-2.8/wx/defs.h:501:1: warning: this is the location of the previous definition
Trigger.cpp
../../../source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Trigger/Trigger.cpp:1049: warning: unused parameter 'label'
DLL.cpp
../../../source/collada/DLL.cpp: In member function 'virtual void BufferedOutputCallback::operator()(const char*, unsigned int)':
../../../source/collada/DLL.cpp:78: warning: comparison between signed and unsigned integer expressions
../../../source/collada/DLL.cpp:84: warning: comparison between signed and unsigned integer expressions
test_byte_order.cpp
In file included from ../../../source/lib/self_test.h:190,
from ../../../source/pch/test/precompiled.h:24,
from ../../../source/pch/test/precompiled.cpp:25:
../../../libraries/cxxtest/include/cxxtest/TestSuite.h: In function 'bool CxxTest::equals(X, Y) [with X = long int, Y = long long unsigned int]':
../../../libraries/cxxtest/include/cxxtest/TestSuite.h:56: instantiated from 'void CxxTest::doAssertEquals(const char*, unsigned int, const char*, X, const char*, Y, const char*) [with X = long int, Y = long long unsigned int]'
../../../source/lib/tests/../../../source/lib/tests/test_byte_order.h:83: instantiated from here
../../../libraries/cxxtest/include/cxxtest/TestSuite.h:47: warning: comparison between signed and unsigned integer expressions
test_allocators.cpp
In file included from ../../../source/lib/self_test.h:190,
from ../../../source/pch/test/precompiled.h:24,
from ../../../source/pch/test/precompiled.cpp:25:
../../../libraries/cxxtest/include/cxxtest/TestSuite.h: In function 'bool CxxTest::equals(X, Y) [with X = unsigned int, Y = int]':
../../../libraries/cxxtest/include/cxxtest/TestSuite.h:56: instantiated from 'void CxxTest::doAssertEquals(const char*, unsigned int, const char*, X, const char*, Y, const char*) [with X = unsigned int, Y = int]'
../../../source/pch/test/../../../source/lib/allocators/tests/test_allocators.h:42: instantiated from here
../../../libraries/cxxtest/include/cxxtest/TestSuite.h:47: warning: comparison between signed and unsigned integer expressions

Change History (2)

comment:1 by Philip Taylor, 15 years ago

Some (but not all) of these should be fixed in r7034.

comment:2 by Philip Taylor, 15 years ago

Resolution: fixed
Status: newclosed

The rest should be fixed now too.

Note: See TracTickets for help on using tickets.