628 Commits

Author SHA1 Message Date
bratell%lysator.liu.se
ec28beac4b Final part of bug 40027. r,a=waterson@netscape.com
git-svn-id: svn://10.0.0.236/trunk@74889 18797224-902f-48f8-a5cc-f745e15eee43
2000-07-27 06:12:49 +00:00
bratell%lysator.liu.se
30ea99bee8 Bug 40027, reads past buffer in nsString::ToCString, r,a=waterson
git-svn-id: svn://10.0.0.236/trunk@74784 18797224-902f-48f8-a5cc-f745e15eee43
2000-07-26 00:05:55 +00:00
waterson%netscape.com
9f71ef28c6 Inline 'operator PRUnichar*()', 'operator char*()'; add inline 'get()' methods. r=brendan
git-svn-id: svn://10.0.0.236/trunk@74147 18797224-902f-48f8-a5cc-f745e15eee43
2000-07-13 03:20:28 +00:00
scc%mozilla.org
e2e3b170e1 fix self assignment, self append, self replace problems. r=waterson
git-svn-id: svn://10.0.0.236/trunk@73545 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-29 22:17:53 +00:00
scc%mozilla.org
a6b40ede8b fix for commercial bustage on Mac (adding |operator const CharT*() const| to |basic_nsLiteralString|). fix for blizzards linux changes needing working |Substring|. r=beard,syd
git-svn-id: svn://10.0.0.236/trunk@72736 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-21 05:13:10 +00:00
scc%mozilla.org
6c6171d864 fix for bug #43085. r=waterson, a=waterson
git-svn-id: svn://10.0.0.236/trunk@72617 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-20 04:25:20 +00:00
scc%mozilla.org
2a2a840b4d fixing OS/2 VisualAge platform bustage, and bad dates in licenses
git-svn-id: svn://10.0.0.236/trunk@72507 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-18 05:00:31 +00:00
waterson%netscape.com
e32e7767b4 Bug 42836. Handle null string in NS_ConvertUCS2toUTF8::Init().
git-svn-id: svn://10.0.0.236/trunk@72465 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-17 01:24:39 +00:00
scc%mozilla.org
900f215543 undo the change of the 10th. The code is still in, conditioned on |NS_DONT_USE_CHUNKY_STRING_ALLOCATION|. The performance hit was unacceptable, and checking the original change in on the tip was a mistake. r=rpotts; a=leaf, phil
git-svn-id: svn://10.0.0.236/trunk@72327 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-15 22:13:19 +00:00
brendan%mozilla.org
154af1de4d Fiddle whitespace style.
git-svn-id: svn://10.0.0.236/trunk@72186 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-14 04:46:22 +00:00
scc%mozilla.org
330107a3e1 reduce bloat by not chunk-allocating strings (in |nsStr::Alloc|). Clients that don't benefit from this can explicitly call |SetCapacity|. We may re-introduce this functionality in the append of a single character when no space remains, if it turns out to be a problem. This optimization was suggested by profiling done by sfraser, who now promises to find out where it hurts us.
git-svn-id: svn://10.0.0.236/trunk@72019 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-12 02:54:22 +00:00
scc%mozilla.org
bb796c096f added some #ifdef logic to allow me to turn NEW_STRING_APIS off, so I can continue to profile for bloat; added an implementation specific |operator+()| to resolve ambiguity with promises on some platforms
git-svn-id: svn://10.0.0.236/trunk@71988 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-11 04:35:02 +00:00
scc%mozilla.org
4736e302e9 added some #ifdef logic to allow me to turn NEW_STRING_APIS off, so I can continue to profile for bloat; added an implementation specific |operator+()| to resolve ambiguity with promises on some platforms; added a conversion operator (against my best judgement) to |NS_ConvertASCIItoUCS2| to support the construction of literal strings induced by the bad case of the new macro. I could conditionally define this is the opposite direction.
git-svn-id: svn://10.0.0.236/trunk@71981 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-11 01:06:14 +00:00
scc%mozilla.org
71bf634434 added some #ifdef logic to allow me to NEW_STRING_APIS off, so I can continue to profile for bloat
git-svn-id: svn://10.0.0.236/trunk@71980 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-11 01:03:19 +00:00
scc%mozilla.org
d1c143fbb4 In an assignment, |SetLength(0); SetLength(newLength);| so that the implementation won't bother to copy any old characters if allocation is required. Fiddled with inlining to reduce bloat ... more experiments needed.
git-svn-id: svn://10.0.0.236/trunk@71979 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-11 01:02:12 +00:00
scc%mozilla.org
bcb44dd5d8 provide real definitions for |NS_LITERAL_STRING| (one of which exploits |wchar_t|); add a range-check assertion to |CharAt|; add another constructor to |nsPromiseConcatenation| to allow per-class |operator+()| (which some compilers need to resolve ambiguity) to work; fiddled with inlining to reduce bloat ... more experiments needed
git-svn-id: svn://10.0.0.236/trunk@71978 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-11 01:00:08 +00:00
alecf%netscape.com
f90fa8e9f2 fix purify errors - uninitialized memory on poorly formatted CID strings, and FMM on nsString::fputs
r=waterson, scc a=waterson


