Closed edward-san closed 7 years ago
Yeah, now the left warnings are these:
/home/edward-san/zdoom/slade/src/SImageFormats.cpp:487:19: warning: taking the absolute value of unsigned type 'const uint8_t' (aka 'const unsigned char') has no effect [-Wabsolute-value]
width = ofs[5] + abs(ofs[3]);
^
/home/edward-san/zdoom/slade/src/SImageFormats.cpp:487:19: note: remove the call to 'abs' since unsigned values cannot be negative
width = ofs[5] + abs(ofs[3]);
^~~
1 warning generated.
/home/edward-san/zdoom/slade/src/Conversions.cpp:494:61: warning: '&&' within '||' [-Wlogical-op-parentheses]
if (mc.getSize() < 22 || mc.getSize() > 29 || (mc[12] != 1 && mc[12] != 5 || mc[mc.getSize()-1] != 0))
~~~~~~~~~~~~^~~~~~~~~~~~~~ ~~
/home/edward-san/zdoom/slade/src/Conversions.cpp:494:61: note: place parentheses around the '&&' expression to silence this warning
if (mc.getSize() < 22 || mc.getSize() > 29 || (mc[12] != 1 && mc[12] != 5 || mc[mc.getSize()-1] != 0))
^
( )
1 warning generated.
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:151:19: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant A, 2<B0> Observer", "Illuminant A, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:151:49: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant A, 2<B0> Observer", "Illuminant A, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:152:19: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant C, 2<B0> Observer", "Illuminant C, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:152:49: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant C, 2<B0> Observer", "Illuminant C, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:153:21: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant D50, 2<B0> Observer", "Illuminant D50, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:153:53: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant D50, 2<B0> Observer", "Illuminant D50, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:154:21: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant D60, 2<B0> Observer", "Illuminant D60, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:154:53: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant D60, 2<B0> Observer", "Illuminant D60, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:155:21: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant D65, 2<B0> Observer", "Illuminant D65, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:155:53: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant D65, 2<B0> Observer", "Illuminant D65, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:156:21: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant D75, 2<B0> Observer", "Illuminant D75, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:156:53: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant D75, 2<B0> Observer", "Illuminant D75, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:157:20: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant F2, 2<B0> Observer", "Illuminant F2, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:157:51: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant F2, 2<B0> Observer", "Illuminant F2, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:158:21: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant TL4, 2<B0> Observer", "Illuminant TL4, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:158:53: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant TL4, 2<B0> Observer", "Illuminant TL4, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:159:24: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant UL3000, 2<B0> Observer", "Illuminant UL3000, 10<B0> Observer",
^~~~
/home/edward-san/zdoom/slade/src/Dialogs/Preferences/ColorimetryPrefsPanel.cpp:159:59: warning: illegal character encoding in string literal [-Winvalid-source-encoding]
"Illuminant UL3000, 2<B0> Observer", "Illuminant UL3000, 10<B0> Observer",
^~~~
though there are some other warnings which got out with -Wall
and -Wextra
I'd like to show ASAP.
Ok all but one should be fixed now, and that one is Gez's (i think) code, I'm not sure what the logic there is specifically meant to be so I'm leaving it for now
Other warnings with more options:
/home/edward-san/zdoom/slade/src/zreaders/files.cpp:48:39: warning: field 'CloseOnDestruct' will be initialized after field 'Status' [-Wreorder]
: File(NULL), Length(0), StartPos(0), CloseOnDestruct(false), Status(0), Message("OK")
^
/home/edward-san/zdoom/slade/src/zreaders/files.cpp:53:37: warning: field 'CloseOnDestruct' will be initialized after field 'Status' [-Wreorder]
: File(other.File), Length(length), CloseOnDestruct(false), Status(other.Status), Message(other.Message)
^
/home/edward-san/zdoom/slade/src/zreaders/files.cpp:59:51: warning: field 'CloseOnDestruct' will be initialized after field 'Status' [-Wreorder]
: File(NULL), Length(0), StartPos(0), FilePos(0), CloseOnDestruct(false), Status(0), Message("OK")
^
/home/edward-san/zdoom/slade/src/zreaders/files.cpp:69:51: warning: field 'CloseOnDestruct' will be initialized after field 'Status' [-Wreorder]
: File(file), Length(0), StartPos(0), FilePos(0), CloseOnDestruct(false), Status(0), Message("OK")
^
/home/edward-san/zdoom/slade/src/zreaders/files.cpp:75:31: warning: field 'CloseOnDestruct' will be initialized after field 'Status' [-Wreorder]
: File(file), Length(length), CloseOnDestruct(true), Status(0), Message("OK")
^
/home/edward-san/zdoom/slade/src/zreaders/files.cpp:360:48: warning: explicitly assigning value of variable of type 'void *' to itself [-Wself-assign]
static void *SzAlloc(void *p, size_t size) { p = p; return malloc(size); }
~ ^ ~
/home/edward-san/zdoom/slade/src/zreaders/files.cpp:361:48: warning: explicitly assigning value of variable of type 'void *' to itself [-Wself-assign]
static void SzFree(void *p, void *address) { p = p; free(address); }
~ ^ ~
/home/edward-san/zdoom/slade/src/MapCanvas.cpp:1938:4: warning: delete called on 'MCAnimation' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
delete animations[a];
^
/home/edward-san/zdoom/slade/src/MapCanvas.cpp:2408:25: warning: delete called on 'MCOverlay' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
if (overlay_current) delete overlay_current;
^
/home/edward-san/zdoom/slade/src/MapCanvas.cpp:3136:27: warning: delete called on 'MCOverlay' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
if (overlay_current) delete overlay_current;
^
/home/edward-san/zdoom/slade/src/MapCanvas.cpp:3306:25: warning: delete called on 'MCOverlay' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
if (overlay_current) delete overlay_current;
^
/home/edward-san/zdoom/slade/src/MapCanvas.cpp:3601:25: warning: delete called on 'MCOverlay' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
if (overlay_current) delete overlay_current;
^
/home/edward-san/zdoom/slade/src/CTexture.cpp:428:3: warning: delete called on 'CTPatch' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
delete patches[a];
^
/home/edward-san/zdoom/slade/src/CTexture.cpp:548:3: warning: delete called on 'CTPatch' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
delete patches[a];
^
/home/edward-san/zdoom/slade/src/CTexture.cpp:590:2: warning: delete called on 'CTPatch' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
delete patches[index];
^
/home/edward-san/zdoom/slade/src/CTexture.cpp:615:4: warning: delete called on 'CTPatch' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
delete (*i);
^
/home/edward-san/zdoom/slade/src/CTexture.cpp:892:3: warning: delete called on 'CTPatch' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
delete patches[a];
^
/home/edward-san/zdoom/slade/src/CTexture.cpp:925:3: warning: delete called on 'CTPatch' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
delete patches[a];
^
/home/edward-san/zdoom/slade/src/BrowserWindow.cpp:73:3: warning: delete called on 'BrowserItem' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
delete items[a];
^
/home/edward-san/zdoom/slade/src/Translation.cpp:59:3: warning: delete called on 'TransRange' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
delete translations[a];
^
/home/edward-san/zdoom/slade/src/Translation.cpp:286:3: warning: delete called on 'TransRange' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
delete translations[a];
^
/home/edward-san/zdoom/slade/src/Translation.cpp:359:2: warning: delete called on 'TransRange' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
delete translations[pos];
^
/home/edward-san/zdoom/slade/src/EntryOperations.cpp:624:23: warning: suggest braces around initialization of subobject [-Wmissing-braces]
alph_chunk_t gc = { 'a', 'l', 'P', 'h' };
^~~~~~~~~~~~~~~~~~
{ }
/home/edward-san/zdoom/slade/src/EntryOperations.cpp:747:24: warning: suggest braces around initialization of subobject [-Wmissing-braces]
trans_chunk_t gc = { 't', 'R', 'N', 'S', '\0' };
^~~~~~~~~~~~~~~~~~~~~~~~
{ }
/home/edward-san/zdoom/slade/src/BrowserCanvas.cpp:512:15: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
if (++index == items_filter.size() && !looped)
~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~
1 warning generated.
/home/edward-san/zdoom/slade/src/SImageFormats.cpp:236:11: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
if (size < sizeof(Font2Header))
~~~~ ^ ~~~~~~~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/Conversions.cpp:689:33: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
((READ_B32(in, 4) + 8) != size))
~~~~~~~~~~~~~~~~~~~ ^ ~~~~
/home/edward-san/zdoom/slade/src/GameConfiguration.cpp:1195:29: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
if (flags_line[f].flag == flag_val)
~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~
/home/edward-san/zdoom/slade/src/TarArchive.cpp:178:41: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
return (checksum == sigsum || checksum == unssum);
~~~~~~~~ ^ ~~~~~~
/home/edward-san/zdoom/slade/src/./AudioFormats.h:177:35: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
((READ_B32(mc, 4) + 8) == mc.getSize()))
~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/./AudioFormats.h:409:21: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
if (mc.getSize() == 4 + READ_L16(mc, 2))
~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/./ImageFormats.h:47:25: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
if (READ_L32(mc, 2) == mc.getSize() && READ_L32(mc, 6) == 0)
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/./ImageFormats.h:1300:47: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
if ((4 + (READ_L16(mc, 0)*READ_L16(mc, 2))) != mc.getSize())
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/./ImageFormats.h:1380:27: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
if (READ_L32(mc, 44) != size - 32)
~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~
/home/edward-san/zdoom/slade/src/ArchiveManager.cpp:860:12: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare]
if (index == base_resource)
~~~~~ ^ ~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/DatArchive.cpp:722:12: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'wxFileOffset' (aka 'long') [-Wsign-compare]
if (start > file.Length())
~~~~~ ^ ~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/DatArchive.cpp:729:27: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'wxFileOffset' (aka 'long') [-Wsign-compare]
for (size_t i = start; i < file.Length(); ++i, ++len)
~ ^ ~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/Misc.cpp:681:13: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
if (offset != 4 * numtex + 4)
~~~~~~ ^ ~~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/TextureXEditor.cpp:623:44: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
if (index < tabs->GetPageCount() && index != tabs->GetSelection())
~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/ArchivePanel.cpp:651:30: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
&& (name.find('\\') != wxNOT_FOUND || name.find('/') != wxNOT_FOUND))
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/ArchivePanel.cpp:651:63: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
&& (name.find('\\') != wxNOT_FOUND || name.find('/') != wxNOT_FOUND))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/MapEditor.cpp:3674:68: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
if (selection_3d[s].type == item.type && selection_3d[s].index == osector->getIndex())
~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/MapEditor.cpp:4032:27: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
if (walls_done[a].index == side->getIndex())
~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/SToolBar.cpp:697:21: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
else if (e.GetId() == groups.size())
~~~~~~~~~ ^ ~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/./SIFOther.h:280:22: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
if (data.getSize() != width * height + SCWALLOFFSET)
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/./SIFOther.h:690:22: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
if (data.getSize() != 4 + info.width*info.height)
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/./SIFRott.h:321:22: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
if (data.getSize() != 4 + info.width*info.height)
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/SIFormat.cpp:271:30: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
if (valid_flat_size[a][0] == width && valid_flat_size[a][1] == height
~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~
/home/edward-san/zdoom/slade/src/SIFormat.cpp:271:64: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
if (valid_flat_size[a][0] == width && valid_flat_size[a][1] == height
~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~
/home/edward-san/zdoom/slade/src/SIFormat.cpp:440:25: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
if (image.getWidth() == valid_flat_size[a][0] &&
~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/SIFormat.cpp:441:30: warning: comparison of integers of different signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
image.getHeight() == valid_flat_size[a][1])
~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/EntryOperations.cpp:1558:11: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
if (crc != READ_B32(data, pointer + 8 + chsz))
~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/UndoRedo.cpp:290:26: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
if (current_level_index == undo_levels.size() - 1 || undo_levels.size() == 0)
~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/WadArchive.cpp:722:44: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
if (name.length() <= 8 && name.find('\\') != wxNOT_FOUND)
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/EntryType.cpp:218:25: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'value_type' (aka 'int') [-Wsign-compare]
if (entry->getSize() == match_size[a])
~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~
/home/edward-san/zdoom/slade/src/MapRenderer2D.cpp:213:44: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
if (list_vertices > 0 && map->nVertices() == n_vertices && map->geometryUpdated() <= vertices_updated)
~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~
/home/edward-san/zdoom/slade/src/MapRenderer2D.cpp:242:44: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
if (vbo_vertices == 0 || map->nVertices() != n_vertices || map->geometryUpdated() > vertices_updated)
~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~
/home/edward-san/zdoom/slade/src/MapRenderer2D.cpp:396:17: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
map->nLines() == n_lines &&
~~~~~~~~~~~~~ ^ ~~~~~~~
/home/edward-san/zdoom/slade/src/MapRenderer2D.cpp:464:17: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
map->nLines() != n_lines ||
~~~~~~~~~~~~~ ^ ~~~~~~~
/home/edward-san/zdoom/slade/src/GZipArchive.cpp:522:40: warning: comparison of integers of different signs: 'wxFileOffset' (aka 'long') and 'size_t' (aka 'unsigned long') [-Wsign-compare]
if (!file.IsOpened() || file.Length() < mds)
~~~~~~~~~~~~~ ^ ~~~
/home/edward-san/zdoom/slade/src/TextureXPanel.cpp:709:20: warning: comparison of integers of different signs: 'value_type' (aka 'long') and 'unsigned long' [-Wsign-compare]
if (selection[i] != itr->second)
~~~~~~~~~~~~ ^ ~~~~~~~~~~~
Hi. I got these warnings when I compile slade:
1)
Was that call needed because the value should be in the
[0,127]
range? Sinceofs
is unsigned char, its value is in the[0,255]
range, and when converted toint
, the range is not touched, soabs
will return in the[0, 255]
range.2)
The function
abs
has parameterint
and returnsint
, so the argument in these calls will be converted toint
and hence lose the decimals, therefore the returned value can't have the lost decimals. You can usestd::abs
orfabs
.3)
The macro
LOG_MESSAGE
contains anif
and noelse
, hence theelse
here is referred to the conditionGlobal::log_verbosity >= level
, thereforefiles_written.push_back(path);
would be executed when the condition!entries[a]->exportFile(path)
is true... very dangerous.4)
It's not clear which logic order should have these mixed conditions, so the parentheses are needed, in order to clarify if
||
must be checked before or after&&
(for example, I'm sure thatif (key == "F" || key == "f" && side1)
can be written asif ((key == "F" || key == "f") && side1)
, becausekey
must be case insensitive).5)
Since the file in question is encoded in ISO-8859,
°
is not a valid character inside a string, hence when I open the menu Graphics->Colorimetry, the CIE Lab Tristimulus option has invisible string values. Replacing any instance of°
with\xc2\xb0
in these strings and enclosing them inwxString::FromUTF8()
fixes the problem for me.6)
If you assign something and this must be
NULL
checked, enclose the assignment in another parenthesis.7)
No idea why this was written like that. Maybe it's really unused and hence it needs
(void)
?8)
Apparently these functions are similar to some virtual functions in some base classes for their name, but it's not clear if these were intended to override them or not, because of the mismatching number of parameters.
9)
This can be fixed by swapping
name
andvalue
member definitions inside thearg_val_t
class.10)
That sounds like a big mistake, because a
char
can be negative in suitable platforms, hence there's a potential read of garbage data before the array region.