Unnecessary signed-unsigned casts, warnings in xpidl_util.c

RESOLVED FIXED in mozilla1.9alpha3

Status

()

--
minor
RESOLVED FIXED
12 years ago
10 years ago

People

(Reporter: Waldo, Assigned: Waldo)

Tracking

Trunk
mozilla1.9alpha3
x86
Linux
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

12 years ago
Portions of UUIDs are being sscanf'd as unsigned numbers but are being stuffed into signed ones for no reason.  This also necessitated some casting when those signed numbers were stuffed into the unsigned fields of an nsID, again for no good reason.  The to-be-posted patch makes the values into which numbers are stuffed unsigned to ease compiler warnings.

We could go even further and make n1 and n2 PRUint16 and n3[8] PRUint8, but then we'd have to use different format specifiers, which is non-trivial without C99's SCNx32, SCNx16, and SCNx8 macros (or requires using PR_sscanf, but I can't find docs on the NSPR integer format specifiers, other than that there's an unspecified mapping between sscanf and PR_sscanf specifiers).
(Assignee)

Comment 1

12 years ago
Created attachment 246509 [details] [diff] [review]
Patch
Attachment #246509 - Flags: superreview?(shaver)
Attachment #246509 - Flags: review?(shaver)
(Assignee)

Comment 2

12 years ago
(In reply to comment #0)
> PR_sscanf

So as it turns out, I was blind and missed the specifier docs, but it's irrelevant because xpidl explicitly doesn't depend on NSPR and thus isn't usable.
Status: NEW → ASSIGNED
(Assignee)

Updated

12 years ago
Attachment #246509 - Flags: superreview?(shaver)
Attachment #246509 - Flags: superreview?(darin.moz)
Attachment #246509 - Flags: review?(timeless)
Attachment #246509 - Flags: review?(shaver)

Updated

12 years ago
Attachment #246509 - Flags: superreview?(darin.moz) → superreview+

Updated

12 years ago
Attachment #246509 - Flags: review?(timeless) → review+
(Assignee)

Comment 3

12 years ago
Fixed.
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: mozilla1.9alpha1 → mozilla1.9alpha3

Updated

10 years ago
Component: xpidl → XPCOM
QA Contact: pschwartau → xpcom
You need to log in before you can comment on or make changes to this bug.