git-svn-id: svn://10.0.0.236/trunk@71822 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-08 23:34:53 +00:00
waterson%netscape.com
9d914a6568 Fix bonehead error warren found: don't re-initialize utf8len; we'll need it to set the string's length!
git-svn-id: svn://10.0.0.236/trunk@71816 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-08 23:07:15 +00:00
warren%netscape.com
cc5d426fbe Renaming nsIAllocator to nsIMemory (and nsAllocator to nsMemory). API cleanup/freeze. Bug #18433
git-svn-id: svn://10.0.0.236/trunk@71450 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-03 09:46:12 +00:00
scc%mozilla.org
208df9930b Exploiting a user-defined |operator->()| when the result is a pointer to a primitive type is problematic for the OS/2 VisualAge compiler. Eliminate such uses in the new string facilities. These are stragglers missed in an earlier checkin.
git-svn-id: svn://10.0.0.236/trunk@71427 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-03 00:38:06 +00:00
scc%mozilla.org
884619a3cd VisualAge doesn't like declarations in if/for expressions. r=waterson
git-svn-id: svn://10.0.0.236/trunk@71400 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-02 22:35:01 +00:00
waterson%netscape.com
c802dd3916 Bugs 41279, 41280, 41290. Implement NS_ConvertUTF8toUCS2, r=ftang. Fix NS_ConvertUCS2toUTF8 to set mLength, r=ftang. Re-implement ToNew[*]String to be less bloaty, r=scc,brendan
git-svn-id: svn://10.0.0.236/trunk@71379 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-02 20:06:54 +00:00
scc%mozilla.org
b27d72b4ff Exploiting a user-defined |operator->()| when the result is a pointer to a primitive type is problematic for the OS/2 VisualAge compiler. Eliminate such uses in the new string facilities. r=waterson
git-svn-id: svn://10.0.0.236/trunk@71249 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-01 06:01:18 +00:00
waterson%netscape.com
25af6f072e Bug 39424. Fix Sun Workshop compiler bustage by conditioning NS_READABLE_CAST's funkiness on NEED_CPP_TEMPLATE_CAST_TO_BASE. r=scc
git-svn-id: svn://10.0.0.236/trunk@70998 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-27 05:51:56 +00:00
waterson%netscape.com
5a5cff3522 Back out changes that I didn't mean to check in.
git-svn-id: svn://10.0.0.236/trunk@70972 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-27 00:17:36 +00:00
waterson%netscape.com
798592bacb Fix boneheaded mistake: I left the return type of NS_ConvertUCS2toUTF8::Init().
git-svn-id: svn://10.0.0.236/trunk@70971 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-27 00:17:10 +00:00
waterson%netscape.com
11ea188ef2 Bug 40461. Implement NS_ConvertUCS2toUTF8, r=scc,brendan
git-svn-id: svn://10.0.0.236/trunk@70949 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-26 22:24:34 +00:00
scc%mozilla.org
9e46fa744e Bug #39963. The NS_LITERAL_[C]STRING macros incorrectly counted the null terminator for a literal string in the length. This may not be the complete solution. r=sdagley
git-svn-id: svn://10.0.0.236/trunk@70565 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-21 01:45:19 +00:00
scc%mozilla.org
64c1d73da8 Bug #39686. Made an |NS_COUNT|. Put it in the new file "nsAlgorithm.h", to which I also moved |NS_MIN| and |NS_MAX| from "nscore.h", and |copy_string| and |copy_string_backward| from "nsAReadableString.h". Also fixed non-standard include-guards. r={sford, jag}
git-svn-id: svn://10.0.0.236/trunk@70562 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-20 20:43:26 +00:00
scc%mozilla.org
1993e1afa4 Adding a new file. Part of the fix for Bug #39686.
git-svn-id: svn://10.0.0.236/trunk@70559 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-20 19:57:03 +00:00
scc%mozilla.org
d029bb7e31 ugh. Fix to placate egcs. |static_cast| should be sufficient for a |void*|, but egcs seems to need |reinterpret_cast|
git-svn-id: svn://10.0.0.236/trunk@70558 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-20 19:08:36 +00:00
scc%mozilla.org
1a06df0830 Fixing platform bustage only caught by SunOS Workshop. Need a |const| in a cast to avoid casting away |const|-ness. r=jdunn
git-svn-id: svn://10.0.0.236/trunk@70553 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-20 18:22:05 +00:00
scc%mozilla.org
a31073f144 Checking in patch from Jim Dunn to fix platform bustage on HPUX. In fact, this is the way the code should have been written in the first place due to the C++ standard section 14.6.2(3). Members of the template base class just aren't visible without explicit scoping of some form, typically |this->|. r=scc
git-svn-id: svn://10.0.0.236/trunk@70552 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-20 18:19:27 +00:00
scc%netscape.com
21439a6da2 fixed a problem with cut and advancing past the end of a string with an iterator r=waterson
git-svn-id: svn://10.0.0.236/trunk@70026 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-16 10:13:23 +00:00
scc%netscape.com
daa22be30a turning on the new strings API.
git-svn-id: svn://10.0.0.236/trunk@70010 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-16 07:18:04 +00:00
waterson%netscape.com
286499ed4c Revert NS_READABLE_CAST. Without the reference, it didn't work.
git-svn-id: svn://10.0.0.236/trunk@70008 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-16 07:01:30 +00:00
waterson%netscape.com
b2c93adc15 Clean up some of the last warnings.
git-svn-id: svn://10.0.0.236/trunk@69930 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-16 00:45:38 +00:00
waterson%netscape.com
99866cd4f9 Flip NS_READABLE_CAST back the other way: more important to placate egcs that gcc-2.7.2.3
git-svn-id: svn://10.0.0.236/trunk@69903 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-15 23:06:25 +00:00
scc%netscape.com
578b1917ba circular include logic defeated me ... protect the new operator definitions locally
git-svn-id: svn://10.0.0.236/trunk@69773 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-15 08:07:25 +00:00
scc%netscape.com
87e4dcc1d6 oops
git-svn-id: svn://10.0.0.236/trunk@69770 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-15 07:37:18 +00:00
scc%netscape.com
a4547be9bd adding macros and uses to support Solaris' inability to pick operator+
git-svn-id: svn://10.0.0.236/trunk@69767 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-15 07:28:00 +00:00
scc%netscape.com
d282389c10 added macro code to help define more comparison operators. Got rid of |typename|. We can live with the warnings, maybe; but windows can't digest it in this context.
git-svn-id: svn://10.0.0.236/trunk@69744 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-15 05:14:40 +00:00
scc%netscape.com
879df1b115 changes to fix some errors constructing autostrings from null pointers that led to crashes
git-svn-id: svn://10.0.0.236/trunk@69730 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-15 03:10:19 +00:00
waterson%netscape.com
2f3bfe1608 With NEW_STRING_APIS, turn on definition of string comparison operators to avoid accidental pointer comparisons. r=scc
git-svn-id: svn://10.0.0.236/trunk@69712 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-15 01:27:04 +00:00
scc%netscape.com
0240bbf90c ...oops, have to comment out the body too. Sorry.
git-svn-id: svn://10.0.0.236/trunk@69705 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-15 00:16:30 +00:00
scc%netscape.com
c2c42ed547 commented out an |NS_WARNING| that will overwhelm you, I'll turn it into an assertion for me only, later. Also got rid of |Equals(*, int)| temporarily, as with |Compare| to catch clients who should be using |EqualsWithConversion|
git-svn-id: svn://10.0.0.236/trunk@69704 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-15 00:13:57 +00:00
scc%netscape.com
937ea1fdff disable a not helpful warning for VC++
git-svn-id: svn://10.0.0.236/trunk@69697 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-14 23:33:05 +00:00
scc%netscape.com
146d1274ec comment out |Compare| with a length to help find callers of the old compare function that need to become to |CompareWithConversion|.
git-svn-id: svn://10.0.0.236/trunk@69685 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-14 22:32:30 +00:00
waterson%netscape.com
fa1241b5bc Remove #ifdef that's no longer necessary now that STL headers aren't included.
git-svn-id: svn://10.0.0.236/trunk@69603 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-14 00:14:19 +00:00
scc%netscape.com
fa91dce42e waterson and I are giving up on the current build being allowed to even include files related to STL, mostly (but not only) because of Solaris ... by the time someone want to _use_ STL, maybe the compilers will be better, and this fix won't effect them.
git-svn-id: svn://10.0.0.236/trunk@69597 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-13 23:59:49 +00:00