Closed
Bug 88747
Opened 24 years ago
Closed 23 years ago
nsCRT::atoi should be removed or fixed
Categories
(Core :: XPCOM, defect, P1)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla0.9.4
People
(Reporter: dbaron, Assigned: timeless)
References
Details
Attachments
(3 files)
668 bytes,
patch
|
Details | Diff | Splinter Review | |
502 bytes,
patch
|
Details | Diff | Splinter Review | |
556 bytes,
patch
|
Details | Diff | Splinter Review |
|nsCRT::atoi| (according to a compiler warning pointed out by timeless, and by
inspection) just recurses infinitely. |::atoi| takes a |char*|. So we should
probably just remove it, unless someone wants to write one for |PRUnichar*|...
Comment 2•24 years ago
|
||
Mmm. Prefer pre-increment. Prefer |for| loops for cases like this. Make sure
you satisfy the actual behavior of the ASCII |atoi|, which means skipping
whitespace and possibly recognizing |'+'|. It may be easier just to convert to
ASCII can call the systems |atoi| on the result (in terms of catching all the
edge cases). |aChar| is a parameter style name, for a local pointer to
characters, prefer, e.g., |cp|, |s|, |t|... etc.,
ok, so my first patch was composed while i was sleeping. I had ruled out
strings because i convinced myself they weren't available. I should have tried
compiling it.
kandrot can you test this function? [nothing in the tree uses it]
Comment 5•24 years ago
|
||
sr=scc
Comment 6•24 years ago
|
||
r=dbradley
fix checked in
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
This fix breaks the XPCONNECT_STANDALONE build. The h file for
NS_ConvertUCS2toUTF8 is not included in the standalone build.
It looks like NS_ConvertUCS2toUTF8 is defined in the obsolete string directory.
Is it ok to use this function?
nsCRT.cpp
c:\standalone\mozilla\xpcom\ds\nsCRT.cpp(650) : error C2065: 'NS_ConvertUCS2toUT
F8' : undeclared identifier
c:\standalone\mozilla\xpcom\ds\nsCRT.cpp(650) : error C2228: left of '.get' must
have class/struct/union type
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Reporter | ||
Comment 9•23 years ago
|
||
> It looks like NS_ConvertUCS2toUTF8 is defined in the obsolete string directory.
> Is it ok to use this function?
Well, it's not really obsolete yet. It will be once the replacement has been
written.
Comment 10•23 years ago
|
||
Well, It doesn't look like anyone actually *calls* nsCRT::atoi...
http://lxr.mozilla.org/seamonkey/search?string=nsCRT%3A%3Aatoi
Other 16bit string stuff is broken for XPCOM_STANDALONE anyway. Let's just NOP
nsCRT::atoi in XPCOM_STANDALONE builds and get on with our lives. We can add an
#ifdef'd NS_NOTREACHED to make it easier for anyone who may end up calling this
to figure out why the code is not doing the expected operation.
Patch coming.
Comment 11•23 years ago
|
||
Comment 12•23 years ago
|
||
Hey, this is bustage. How about some r= sr= and we get this in today?
Severity: normal → blocker
Priority: -- → P1
Target Milestone: --- → mozilla0.9.4
Reporter | ||
Comment 13•23 years ago
|
||
r=dbaron
Comment 14•23 years ago
|
||
Good grief, how many #ifdefs do we need for XPCOM_STANDALONE? Is there a bug on
cleaning up things so we eventually unify on a standalone xpcom that Mozilla can
use as-is?
sr=brendan@mozilla.org on the short-term patch.
/be
Assignee | ||
Comment 15•23 years ago
|
||
patch checked in fwiw bug 24515 track's Can't build XPCOM standalone -- sorry i
contributed to the problem.
Status: REOPENED → RESOLVED
Closed: 24 years ago → 23 years ago
Resolution: --- → FIXED
Comment 16•23 years ago
|
||
brendan: The thing that whacks XPCOM_STANDALONE so much is that it is defined to
not have intl stuff, but the string code is laced with intl-isms. I'm short on
simple solutions for this.
timeless: thanks for the checkin.
Comment 17•22 years ago
|
||
Just for the record, this was actually a dup of 64054, which now that i've seen
this bug, has also been marked fixed.
-dave
You need to log in
before you can comment on or make changes to this bug.
Description
•