From 09a45773e95993108799715610077de482450740 Mon Sep 17 00:00:00 2001 From: "scc%mozilla.org" Date: Fri, 29 Jun 2001 12:47:43 +0000 Subject: [PATCH] bug #74726: sr=waterson, r=beard. Make |nsXPIDLC?String| inherit from |nsSharableC?String|, the new implementation is now in the string hierarchy (and out of string/obsolete). git-svn-id: svn://10.0.0.236/trunk@98275 18797224-902f-48f8-a5cc-f745e15eee43 --- .../protocol/gopher/src/nsGopherChannel.cpp | 2 +- mozilla/string/macbuild/string.mcp | Bin 75711 -> 75711 bytes mozilla/string/obsolete/MANIFEST | 1 - mozilla/string/obsolete/Makefile.in | 2 - mozilla/string/obsolete/bufferRoutines.h | 35 +++++++++++++++--- mozilla/string/obsolete/makefile.win | 2 - mozilla/string/obsolete/nsStr.h | 5 +++ mozilla/string/public/MANIFEST | 2 + mozilla/string/public/Makefile.in | 2 + mozilla/string/public/makefile.win | 2 + mozilla/string/public/nsAFlatString.h | 8 ++-- mozilla/string/public/nsAStringGenerator.h | 4 ++ mozilla/string/public/nsBufferHandle.h | 4 ++ mozilla/string/public/nsCharTraits.h | 4 ++ mozilla/string/public/nsSharableString.h | 4 +- mozilla/string/public/nsStringFragment.h | 3 ++ mozilla/string/public/nsStringFwd.h | 4 ++ mozilla/string/public/nsStringIteratorUtils.h | 4 ++ mozilla/string/src/Makefile.in | 1 + mozilla/string/src/makefile.win | 1 + mozilla/string/src/nsAFlatString.cpp | 4 +- mozilla/xpcom/string/macbuild/string.mcp | Bin 75711 -> 75711 bytes mozilla/xpcom/string/obsolete/MANIFEST | 1 - mozilla/xpcom/string/obsolete/Makefile.in | 2 - .../xpcom/string/obsolete/bufferRoutines.h | 35 +++++++++++++++--- mozilla/xpcom/string/obsolete/makefile.win | 2 - mozilla/xpcom/string/obsolete/nsStr.h | 5 +++ mozilla/xpcom/string/public/MANIFEST | 2 + mozilla/xpcom/string/public/Makefile.in | 2 + mozilla/xpcom/string/public/makefile.win | 2 + mozilla/xpcom/string/public/nsAFlatString.h | 8 ++-- .../xpcom/string/public/nsAStringGenerator.h | 4 ++ mozilla/xpcom/string/public/nsBufferHandle.h | 4 ++ mozilla/xpcom/string/public/nsCharTraits.h | 4 ++ .../xpcom/string/public/nsSharableString.h | 4 +- .../xpcom/string/public/nsStringFragment.h | 3 ++ mozilla/xpcom/string/public/nsStringFwd.h | 4 ++ .../string/public/nsStringIteratorUtils.h | 4 ++ mozilla/xpcom/string/src/Makefile.in | 1 + mozilla/xpcom/string/src/makefile.win | 1 + mozilla/xpcom/string/src/nsAFlatString.cpp | 4 +- 41 files changed, 147 insertions(+), 39 deletions(-) diff --git a/mozilla/netwerk/protocol/gopher/src/nsGopherChannel.cpp b/mozilla/netwerk/protocol/gopher/src/nsGopherChannel.cpp index 02fdb066665..3afd7fefbc6 100644 --- a/mozilla/netwerk/protocol/gopher/src/nsGopherChannel.cpp +++ b/mozilla/netwerk/protocol/gopher/src/nsGopherChannel.cpp @@ -111,7 +111,7 @@ nsGopherChannel::Init(nsIURI* uri) mSelector.Adopt(nsCRT::strdup("")); } else { mType = buffer[1]; // Ignore leading '/' - mSelector.Adopt(nsCRT::strdup(nsUnescape(NS_CONST_CAST(char*,&buffer[2])))); + mSelector.Adopt(nsCRT::strdup(nsUnescape(NS_CONST_CAST(char*,buffer.get()+2)))); } PR_LOG(gGopherLog, diff --git a/mozilla/string/macbuild/string.mcp b/mozilla/string/macbuild/string.mcp index 4191b939b0ebef0bfb871a03d06e667109daf207..74a50134c2a58918d250063faa9d474f0ffcf51f 100644 GIT binary patch delta 772 zcmZ8eT}V@582;X!otv2tb-TPuR1{d8H; ze3M~<=2hJY<{@^uiY_b=34($s$}YPo7=oB^de7NuhzFkUd)|lV{hs&xPGQknShUWz zIrwJAm>2yH718cO(dmh_km3hg2tnGe5|WGwJY#mEM$H0g=1%srU@F5{>OPZ5H~K6@ z2zsBF;OA%|lxr*1grNG!S>#|ClNE0P0O|z9l@?T_N=Up3t=1LG^TZlZ8J*b2iblJi~pxCvm7Zf#1#xAZG(ET&@~W!{IMH zZ!3}sf840cc6}I~wBk^Yw4pDy;KtE~K77*Kq4#f*>FSDpeL{OSFg`bZYm>SbZF7Tw z{`86MN+{e#XX>BDb}cb59KA?%7fz+~5X7^Y10K2aOb0c~>zo`HkLk7wd^mL+-(-&3 zO_PGQr)l-hy@aHm8vAbJWilPYyN~O6g;=A(j312J#4A^03t@tto<-Atyf1b{ayqqY29_WUg=zwBA zCVvs&VAa-B|5+vjF)(?7DdZ z*JtL*?R*C(2Cz)_;Fo6Q0NTbmIe~w}_hZrnY6Sbb)yisPdfYq1DW`TU{2DJ(Q|F1IG>>a4j z1T%fIR*1#qO=m48PYQ9J=qNJzt7y{Z(9qkglPmJ9CI;-DG>>I+RY}q1K-E61 zE{Fcth_2o=I$71AIT(u~)c7%yyR jmt%a)#3(WSwF09tkSnjq7|z6aWP7 */ +PRInt32 Compare1To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase); PRInt32 Compare1To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase){ PRInt32 result=0; if(aIgnoreCase) @@ -619,6 +633,7 @@ PRInt32 Compare1To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool a * @param aIgnorecase tells us whether to use a case-sensitive comparison * @return -1,0,1 depending on <,==,> */ +PRInt32 Compare2To2(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase); PRInt32 Compare2To2(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase){ PRInt32 result=0; if(aIgnoreCase) @@ -637,6 +652,7 @@ PRInt32 Compare2To2(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool a * @param aIgnorecase tells us whether to use a case-sensitive comparison * @return -1,0,1 depending on <,==,> */ +PRInt32 Compare2To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase); PRInt32 Compare2To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase){ PRInt32 result; if(aIgnoreCase) @@ -655,6 +671,7 @@ PRInt32 Compare2To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool a * @param aIgnorecase tells us whether to use a case-sensitive comparison * @return -1,0,1 depending on <,==,> */ +PRInt32 Compare1To2(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase); PRInt32 Compare1To2(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase){ PRInt32 result; if(aIgnoreCase) @@ -685,6 +702,7 @@ CompareChars gCompare[2][2]={ * @param aToUpper tells us whether to convert to upper or lower * @return 0 */ +PRInt32 ConvertCase1(char* aString,PRUint32 aCount,PRBool aToUpper); PRInt32 ConvertCase1(char* aString,PRUint32 aCount,PRBool aToUpper){ PRInt32 result=0; @@ -695,12 +713,12 @@ PRInt32 ConvertCase1(char* aString,PRUint32 aCount,PRBool aToUpper){ chartype ch = *cp; if(aToUpper) { if ((ch >= 'a') && (ch <= 'z')) { - *cp = 'A' + (ch - 'a'); + *cp = chartype('A' + (ch - 'a')); } } else { if ((ch >= 'A') && (ch <= 'Z')) { - *cp = 'a' + (ch - 'A'); + *cp = chartype('a' + (ch - 'A')); } } cp++; @@ -762,6 +780,7 @@ public: * @param aToUpper tells us whether to convert to upper or lower * @return 0 */ +PRInt32 ConvertCase2(char* aString,PRUint32 aCount,PRBool aToUpper); PRInt32 ConvertCase2(char* aString,PRUint32 aCount,PRBool aToUpper){ PRUnichar* cp = (PRUnichar*)aString; PRUnichar* end = cp + aCount-1; @@ -786,12 +805,12 @@ PRInt32 ConvertCase2(char* aString,PRUint32 aCount,PRBool aToUpper){ PRUnichar ch = *cp; if(aToUpper) { if ((ch >= 'a') && (ch <= 'z')) { - *cp = 'A' + (ch - 'a'); + *cp = PRUnichar('A' + (ch - 'a')); } } else { if ((ch >= 'A') && (ch <= 'Z')) { - *cp = 'a' + (ch - 'A'); + *cp = PRUnichar('a' + (ch - 'A')); } } cp++; @@ -822,6 +841,7 @@ CaseConverters gCaseConverters[]={&ConvertCase1,&ConvertCase2}; * @param aEliminateTrailing tells us whether to strip chars from the start of the buffer * @return the new length of the given buffer */ +PRInt32 CompressChars1(char* aString,PRUint32 aLength,const char* aSet); PRInt32 CompressChars1(char* aString,PRUint32 aLength,const char* aSet){ char* from = aString; @@ -866,6 +886,7 @@ PRInt32 CompressChars1(char* aString,PRUint32 aLength,const char* aSet){ * @param aEliminateTrailing tells us whether to strip chars from the start of the buffer * @return the new length of the given buffer */ +PRInt32 CompressChars2(char* aString,PRUint32 aLength,const char* aSet); PRInt32 CompressChars2(char* aString,PRUint32 aLength,const char* aSet){ PRUnichar* from = (PRUnichar*)aString; @@ -911,6 +932,7 @@ CompressChars gCompressChars[]={&CompressChars1,&CompressChars2}; * @param aEliminateTrailing tells us whether to strip chars from the start of the buffer * @return the new length of the given buffer */ +PRInt32 StripChars1(char* aString,PRUint32 aLength,const char* aSet); PRInt32 StripChars1(char* aString,PRUint32 aLength,const char* aSet){ char* to = aString; @@ -942,6 +964,7 @@ PRInt32 StripChars1(char* aString,PRUint32 aLength,const char* aSet){ * @param aEliminateTrailing tells us whether to strip chars from the start of the buffer * @return the new length of the given buffer */ +PRInt32 StripChars2(char* aString,PRUint32 aLength,const char* aSet); PRInt32 StripChars2(char* aString,PRUint32 aLength,const char* aSet){ PRUnichar* to = (PRUnichar*)aString; diff --git a/mozilla/string/obsolete/makefile.win b/mozilla/string/obsolete/makefile.win index 1f185b1aea5..e778b9e954f 100644 --- a/mozilla/string/obsolete/makefile.win +++ b/mozilla/string/obsolete/makefile.win @@ -27,7 +27,6 @@ EXPORTS = \ nsStr.h \ nsString.h \ nsString2.h \ - nsXPIDLString.h \ $(NULL) LIBRARY_NAME=string_obsolete_s @@ -39,7 +38,6 @@ CPP_OBJS = \ .\$(OBJDIR)\nsStr.obj \ .\$(OBJDIR)\nsString.obj \ .\$(OBJDIR)\nsString2.obj \ - .\$(OBJDIR)\nsXPIDLString.obj \ $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/string/obsolete/nsStr.h b/mozilla/string/obsolete/nsStr.h index 4348d7ea9de..3f78e41e378 100644 --- a/mozilla/string/obsolete/nsStr.h +++ b/mozilla/string/obsolete/nsStr.h @@ -29,6 +29,11 @@ #ifndef _nsStr #define _nsStr +#ifndef nsStringDefines_h___ +#include "nsStringDefines.h" +#endif + + /*********************************************************************** MODULE NOTES: diff --git a/mozilla/string/public/MANIFEST b/mozilla/string/public/MANIFEST index e87dd826f05..5cbd1883403 100644 --- a/mozilla/string/public/MANIFEST +++ b/mozilla/string/public/MANIFEST @@ -43,8 +43,10 @@ nsReadableUtils.h nsSharableString.h nsSharedBufferList.h nsSlidingString.h +nsStringDefines.h nsStringFragment.h nsStringFwd.h nsStringIterator.h nsStringIteratorUtils.h nsStringTraits.h +nsXPIDLString.h diff --git a/mozilla/string/public/Makefile.in b/mozilla/string/public/Makefile.in index 09103b73948..7506c81592f 100644 --- a/mozilla/string/public/Makefile.in +++ b/mozilla/string/public/Makefile.in @@ -53,11 +53,13 @@ EXPORTS = \ nsSharableString.h \ nsSharedBufferList.h \ nsSlidingString.h \ + nsStringDefines.h \ nsStringFragment.h \ nsStringFwd.h \ nsStringIterator.h \ nsStringIteratorUtils.h \ nsStringTraits.h \ + nsXPIDLString.h \ $(NULL) EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) diff --git a/mozilla/string/public/makefile.win b/mozilla/string/public/makefile.win index 4ea88569843..97e7d4f6300 100644 --- a/mozilla/string/public/makefile.win +++ b/mozilla/string/public/makefile.win @@ -47,11 +47,13 @@ EXPORTS = \ nsSharableString.h \ nsSharedBufferList.h \ nsSlidingString.h \ + nsStringDefines.h \ nsStringFragment.h \ nsStringFwd.h \ nsStringIterator.h \ nsStringIteratorUtils.h \ nsStringTraits.h \ + nsXPIDLString.h \ $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/string/public/nsAFlatString.h b/mozilla/string/public/nsAFlatString.h index c197bbf32ed..79fe6be866b 100644 --- a/mozilla/string/public/nsAFlatString.h +++ b/mozilla/string/public/nsAFlatString.h @@ -36,7 +36,7 @@ class NS_COM nsAFlatString public: // don't really want this to be virtual, and won't after |obsolete_nsString| is really dead virtual const PRUnichar* get() const; - PRUnichar operator[]( PRUint32 i ) const { return get()[ i ]; } + PRUnichar operator[]( int i ) const { return get()[ i ]; } PRUnichar CharAt( PRUint32 ) const; virtual PRUint32 Length() const; @@ -53,7 +53,7 @@ class NS_COM nsAFlatCString public: // don't really want this to be virtual, and won't after |obsolete_nsCString| is really dead virtual const char* get() const; - char operator[]( PRUint32 i ) const { return get()[ i ]; } + char operator[]( int i ) const { return get()[ i ]; } char CharAt( PRUint32 ) const; virtual PRUint32 Length() const; @@ -69,7 +69,7 @@ PRUnichar nsAFlatString::CharAt( PRUint32 i ) const { NS_ASSERTION(i // for |ptrdiff_t| diff --git a/mozilla/string/public/nsCharTraits.h b/mozilla/string/public/nsCharTraits.h index 32f0fb58c4e..842b752e715 100644 --- a/mozilla/string/public/nsCharTraits.h +++ b/mozilla/string/public/nsCharTraits.h @@ -24,6 +24,10 @@ #ifndef nsCharTraits_h___ #define nsCharTraits_h___ +#ifndef nsStringDefines_h___ +#include "nsStringDefines.h" +#endif + #include // for |EOF|, |WEOF| diff --git a/mozilla/string/public/nsSharableString.h b/mozilla/string/public/nsSharableString.h index 8a62223854a..9fec3209445 100644 --- a/mozilla/string/public/nsSharableString.h +++ b/mozilla/string/public/nsSharableString.h @@ -66,7 +66,7 @@ class NS_COM nsSharableString void assign( const string_type& ); virtual const nsSharedBufferHandle* GetSharedBufferHandle() const; - private: + protected: nsAutoBufferHandle mBuffer; }; @@ -96,7 +96,7 @@ class NS_COM nsSharableCString void assign( const string_type& ); virtual const nsSharedBufferHandle* GetSharedBufferHandle() const; - private: + protected: nsAutoBufferHandle mBuffer; }; diff --git a/mozilla/string/public/nsStringFragment.h b/mozilla/string/public/nsStringFragment.h index 0a8238023e9..d54287965d3 100644 --- a/mozilla/string/public/nsStringFragment.h +++ b/mozilla/string/public/nsStringFragment.h @@ -26,6 +26,9 @@ #ifndef nsStringFragment_h___ #define nsStringFragment_h___ +#ifndef nsStringDefines_h___ +#include "nsStringDefines.h" +#endif /** diff --git a/mozilla/string/public/nsStringFwd.h b/mozilla/string/public/nsStringFwd.h index ce7d32849df..4f68b5febb5 100644 --- a/mozilla/string/public/nsStringFwd.h +++ b/mozilla/string/public/nsStringFwd.h @@ -26,6 +26,10 @@ #ifndef nsStringFwd_h___ #define nsStringFwd_h___ +#ifndef nsStringDefines_h___ +#include "nsStringDefines.h" +#endif + /** * @see nsAString.h diff --git a/mozilla/string/public/nsStringIteratorUtils.h b/mozilla/string/public/nsStringIteratorUtils.h index 0d74365c1eb..ee07075a313 100644 --- a/mozilla/string/public/nsStringIteratorUtils.h +++ b/mozilla/string/public/nsStringIteratorUtils.h @@ -24,6 +24,10 @@ #ifndef nsStringIteratorUtils_h___ #define nsStringIteratorUtils_h___ +#ifndef nsStringDefines_h___ +#include "nsStringDefines.h" +#endif + template inline PRBool diff --git a/mozilla/string/src/Makefile.in b/mozilla/string/src/Makefile.in index 18983106d97..dca0a65c6de 100644 --- a/mozilla/string/src/Makefile.in +++ b/mozilla/string/src/Makefile.in @@ -47,6 +47,7 @@ CPPSRCS = \ nsSharableString.cpp \ nsSharedBufferList.cpp \ nsSlidingString.cpp \ + nsXPIDLString.cpp \ $(NULL) EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) diff --git a/mozilla/string/src/makefile.win b/mozilla/string/src/makefile.win index 1edabfe5682..624f3ed2596 100644 --- a/mozilla/string/src/makefile.win +++ b/mozilla/string/src/makefile.win @@ -42,6 +42,7 @@ CPP_OBJS = \ .\$(OBJDIR)\nsSharableString.obj \ .\$(OBJDIR)\nsSharedBufferList.obj \ .\$(OBJDIR)\nsSlidingString.obj \ + .\$(OBJDIR)\nsXPIDLString.obj \ $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/string/src/nsAFlatString.cpp b/mozilla/string/src/nsAFlatString.cpp index 114d01ad1b2..d9f7b1607a8 100644 --- a/mozilla/string/src/nsAFlatString.cpp +++ b/mozilla/string/src/nsAFlatString.cpp @@ -133,7 +133,7 @@ const PRUnichar* nsAFlatString::get() const { const nsBufferHandle* handle = GetBufferHandle(); - NS_ASSERTION(handle, "handle is null!"); + // NS_ASSERTION(handle, "handle is null!"); return handle ? handle->DataStart() : 0; } @@ -141,6 +141,6 @@ const char* nsAFlatCString::get() const { const nsBufferHandle* handle = GetBufferHandle(); - NS_ASSERTION(handle, "handle is null!"); + // NS_ASSERTION(handle, "handle is null!"); return handle ? handle->DataStart() : 0; } diff --git a/mozilla/xpcom/string/macbuild/string.mcp b/mozilla/xpcom/string/macbuild/string.mcp index 4191b939b0ebef0bfb871a03d06e667109daf207..74a50134c2a58918d250063faa9d474f0ffcf51f 100644 GIT binary patch delta 772 zcmZ8eT}V@582;X!otv2tb-TPuR1{d8H; ze3M~<=2hJY<{@^uiY_b=34($s$}YPo7=oB^de7NuhzFkUd)|lV{hs&xPGQknShUWz zIrwJAm>2yH718cO(dmh_km3hg2tnGe5|WGwJY#mEM$H0g=1%srU@F5{>OPZ5H~K6@ z2zsBF;OA%|lxr*1grNG!S>#|ClNE0P0O|z9l@?T_N=Up3t=1LG^TZlZ8J*b2iblJi~pxCvm7Zf#1#xAZG(ET&@~W!{IMH zZ!3}sf840cc6}I~wBk^Yw4pDy;KtE~K77*Kq4#f*>FSDpeL{OSFg`bZYm>SbZF7Tw z{`86MN+{e#XX>BDb}cb59KA?%7fz+~5X7^Y10K2aOb0c~>zo`HkLk7wd^mL+-(-&3 zO_PGQr)l-hy@aHm8vAbJWilPYyN~O6g;=A(j312J#4A^03t@tto<-Atyf1b{ayqqY29_WUg=zwBA zCVvs&VAa-B|5+vjF)(?7DdZ z*JtL*?R*C(2Cz)_;Fo6Q0NTbmIe~w}_hZrnY6Sbb)yisPdfYq1DW`TU{2DJ(Q|F1IG>>a4j z1T%fIR*1#qO=m48PYQ9J=qNJzt7y{Z(9qkglPmJ9CI;-DG>>I+RY}q1K-E61 zE{Fcth_2o=I$71AIT(u~)c7%yyR jmt%a)#3(WSwF09tkSnjq7|z6aWP7 */ +PRInt32 Compare1To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase); PRInt32 Compare1To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase){ PRInt32 result=0; if(aIgnoreCase) @@ -619,6 +633,7 @@ PRInt32 Compare1To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool a * @param aIgnorecase tells us whether to use a case-sensitive comparison * @return -1,0,1 depending on <,==,> */ +PRInt32 Compare2To2(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase); PRInt32 Compare2To2(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase){ PRInt32 result=0; if(aIgnoreCase) @@ -637,6 +652,7 @@ PRInt32 Compare2To2(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool a * @param aIgnorecase tells us whether to use a case-sensitive comparison * @return -1,0,1 depending on <,==,> */ +PRInt32 Compare2To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase); PRInt32 Compare2To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase){ PRInt32 result; if(aIgnoreCase) @@ -655,6 +671,7 @@ PRInt32 Compare2To1(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool a * @param aIgnorecase tells us whether to use a case-sensitive comparison * @return -1,0,1 depending on <,==,> */ +PRInt32 Compare1To2(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase); PRInt32 Compare1To2(const char* aStr1,const char* aStr2,PRUint32 aCount,PRBool aIgnoreCase){ PRInt32 result; if(aIgnoreCase) @@ -685,6 +702,7 @@ CompareChars gCompare[2][2]={ * @param aToUpper tells us whether to convert to upper or lower * @return 0 */ +PRInt32 ConvertCase1(char* aString,PRUint32 aCount,PRBool aToUpper); PRInt32 ConvertCase1(char* aString,PRUint32 aCount,PRBool aToUpper){ PRInt32 result=0; @@ -695,12 +713,12 @@ PRInt32 ConvertCase1(char* aString,PRUint32 aCount,PRBool aToUpper){ chartype ch = *cp; if(aToUpper) { if ((ch >= 'a') && (ch <= 'z')) { - *cp = 'A' + (ch - 'a'); + *cp = chartype('A' + (ch - 'a')); } } else { if ((ch >= 'A') && (ch <= 'Z')) { - *cp = 'a' + (ch - 'A'); + *cp = chartype('a' + (ch - 'A')); } } cp++; @@ -762,6 +780,7 @@ public: * @param aToUpper tells us whether to convert to upper or lower * @return 0 */ +PRInt32 ConvertCase2(char* aString,PRUint32 aCount,PRBool aToUpper); PRInt32 ConvertCase2(char* aString,PRUint32 aCount,PRBool aToUpper){ PRUnichar* cp = (PRUnichar*)aString; PRUnichar* end = cp + aCount-1; @@ -786,12 +805,12 @@ PRInt32 ConvertCase2(char* aString,PRUint32 aCount,PRBool aToUpper){ PRUnichar ch = *cp; if(aToUpper) { if ((ch >= 'a') && (ch <= 'z')) { - *cp = 'A' + (ch - 'a'); + *cp = PRUnichar('A' + (ch - 'a')); } } else { if ((ch >= 'A') && (ch <= 'Z')) { - *cp = 'a' + (ch - 'A'); + *cp = PRUnichar('a' + (ch - 'A')); } } cp++; @@ -822,6 +841,7 @@ CaseConverters gCaseConverters[]={&ConvertCase1,&ConvertCase2}; * @param aEliminateTrailing tells us whether to strip chars from the start of the buffer * @return the new length of the given buffer */ +PRInt32 CompressChars1(char* aString,PRUint32 aLength,const char* aSet); PRInt32 CompressChars1(char* aString,PRUint32 aLength,const char* aSet){ char* from = aString; @@ -866,6 +886,7 @@ PRInt32 CompressChars1(char* aString,PRUint32 aLength,const char* aSet){ * @param aEliminateTrailing tells us whether to strip chars from the start of the buffer * @return the new length of the given buffer */ +PRInt32 CompressChars2(char* aString,PRUint32 aLength,const char* aSet); PRInt32 CompressChars2(char* aString,PRUint32 aLength,const char* aSet){ PRUnichar* from = (PRUnichar*)aString; @@ -911,6 +932,7 @@ CompressChars gCompressChars[]={&CompressChars1,&CompressChars2}; * @param aEliminateTrailing tells us whether to strip chars from the start of the buffer * @return the new length of the given buffer */ +PRInt32 StripChars1(char* aString,PRUint32 aLength,const char* aSet); PRInt32 StripChars1(char* aString,PRUint32 aLength,const char* aSet){ char* to = aString; @@ -942,6 +964,7 @@ PRInt32 StripChars1(char* aString,PRUint32 aLength,const char* aSet){ * @param aEliminateTrailing tells us whether to strip chars from the start of the buffer * @return the new length of the given buffer */ +PRInt32 StripChars2(char* aString,PRUint32 aLength,const char* aSet); PRInt32 StripChars2(char* aString,PRUint32 aLength,const char* aSet){ PRUnichar* to = (PRUnichar*)aString; diff --git a/mozilla/xpcom/string/obsolete/makefile.win b/mozilla/xpcom/string/obsolete/makefile.win index 1f185b1aea5..e778b9e954f 100644 --- a/mozilla/xpcom/string/obsolete/makefile.win +++ b/mozilla/xpcom/string/obsolete/makefile.win @@ -27,7 +27,6 @@ EXPORTS = \ nsStr.h \ nsString.h \ nsString2.h \ - nsXPIDLString.h \ $(NULL) LIBRARY_NAME=string_obsolete_s @@ -39,7 +38,6 @@ CPP_OBJS = \ .\$(OBJDIR)\nsStr.obj \ .\$(OBJDIR)\nsString.obj \ .\$(OBJDIR)\nsString2.obj \ - .\$(OBJDIR)\nsXPIDLString.obj \ $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/xpcom/string/obsolete/nsStr.h b/mozilla/xpcom/string/obsolete/nsStr.h index 4348d7ea9de..3f78e41e378 100644 --- a/mozilla/xpcom/string/obsolete/nsStr.h +++ b/mozilla/xpcom/string/obsolete/nsStr.h @@ -29,6 +29,11 @@ #ifndef _nsStr #define _nsStr +#ifndef nsStringDefines_h___ +#include "nsStringDefines.h" +#endif + + /*********************************************************************** MODULE NOTES: diff --git a/mozilla/xpcom/string/public/MANIFEST b/mozilla/xpcom/string/public/MANIFEST index e87dd826f05..5cbd1883403 100644 --- a/mozilla/xpcom/string/public/MANIFEST +++ b/mozilla/xpcom/string/public/MANIFEST @@ -43,8 +43,10 @@ nsReadableUtils.h nsSharableString.h nsSharedBufferList.h nsSlidingString.h +nsStringDefines.h nsStringFragment.h nsStringFwd.h nsStringIterator.h nsStringIteratorUtils.h nsStringTraits.h +nsXPIDLString.h diff --git a/mozilla/xpcom/string/public/Makefile.in b/mozilla/xpcom/string/public/Makefile.in index 09103b73948..7506c81592f 100644 --- a/mozilla/xpcom/string/public/Makefile.in +++ b/mozilla/xpcom/string/public/Makefile.in @@ -53,11 +53,13 @@ EXPORTS = \ nsSharableString.h \ nsSharedBufferList.h \ nsSlidingString.h \ + nsStringDefines.h \ nsStringFragment.h \ nsStringFwd.h \ nsStringIterator.h \ nsStringIteratorUtils.h \ nsStringTraits.h \ + nsXPIDLString.h \ $(NULL) EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) diff --git a/mozilla/xpcom/string/public/makefile.win b/mozilla/xpcom/string/public/makefile.win index 4ea88569843..97e7d4f6300 100644 --- a/mozilla/xpcom/string/public/makefile.win +++ b/mozilla/xpcom/string/public/makefile.win @@ -47,11 +47,13 @@ EXPORTS = \ nsSharableString.h \ nsSharedBufferList.h \ nsSlidingString.h \ + nsStringDefines.h \ nsStringFragment.h \ nsStringFwd.h \ nsStringIterator.h \ nsStringIteratorUtils.h \ nsStringTraits.h \ + nsXPIDLString.h \ $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/xpcom/string/public/nsAFlatString.h b/mozilla/xpcom/string/public/nsAFlatString.h index c197bbf32ed..79fe6be866b 100644 --- a/mozilla/xpcom/string/public/nsAFlatString.h +++ b/mozilla/xpcom/string/public/nsAFlatString.h @@ -36,7 +36,7 @@ class NS_COM nsAFlatString public: // don't really want this to be virtual, and won't after |obsolete_nsString| is really dead virtual const PRUnichar* get() const; - PRUnichar operator[]( PRUint32 i ) const { return get()[ i ]; } + PRUnichar operator[]( int i ) const { return get()[ i ]; } PRUnichar CharAt( PRUint32 ) const; virtual PRUint32 Length() const; @@ -53,7 +53,7 @@ class NS_COM nsAFlatCString public: // don't really want this to be virtual, and won't after |obsolete_nsCString| is really dead virtual const char* get() const; - char operator[]( PRUint32 i ) const { return get()[ i ]; } + char operator[]( int i ) const { return get()[ i ]; } char CharAt( PRUint32 ) const; virtual PRUint32 Length() const; @@ -69,7 +69,7 @@ PRUnichar nsAFlatString::CharAt( PRUint32 i ) const { NS_ASSERTION(i // for |ptrdiff_t| diff --git a/mozilla/xpcom/string/public/nsCharTraits.h b/mozilla/xpcom/string/public/nsCharTraits.h index 32f0fb58c4e..842b752e715 100644 --- a/mozilla/xpcom/string/public/nsCharTraits.h +++ b/mozilla/xpcom/string/public/nsCharTraits.h @@ -24,6 +24,10 @@ #ifndef nsCharTraits_h___ #define nsCharTraits_h___ +#ifndef nsStringDefines_h___ +#include "nsStringDefines.h" +#endif + #include // for |EOF|, |WEOF| diff --git a/mozilla/xpcom/string/public/nsSharableString.h b/mozilla/xpcom/string/public/nsSharableString.h index 8a62223854a..9fec3209445 100644 --- a/mozilla/xpcom/string/public/nsSharableString.h +++ b/mozilla/xpcom/string/public/nsSharableString.h @@ -66,7 +66,7 @@ class NS_COM nsSharableString void assign( const string_type& ); virtual const nsSharedBufferHandle* GetSharedBufferHandle() const; - private: + protected: nsAutoBufferHandle mBuffer; }; @@ -96,7 +96,7 @@ class NS_COM nsSharableCString void assign( const string_type& ); virtual const nsSharedBufferHandle* GetSharedBufferHandle() const; - private: + protected: nsAutoBufferHandle mBuffer; }; diff --git a/mozilla/xpcom/string/public/nsStringFragment.h b/mozilla/xpcom/string/public/nsStringFragment.h index 0a8238023e9..d54287965d3 100644 --- a/mozilla/xpcom/string/public/nsStringFragment.h +++ b/mozilla/xpcom/string/public/nsStringFragment.h @@ -26,6 +26,9 @@ #ifndef nsStringFragment_h___ #define nsStringFragment_h___ +#ifndef nsStringDefines_h___ +#include "nsStringDefines.h" +#endif /** diff --git a/mozilla/xpcom/string/public/nsStringFwd.h b/mozilla/xpcom/string/public/nsStringFwd.h index ce7d32849df..4f68b5febb5 100644 --- a/mozilla/xpcom/string/public/nsStringFwd.h +++ b/mozilla/xpcom/string/public/nsStringFwd.h @@ -26,6 +26,10 @@ #ifndef nsStringFwd_h___ #define nsStringFwd_h___ +#ifndef nsStringDefines_h___ +#include "nsStringDefines.h" +#endif + /** * @see nsAString.h diff --git a/mozilla/xpcom/string/public/nsStringIteratorUtils.h b/mozilla/xpcom/string/public/nsStringIteratorUtils.h index 0d74365c1eb..ee07075a313 100644 --- a/mozilla/xpcom/string/public/nsStringIteratorUtils.h +++ b/mozilla/xpcom/string/public/nsStringIteratorUtils.h @@ -24,6 +24,10 @@ #ifndef nsStringIteratorUtils_h___ #define nsStringIteratorUtils_h___ +#ifndef nsStringDefines_h___ +#include "nsStringDefines.h" +#endif + template inline PRBool diff --git a/mozilla/xpcom/string/src/Makefile.in b/mozilla/xpcom/string/src/Makefile.in index 18983106d97..dca0a65c6de 100644 --- a/mozilla/xpcom/string/src/Makefile.in +++ b/mozilla/xpcom/string/src/Makefile.in @@ -47,6 +47,7 @@ CPPSRCS = \ nsSharableString.cpp \ nsSharedBufferList.cpp \ nsSlidingString.cpp \ + nsXPIDLString.cpp \ $(NULL) EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) diff --git a/mozilla/xpcom/string/src/makefile.win b/mozilla/xpcom/string/src/makefile.win index 1edabfe5682..624f3ed2596 100644 --- a/mozilla/xpcom/string/src/makefile.win +++ b/mozilla/xpcom/string/src/makefile.win @@ -42,6 +42,7 @@ CPP_OBJS = \ .\$(OBJDIR)\nsSharableString.obj \ .\$(OBJDIR)\nsSharedBufferList.obj \ .\$(OBJDIR)\nsSlidingString.obj \ + .\$(OBJDIR)\nsXPIDLString.obj \ $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/xpcom/string/src/nsAFlatString.cpp b/mozilla/xpcom/string/src/nsAFlatString.cpp index 114d01ad1b2..d9f7b1607a8 100644 --- a/mozilla/xpcom/string/src/nsAFlatString.cpp +++ b/mozilla/xpcom/string/src/nsAFlatString.cpp @@ -133,7 +133,7 @@ const PRUnichar* nsAFlatString::get() const { const nsBufferHandle* handle = GetBufferHandle(); - NS_ASSERTION(handle, "handle is null!"); + // NS_ASSERTION(handle, "handle is null!"); return handle ? handle->DataStart() : 0; } @@ -141,6 +141,6 @@ const char* nsAFlatCString::get() const { const nsBufferHandle* handle = GetBufferHandle(); - NS_ASSERTION(handle, "handle is null!"); + // NS_ASSERTION(handle, "handle is null!"); return handle ? handle->DataStart() : 0; }