Closed
Bug 556559
Opened 14 years ago
Closed 14 years ago
Fix warnings in TestTArray.cpp - "warning: comparison between signed and unsigned integer expressions"
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: dholbert, Assigned: dholbert)
Details
(Whiteboard: [build_warning])
Attachments
(1 file)
2.01 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
{
> TestTArray.cpp: In function 'PRBool TestTArray::test_string_array()':
> TestTArray.cpp:318: warning: comparison between signed and unsigned integer expressions
> TestTArray.cpp: In function 'PRBool TestTArray::test_indexof()':
> TestTArray.cpp:521: warning: comparison between signed and unsigned integer expressions
> TestTArray.cpp: In function 'PRBool TestTArray::test_basic_array(ElementType*, PRUint32, const ElementType&) [with ElementType = int]':
> TestTArray.cpp:175: instantiated from here
> TestTArray.cpp:105: warning: comparison between signed and unsigned integer expressions
> TestTArray.cpp: In function 'PRBool TestTArray::test_basic_array(ElementType*, PRUint32, const ElementType&) [with ElementType = PRInt64]':
> TestTArray.cpp:180: instantiated from here
> TestTArray.cpp:105: warning: comparison between signed and unsigned integer expressions
> TestTArray.cpp: In function 'PRBool TestTArray::test_basic_array(ElementType*, PRUint32, const ElementType&) [with ElementType = char]':
> TestTArray.cpp:185: instantiated from here
> TestTArray.cpp:105: warning: comparison between signed and unsigned integer expressions
> TestTArray.cpp: In function 'PRBool TestTArray::test_basic_array(ElementType*, PRUint32, const ElementType&) [with ElementType = PRUint32]':
> TestTArray.cpp:190: instantiated from here
> TestTArray.cpp:105: warning: comparison between signed and unsigned integer expressions
> TestTArray.cpp: In function 'PRBool TestTArray::test_basic_array(ElementType*, PRUint32, const ElementType&) [with ElementType = nsCString]':
> TestTArray.cpp:325: instantiated from here
> TestTArray.cpp:105: warning: comparison between signed and unsigned integer expressions
> TestTArray.cpp: In function 'PRBool TestTArray::test_basic_array(ElementType*, PRUint32, const ElementType&) [with ElementType = nsCOMPtr<nsIFile>]':
> TestTArray.cpp:366: instantiated from here
> TestTArray.cpp:105: warning: comparison between signed and unsigned integer expressions
}
This is due to lines like:
{
318 if (strArray.BinaryIndexOf(EmptyCString()) != -1)
319 return PR_FALSE;
}
Note that BinaryIndexOf returns an unsigned value. We should be comparing it against nsTArray::NoIndex instead of -1.
Assignee | ||
Comment 1•14 years ago
|
||
Updated•14 years ago
|
Attachment #436524 -
Flags: review?(benjamin) → review+
Assignee | ||
Comment 2•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/ccce7bebe7d9
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•14 years ago
|
Whiteboard: [build_warning]
You need to log in
before you can comment on or make changes to this bug.
Description
•