mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
Fixing build warnings. Step 2: switch to use new method from the interface.
This commit is contained in:
parent
1019f15ff8
commit
0f0d23b266
@ -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.
|
||||
|
||||
|
||||
|
@ -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]);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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.
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user