Closed Bug 361791 Opened 18 years ago Closed 17 years ago

Unnecessary signed-unsigned casts, warnings in xpidl_util.c

Categories

(Core :: XPCOM, defect)

x86
Linux
defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla1.9alpha3

People

(Reporter: Waldo, Assigned: Waldo)

References

()

Details

Attachments

(1 file)

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).
Attached patch PatchSplinter Review
Attachment #246509 - Flags: superreview?(shaver)
Attachment #246509 - Flags: review?(shaver)
(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
Attachment #246509 - Flags: superreview?(shaver)
Attachment #246509 - Flags: superreview?(darin.moz)
Attachment #246509 - Flags: review?(timeless)
Attachment #246509 - Flags: review?(shaver)
Attachment #246509 - Flags: superreview?(darin.moz) → superreview+
Attachment #246509 - Flags: review?(timeless) → review+
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: mozilla1.9alpha1 → mozilla1.9alpha3
Component: xpidl → XPCOM
QA Contact: pschwartau → xpcom
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: