From 0f0d23b266b3af05d429e4997c157221c12218cb Mon Sep 17 00:00:00 2001 From: "cata%netscape.com" Date: Wed, 1 Sep 1999 22:50:50 +0000 Subject: [PATCH] Fixing build warnings. Step 2: switch to use new method from the interface. --- htmlparser/src/nsScanner.cpp | 2 +- intl/chardet/tools/GenCyrillicClass.cpp | 2 +- intl/locale/src/mac/nsDateTimeFormatMac.cpp | 4 ++-- intl/locale/src/unix/nsDateTimeFormatUnix.cpp | 4 ++-- intl/locale/src/windows/nsDateTimeFormatWin.cpp | 4 ++-- intl/uconv/tests/convperf.cpp | 2 +- intl/uconv/tests/nsTestUConv.cpp | 4 ++-- intl/uconv/tests/nsconv.cpp | 2 +- mailnews/compose/src/nsMsgI18N.cpp | 2 +- parser/htmlparser/src/nsScanner.cpp | 2 +- xpcom/io/nsUnicharInputStream.cpp | 4 ++-- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/htmlparser/src/nsScanner.cpp b/htmlparser/src/nsScanner.cpp index 52c8dba59d00..a2bf6fc51750 100644 --- a/htmlparser/src/nsScanner.cpp +++ b/htmlparser/src/nsScanner.cpp @@ -255,7 +255,7 @@ PRBool nsScanner::Append(const char* aBuffer, PRUint32 aLen){ do { PRInt32 srcLength = aLen; PRInt32 unicharLength = unicharBufLen; - res = mUnicodeDecoder->Convert(unichars, 0, &unicharLength,aBuffer, 0, &srcLength ); + res = mUnicodeDecoder->Convert(aBuffer, &srcLength, unichars, &unicharLength); unichars[unicharLength]=0; //add this since the unicode converters can't be trusted to do so. diff --git a/intl/chardet/tools/GenCyrillicClass.cpp b/intl/chardet/tools/GenCyrillicClass.cpp index 4c87fc9c7af0..f30d7d54ca6b 100644 --- a/intl/chardet/tools/GenCyrillicClass.cpp +++ b/intl/chardet/tools/GenCyrillicClass.cpp @@ -85,7 +85,7 @@ PRUint8 CyrillicClass(nsIUnicodeDecoder* decoder, PRUint8 byte) PRInt32 blen = 1; PRInt32 ulen = 1; - nsresult res = decoder->Convert(ubuf,0,&ulen, (char*)&byte, 0, &blen); + nsresult res = decoder->Convert((char*)&byte, &blen, ubuf, &ulen); if(NS_SUCCEEDED(res) && (1 == ulen )) { ubuf[0] = nsCRT::ToUpper(ubuf[0]); diff --git a/intl/locale/src/mac/nsDateTimeFormatMac.cpp b/intl/locale/src/mac/nsDateTimeFormatMac.cpp index f791f829c423..f14e4523f9b0 100644 --- a/intl/locale/src/mac/nsDateTimeFormatMac.cpp +++ b/intl/locale/src/mac/nsDateTimeFormatMac.cpp @@ -360,8 +360,8 @@ nsresult nsDateTimeFormatMac::FormatTMTime(nsILocale* locale, PRUnichar *unichars = new PRUnichar [ unicharLength ]; if (nsnull != unichars) { - res = decoder->Convert(unichars, 0, &unicharLength, - aBuffer, 0, &srcLength); + res = decoder->Convert(aBuffer, &srcLength, + unichars, &unicharLength); if (NS_SUCCEEDED(res)) { stringOut.SetString(unichars, unicharLength); } diff --git a/intl/locale/src/unix/nsDateTimeFormatUnix.cpp b/intl/locale/src/unix/nsDateTimeFormatUnix.cpp index 0bfd299bad7a..b3ba355379cc 100644 --- a/intl/locale/src/unix/nsDateTimeFormatUnix.cpp +++ b/intl/locale/src/unix/nsDateTimeFormatUnix.cpp @@ -152,8 +152,8 @@ nsresult nsDateTimeFormatUnix::FormatTMTime(nsILocale* locale, PRUnichar *unichars = new PRUnichar [ unicharLength ]; if (nsnull != unichars) { - res = decoder->Convert(unichars, 0, &unicharLength, - strOut, 0, &srcLength); + res = decoder->Convert(strOut, &srcLength, + unichars, &unicharLength); if (NS_SUCCEEDED(res)) { stringOut.SetString(unichars, unicharLength); } diff --git a/intl/locale/src/windows/nsDateTimeFormatWin.cpp b/intl/locale/src/windows/nsDateTimeFormatWin.cpp index 425ecc27ebaa..a5ca0fd8ccdb 100644 --- a/intl/locale/src/windows/nsDateTimeFormatWin.cpp +++ b/intl/locale/src/windows/nsDateTimeFormatWin.cpp @@ -242,8 +242,8 @@ nsresult nsDateTimeFormatWin::ConvertToUnicode(const char *inString, const PRInt PRUnichar *unichars = outString; if (nsnull != unichars) { - res = decoder->Convert(unichars, 0, &unicharLength, - inString, 0, &srcLength); + res = decoder->Convert(inString, &srcLength, + unichars, &unicharLength); if (NS_SUCCEEDED(res)) { *outLen = unicharLength; } diff --git a/intl/uconv/tests/convperf.cpp b/intl/uconv/tests/convperf.cpp index f1898c135cd8..fb0a59365e4c 100644 --- a/intl/uconv/tests/convperf.cpp +++ b/intl/uconv/tests/convperf.cpp @@ -152,7 +152,7 @@ int main(int argc, const char** argv) { medsize=MEDBUFSIZE; - res = decoder->Convert(medbuffer, 0, &medsize,inbuffer,0,&insize); + res = decoder->Convert(inbuffer,&insize, medbuffer, &medsize); if(NS_FAILED(res)) { fprintf(stderr, "failed in decoder->Convert %x\n",res); return -1; diff --git a/intl/uconv/tests/nsTestUConv.cpp b/intl/uconv/tests/nsTestUConv.cpp index 8990bceeceb3..748a43495cc8 100644 --- a/intl/uconv/tests/nsTestUConv.cpp +++ b/intl/uconv/tests/nsTestUConv.cpp @@ -183,7 +183,7 @@ nsresult testDecoder(nsIUnicodeDecoder * aDec, PRInt32 destLen = GENERAL_BUFFER/2; // conversion - res = aDec->Convert(dest, 0, &destLen, aSrc, 0, &srcLen); + res = aDec->Convert(aSrc, &srcLen, dest, &destLen); // we want a perfect result here - the test data should be complete! if (res != NS_OK) { printf("ERROR at %s.easy.Decode() code=0x%x.\n",aTestName,res); @@ -305,7 +305,7 @@ nsresult testStressDecoder(nsIUnicodeDecoder * aDec, // controlled conversion for (;srcOff < aSrcLength;) { - res = aDec->Convert(dest, destOff, &destLen, aSrc, srcOff, &srcLen); + res = aDec->Convert(aSrc + srcOff, &srcLen, dest + destOff, &destLen); if (NS_FAILED(res)) { printf("ERROR at %s.stress.Convert() code=0x%x.\n",aTestName,res); return res; diff --git a/intl/uconv/tests/nsconv.cpp b/intl/uconv/tests/nsconv.cpp index 2e3abec5d72c..ecf2090b4677 100644 --- a/intl/uconv/tests/nsconv.cpp +++ b/intl/uconv/tests/nsconv.cpp @@ -107,7 +107,7 @@ int main(int argc, const char** argv) { medsize=MEDBUFSIZE; - res = decoder->Convert(medbuffer, 0, &medsize,inbuffer,0,&insize); + res = decoder->Convert(inbuffer,&insize, medbuffer, &medsize); if(NS_FAILED(res)) { fprintf(stderr, "failed in decoder->Convert %x\n",res); return -1; diff --git a/mailnews/compose/src/nsMsgI18N.cpp b/mailnews/compose/src/nsMsgI18N.cpp index 0974b0d141db..301517dfeceb 100644 --- a/mailnews/compose/src/nsMsgI18N.cpp +++ b/mailnews/compose/src/nsMsgI18N.cpp @@ -120,7 +120,7 @@ nsresult ConvertToUnicode(const nsString& aCharset, unichars = (PRUnichar *) PR_Malloc(unicharLength * sizeof(PRUnichar)); if (unichars != nsnull) { // convert to unicode - res = decoder->Convert(unichars, 0, &unicharLength, inCString, 0, &srcLen); + res = decoder->Convert(inCString, &srcLen, unichars, &unicharLength); outString.SetString(unichars, unicharLength); PR_Free(unichars); } diff --git a/parser/htmlparser/src/nsScanner.cpp b/parser/htmlparser/src/nsScanner.cpp index 52c8dba59d00..a2bf6fc51750 100644 --- a/parser/htmlparser/src/nsScanner.cpp +++ b/parser/htmlparser/src/nsScanner.cpp @@ -255,7 +255,7 @@ PRBool nsScanner::Append(const char* aBuffer, PRUint32 aLen){ do { PRInt32 srcLength = aLen; PRInt32 unicharLength = unicharBufLen; - res = mUnicodeDecoder->Convert(unichars, 0, &unicharLength,aBuffer, 0, &srcLength ); + res = mUnicodeDecoder->Convert(aBuffer, &srcLength, unichars, &unicharLength); unichars[unicharLength]=0; //add this since the unicode converters can't be trusted to do so. diff --git a/xpcom/io/nsUnicharInputStream.cpp b/xpcom/io/nsUnicharInputStream.cpp index 6edd8a12e6fd..0ef1d7db37ee 100644 --- a/xpcom/io/nsUnicharInputStream.cpp +++ b/xpcom/io/nsUnicharInputStream.cpp @@ -280,8 +280,8 @@ PRInt32 ConverterInputStream::Fill(nsresult * aErrorCode) // Now convert as much of the byte buffer to unicode as possible PRInt32 dstLen = mUnicharData->GetBufferSize(); PRInt32 srcLen = remainder + nb; - *aErrorCode = mConverter->Convert(mUnicharData->GetBuffer(), 0, &dstLen, - mByteData->GetBuffer(), 0, &srcLen); + *aErrorCode = mConverter->Convert(mByteData->GetBuffer(), &srcLen, + mUnicharData->GetBuffer(), &dstLen); mUnicharDataOffset = 0; mUnicharDataLength = dstLen; mByteDataOffset += srcLen;