Closed Bug 973795 Opened 10 years ago Closed 10 years ago

Fix -Wreorder and -Wsign-compare warnings in nsThreadPool.cpp

Categories

(Core :: XPCOM, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30
Tracking Status
firefox29 --- unaffected
firefox30 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

Attached patch fix-nsThreadPool-warnings.patch (obsolete) — Splinter Review
The following clang warnings were introduced by bug 968016:

xpcom/threads/nsThreadPool.cpp:55:5 [-Wreorder] field 'mStackSize' will be initialized after field 'mIdleCount'

xpcom/threads/nsThreadPool.cpp:259:26 [-Wsign-compare] comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int32_t' (aka 'int')
Attachment #8377410 - Flags: review?(benjamin)
Comment on attachment 8377410 [details] [diff] [review]
fix-nsThreadPool-warnings.patch

Review of attachment 8377410 [details] [diff] [review]:
-----------------------------------------------------------------

::: xpcom/base/nsConsoleService.cpp
@@ +139,5 @@
>      mService->EnumerateListeners(CollectCurrentListeners, &listeners);
>  
>      mService->SetIsDelivering();
>  
> +    for (uint32_t i = 0; i < listeners.Count(); ++i)

Looks like the *adds* a warning: nsCOMArray::Count returns int32_t; nsCOMArray::Length returns uint32_t.
oops, I forgot to hg qrefresh some patch changes.
Attachment #8377410 - Attachment is obsolete: true
Attachment #8377410 - Flags: review?(benjamin)
Attachment #8377414 - Flags: review?(benjamin)
(In reply to :Ms2ger from comment #1)
> Looks like the *adds* a warning: nsCOMArray::Count returns int32_t;
> nsCOMArray::Length returns uint32_t.

yes, that was a mistake. I forgot one final hg qrefresh before posting my initial patch. :\
Attachment #8377414 - Flags: review?(benjamin) → review+
Blocks: 974300
https://hg.mozilla.org/mozilla-central/rev/ed161be44ec3
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: