Closed
Bug 822804
Opened 12 years ago
Closed 12 years ago
GfxDriverInfo.h:156: warning: comparison between signed and unsigned integer expressions
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: dholbert, Assigned: dholbert)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.09 KB,
patch
|
bas.schouten
:
review+
|
Details | Diff | Splinter Review |
Just hit these build warnings while building B2G:
{
In file included from gecko/widget/xpwidgets/GfxDriverInfo.cpp:7:
gecko/widget/xpwidgets/GfxDriverInfo.h: In function 'bool mozilla::widget::SplitDriverVersion(const char*, char*, char*, char*, char*)':
gecko/widget/xpwidgets/GfxDriverInfo.h:156: warning: comparison between signed and unsigned integer expressions
gecko/widget/xpwidgets/GfxDriverInfo.h:179: warning: comparison between signed and unsigned integer expressions
}
This is for the variable "int destIdx", which is initialized to 0 and then incremented from there (and never modified in any other way). Looks like it can just be an unsigned variable.
Assignee | ||
Comment 1•12 years ago
|
||
This fixes it.
Technically we only need destIdx to be unsigned to fix the warning -- but for consistency, I tweaked destPos, too, since it's used the same way (set to 0, incremented from there) and is declared right next to destIdx.
Here's the chunk of code in MXR, for reference:
https://mxr.mozilla.org/mozilla-central/source/widget/xpwidgets/GfxDriverInfo.h#152
Assignee | ||
Comment 2•12 years ago
|
||
(I'm pretty sure "len" and "i" can also be unsigned, or perhaps size_t, because strlen returns size_t. I'm happy to change those, too, but I left them as-is for now to keep the patch minimal, & since "len" and "i" aren't not causing problems.)
Assignee | ||
Comment 3•12 years ago
|
||
er s/aren't not/aren't/ :)
Updated•12 years ago
|
Attachment #693583 -
Flags: review?(bas) → review+
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 4•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in
before you can comment on or make changes to this bug.
Description
•