Closed Bug 520366 Opened 16 years ago Closed 16 years ago

AppendInt only handles 32 bit signed ints

Categories

(Core :: XPCOM, defect)

x86
Windows NT
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: Bienvenu, Assigned: neil)

References

(Depends on 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

AppendInt only handles 32 bit signed ints. We'd like to be able to use it for IMAP UIDs, which are always positive numbers :-) In the non-frozen string api, AppendInt(PRUInt32 aInt) actually just calls the PRInt32 version. To work around that, I used the PRInt64 version. I understand that in the frozen api, there's only a 32 bit signed AppendInt, which would force me to use snprintf.
Attached patch Possible patch (obsolete) — Splinter Review
This draft is only for the internal version of the API for now. I thought I might as well add PRUint64 versions of AppendInt but I ran into ambiguous overloading problems and so I ended up with 8 prototypes. Then I wasn't sure if it was safe to remove the old methods from nsStringObsolete.cpp so I didn't.
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #405945 - Flags: review?(dbaron)
Comment on attachment 405945 [details] [diff] [review] Possible patch I'd prefer Benjamin review this, if that's ok.
Attachment #405945 - Flags: review?(dbaron) → review?(benjamin)
Comment on attachment 405945 [details] [diff] [review] Possible patch Needs tests.
Attachment #405945 - Flags: review?(benjamin) → review-
Attached patch With test fixSplinter Review
Horrible macros, I know.
Attachment #405945 - Attachment is obsolete: true
Attachment #408996 - Flags: review?(benjamin)
Attachment #408996 - Flags: review?(benjamin) → review+
Pushed changeset d59175a25fc6 to mozilla-central.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Depends on: 552788
Component: String → XPCOM
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: