monkeyman
2007-12-16, 06:15
I've looked through all the warnings that GCC generates when compiling the current SVN for the linuxport with the -Wall flag set.
The following warnings can be fixed with very little effort:
GUIFont.cpp:51: warning: unused variable ‘nw’
GUIFont.cpp:51: warning: unused variable ‘nh’
GUIWindowVideoNav.cpp:1052: warning: unused variable ‘bDownload’
GUITextBox.cpp:483: warning: unused variable ‘size’
These variables look like they can be safely deleted.
FileCache.h:57:2: warning: no newline at end of file
Platinum/Source/Core/PltService.cpp:685:2: warning: no newline at end of file
Just add a newline at the end of the files.
VideoDatabase.cpp:3790: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long unsigned int’
VideoDatabase.cpp:3881: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long unsigned int’
These should be probably be "%lu" instead of "%d".
XBMChttp.cpp:2350: warning: control reaches end of non-void function
It doesn't really, maybe just return 0 or something to shut up gcc?
In UnrarXlib:
file.cpp: In member function ‘Int64 File::Tell()’:
file.cpp:501: warning: unused variable ‘HighDist’
file.cpp:503: warning: unused variable ‘pos’
Both HighDist and pos should be commented out as well.
file.cpp:8: warning: ‘CreatedFiles’ defined but not used
This is only referenced from commented out code, it should be commented out as well.
filefn.cpp:111: warning: unused variable ‘sm’
filefn.cpp:112: warning: unused variable ‘sc’
filefn.cpp:113: warning: unused variable ‘sa’
sm, sc, and sa should be inside the _WIN_32 ifdef since they're only referenced from there.
Thread.cpp:97: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 4 has type ‘Uint32’
I think "%lu" should be "%d", but I'm not sure since it's a custom type.
pathfn.cpp:8: warning: unused variable ‘Found’
This should probably be commented out as well.
rar.cpp:349: warning: unused variable ‘TitleShown’
rar.cpp:346: warning: unused variable ‘TotalPackSize’
rar.cpp:346: warning: unused variable ‘TotalUnpSize’
rar.cpp:339: warning: unused variable ‘FileMatched’
rar.cpp:479: warning: unused variable ‘pPrev’
rar.cpp:480: warning: unused variable ‘TitleShown’
rar.cpp:473: warning: unused variable ‘FileMatched’
rar.cpp:475: warning: unused variable ‘TotalPackSize’
rar.cpp:475: warning: unused variable ‘TotalUnpSize’
None of these are ever used.
DVDOverlayRenderer.cpp:56: warning: unused variable ‘ey’
DVDOverlayRenderer.cpp:57: warning: unused variable ‘er’
Neither are mentioned again in the function.
winxml.cpp:157: warning: unused variable ‘bRefresh’
CDDARipper.cpp:204: warning: unused variable ‘iTrack’
Never used.
EncoderWav.cpp:75: warning: passing NULL to non-pointer argument 2 of ‘DWORD SetFilePointer(CXHandle*, LONG, LONG*, DWORD)’
SetFilePointer(m_hFile, NULL, NULL, FILE_BEGIN);
Should probably read:
SetFilePointer(m_hFile, 0, NULL, FILE_BEGIN);
These are all pretty trivial, so I doubt any developers will care that much about them. However, fixing/silencing these may make finding "real" warnings easier.
The following warnings can be fixed with very little effort:
GUIFont.cpp:51: warning: unused variable ‘nw’
GUIFont.cpp:51: warning: unused variable ‘nh’
GUIWindowVideoNav.cpp:1052: warning: unused variable ‘bDownload’
GUITextBox.cpp:483: warning: unused variable ‘size’
These variables look like they can be safely deleted.
FileCache.h:57:2: warning: no newline at end of file
Platinum/Source/Core/PltService.cpp:685:2: warning: no newline at end of file
Just add a newline at the end of the files.
VideoDatabase.cpp:3790: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long unsigned int’
VideoDatabase.cpp:3881: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long unsigned int’
These should be probably be "%lu" instead of "%d".
XBMChttp.cpp:2350: warning: control reaches end of non-void function
It doesn't really, maybe just return 0 or something to shut up gcc?
In UnrarXlib:
file.cpp: In member function ‘Int64 File::Tell()’:
file.cpp:501: warning: unused variable ‘HighDist’
file.cpp:503: warning: unused variable ‘pos’
Both HighDist and pos should be commented out as well.
file.cpp:8: warning: ‘CreatedFiles’ defined but not used
This is only referenced from commented out code, it should be commented out as well.
filefn.cpp:111: warning: unused variable ‘sm’
filefn.cpp:112: warning: unused variable ‘sc’
filefn.cpp:113: warning: unused variable ‘sa’
sm, sc, and sa should be inside the _WIN_32 ifdef since they're only referenced from there.
Thread.cpp:97: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 4 has type ‘Uint32’
I think "%lu" should be "%d", but I'm not sure since it's a custom type.
pathfn.cpp:8: warning: unused variable ‘Found’
This should probably be commented out as well.
rar.cpp:349: warning: unused variable ‘TitleShown’
rar.cpp:346: warning: unused variable ‘TotalPackSize’
rar.cpp:346: warning: unused variable ‘TotalUnpSize’
rar.cpp:339: warning: unused variable ‘FileMatched’
rar.cpp:479: warning: unused variable ‘pPrev’
rar.cpp:480: warning: unused variable ‘TitleShown’
rar.cpp:473: warning: unused variable ‘FileMatched’
rar.cpp:475: warning: unused variable ‘TotalPackSize’
rar.cpp:475: warning: unused variable ‘TotalUnpSize’
None of these are ever used.
DVDOverlayRenderer.cpp:56: warning: unused variable ‘ey’
DVDOverlayRenderer.cpp:57: warning: unused variable ‘er’
Neither are mentioned again in the function.
winxml.cpp:157: warning: unused variable ‘bRefresh’
CDDARipper.cpp:204: warning: unused variable ‘iTrack’
Never used.
EncoderWav.cpp:75: warning: passing NULL to non-pointer argument 2 of ‘DWORD SetFilePointer(CXHandle*, LONG, LONG*, DWORD)’
SetFilePointer(m_hFile, NULL, NULL, FILE_BEGIN);
Should probably read:
SetFilePointer(m_hFile, 0, NULL, FILE_BEGIN);
These are all pretty trivial, so I doubt any developers will care that much about them. However, fixing/silencing these may make finding "real" warnings easier.