Closed Bug 170160 Opened 22 years ago Closed 22 years ago

s/sprintf/AppendInt/ in layout/xul

Categories

(Core :: XUL, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bratell, Assigned: bratell)

References

Details

Attachments

(1 file)

This is a part of bug 92064.

In several places we put up a big char buffer on the stack, call sprintf to fill
that buffer with a number as a string and finally convert that buffer to unicode. 

Faster and smarter is to use AppendInt on a nsAutoString. Patch coming up.
Here's a patch. Who should I call for a review? Hyatt? The changes are trivial.
Summary: s/sprintf/AppendInt in layout/xul → s/sprintf/AppendInt/ in layout/xul
Blocks: 92064
Try cc'ing some people who could r= and sr= in addition to hyatt.  Heck, I'll
sr= the patch right now.

/be
Comment on attachment 100139 [details] [diff] [review]
Use AppendInt instead of sprintf

Nit: why not append Str and not mess with interCaps when naming the
nsAutoString variable: newpos => newposStr, not newPosStr.

sr=brendan@mozilla.org with a valid r=.

/be
Attachment #100139 - Flags: superreview+
I'll make that change before checking in if I get a r=.
Attachment #100139 - Flags: review?(hyatt)
Comment on attachment 100139 [details] [diff] [review]
Use AppendInt instead of sprintf

Trying another reviewer...
Attachment #100139 - Flags: review?(hyatt) → review?(bryner)
Attachment #100139 - Flags: review?(bryner) → review+
Taking the bug
Assignee: hyatt → bratell
Checked in patch.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
+     printf("Current Pos=%s\n",newPosStr.get());
this won't work now, because newPosStr is an nsAutoString, so you'd get back a
PRUnichar*...
That should be fixed in the code I checked in. That said, since it's ifdefed
away,  it hasn't been put through my compiler.
ah, indeed. I had only looked at the patch on this bug, not at what was actually
checked in.
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: shrir → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: