Closed
Bug 597249
Opened 14 years ago
Closed 14 years ago
Make GlobalPrinters::GetNumPrinters() implementations return a PRUint32 instead of PRInt32
Categories
(Core :: Widget, defect)
Core
Widget
Tracking
()
RESOLVED
FIXED
mozilla2.0b7
People
(Reporter: dholbert, Assigned: juca)
Details
Attachments
(1 file, 1 obsolete file)
7.36 KB,
patch
|
roc
:
review+
dholbert
:
review+
joe
:
approval2.0+
|
Details | Diff | Splinter Review |
I just noticed that all our (platform-specific) implementations of GlobalPrinters::GetNumPrinters() return PRInt32, when really the "count of printers" is an unsigned value. Here's the list of implementations: http://mxr.mozilla.org/mozilla-central/search?string=%20GetNumPrinters%28 All our implementations are actually backed by unsigned values: - for GTK & windows, we return "nsTArray::Length || 0" - For OS2, we return a ULONG - For BeOS, we return an int which is initialized to 0 and then only ever modified by incrementing (with ++) or being reset to 0. - Mac doesn't have this code at all. So, I'm filing this bug on switching GlobalPrinters::GetNumPrinters() to return PRUint32 instead of PRInt32.
Assignee | ||
Comment 1•14 years ago
|
||
Reporter | ||
Comment 2•14 years ago
|
||
Comment on attachment 476177 [details] [diff] [review] PRInt32 -> PRUint32 Thanks for the quick patch! This needs one more thing, though -- to avoid introducing a bunch of unsigned --> signed conversions (and unsigned/signed comparisons), can you change |numPrinters| and |printerInx| from signed to unsigned here: http://mxr.mozilla.org/mozilla-central/source/widget/src/windows/nsDeviceContextSpecWin.cpp#921 And the same for numPrinters| & |count| in these two places: http://mxr.mozilla.org/mozilla-central/source/widget/src/beos/nsDeviceContextSpecB.cpp#154 http://mxr.mozilla.org/mozilla-central/source/widget/src/gtk2/nsDeviceContextSpecG.cpp#719 And I think that should cover it. This needs review from Widget module owner or peer, though. You should request review from :roc or :vlad once you've done the above. Thanks again!
Attachment #476177 -
Flags: review?(dholbert)
Assignee | ||
Comment 3•14 years ago
|
||
Attachment #476177 -
Attachment is obsolete: true
Attachment #476239 -
Flags: review?
Reporter | ||
Updated•14 years ago
|
Attachment #476239 -
Flags: review? → review?(roc)
Reporter | ||
Updated•14 years ago
|
Attachment #476239 -
Flags: review+
Attachment #476239 -
Flags: review?(roc) → review+
Reporter | ||
Comment 4•14 years ago
|
||
Comment on attachment 476239 [details] [diff] [review] PRUint32 usage Requesting approval to land this patch -- it just cleans up a bunch of signed integers that really only store unsigned values to be *true* unsigned integers.
Attachment #476239 -
Flags: approval2.0?
Comment 5•14 years ago
|
||
Comment on attachment 476239 [details] [diff] [review] PRUint32 usage This can go in post-b7
Attachment #476239 -
Flags: approval2.0? → approval2.0+
Reporter | ||
Comment 6•14 years ago
|
||
Pushed: http://hg.mozilla.org/mozilla-central/rev/2ca959dd2275
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Reporter | ||
Updated•14 years ago
|
Target Milestone: --- → mozilla2.0b8
Updated•14 years ago
|
Target Milestone: mozilla2.0b8 → mozilla2.0b7
You need to log in
before you can comment on or make changes to this bug.
Description
•