Fixing build warnings. Step 2: switch to use new method from the interface.
This commit is contained in:
@@ -255,7 +255,7 @@ PRBool nsScanner::Append(const char* aBuffer, PRUint32 aLen){
|
|||||||
do {
|
do {
|
||||||
PRInt32 srcLength = aLen;
|
PRInt32 srcLength = aLen;
|
||||||
PRInt32 unicharLength = unicharBufLen;
|
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.
|
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 blen = 1;
|
||||||
PRInt32 ulen = 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 ))
|
if(NS_SUCCEEDED(res) && (1 == ulen ))
|
||||||
{
|
{
|
||||||
ubuf[0] = nsCRT::ToUpper(ubuf[0]);
|
ubuf[0] = nsCRT::ToUpper(ubuf[0]);
|
||||||
|
|||||||
@@ -360,8 +360,8 @@ nsresult nsDateTimeFormatMac::FormatTMTime(nsILocale* locale,
|
|||||||
PRUnichar *unichars = new PRUnichar [ unicharLength ];
|
PRUnichar *unichars = new PRUnichar [ unicharLength ];
|
||||||
|
|
||||||
if (nsnull != unichars) {
|
if (nsnull != unichars) {
|
||||||
res = decoder->Convert(unichars, 0, &unicharLength,
|
res = decoder->Convert(aBuffer, &srcLength,
|
||||||
aBuffer, 0, &srcLength);
|
unichars, &unicharLength);
|
||||||
if (NS_SUCCEEDED(res)) {
|
if (NS_SUCCEEDED(res)) {
|
||||||
stringOut.SetString(unichars, unicharLength);
|
stringOut.SetString(unichars, unicharLength);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,8 +152,8 @@ nsresult nsDateTimeFormatUnix::FormatTMTime(nsILocale* locale,
|
|||||||
PRUnichar *unichars = new PRUnichar [ unicharLength ];
|
PRUnichar *unichars = new PRUnichar [ unicharLength ];
|
||||||
|
|
||||||
if (nsnull != unichars) {
|
if (nsnull != unichars) {
|
||||||
res = decoder->Convert(unichars, 0, &unicharLength,
|
res = decoder->Convert(strOut, &srcLength,
|
||||||
strOut, 0, &srcLength);
|
unichars, &unicharLength);
|
||||||
if (NS_SUCCEEDED(res)) {
|
if (NS_SUCCEEDED(res)) {
|
||||||
stringOut.SetString(unichars, unicharLength);
|
stringOut.SetString(unichars, unicharLength);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,8 +242,8 @@ nsresult nsDateTimeFormatWin::ConvertToUnicode(const char *inString, const PRInt
|
|||||||
PRUnichar *unichars = outString;
|
PRUnichar *unichars = outString;
|
||||||
|
|
||||||
if (nsnull != unichars) {
|
if (nsnull != unichars) {
|
||||||
res = decoder->Convert(unichars, 0, &unicharLength,
|
res = decoder->Convert(inString, &srcLength,
|
||||||
inString, 0, &srcLength);
|
unichars, &unicharLength);
|
||||||
if (NS_SUCCEEDED(res)) {
|
if (NS_SUCCEEDED(res)) {
|
||||||
*outLen = unicharLength;
|
*outLen = unicharLength;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ int main(int argc, const char** argv)
|
|||||||
{
|
{
|
||||||
medsize=MEDBUFSIZE;
|
medsize=MEDBUFSIZE;
|
||||||
|
|
||||||
res = decoder->Convert(medbuffer, 0, &medsize,inbuffer,0,&insize);
|
res = decoder->Convert(inbuffer,&insize, medbuffer, &medsize);
|
||||||
if(NS_FAILED(res)) {
|
if(NS_FAILED(res)) {
|
||||||
fprintf(stderr, "failed in decoder->Convert %x\n",res);
|
fprintf(stderr, "failed in decoder->Convert %x\n",res);
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ nsresult testDecoder(nsIUnicodeDecoder * aDec,
|
|||||||
PRInt32 destLen = GENERAL_BUFFER/2;
|
PRInt32 destLen = GENERAL_BUFFER/2;
|
||||||
|
|
||||||
// conversion
|
// 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!
|
// we want a perfect result here - the test data should be complete!
|
||||||
if (res != NS_OK) {
|
if (res != NS_OK) {
|
||||||
printf("ERROR at %s.easy.Decode() code=0x%x.\n",aTestName,res);
|
printf("ERROR at %s.easy.Decode() code=0x%x.\n",aTestName,res);
|
||||||
@@ -305,7 +305,7 @@ nsresult testStressDecoder(nsIUnicodeDecoder * aDec,
|
|||||||
|
|
||||||
// controlled conversion
|
// controlled conversion
|
||||||
for (;srcOff < aSrcLength;) {
|
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)) {
|
if (NS_FAILED(res)) {
|
||||||
printf("ERROR at %s.stress.Convert() code=0x%x.\n",aTestName,res);
|
printf("ERROR at %s.stress.Convert() code=0x%x.\n",aTestName,res);
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ int main(int argc, const char** argv)
|
|||||||
{
|
{
|
||||||
medsize=MEDBUFSIZE;
|
medsize=MEDBUFSIZE;
|
||||||
|
|
||||||
res = decoder->Convert(medbuffer, 0, &medsize,inbuffer,0,&insize);
|
res = decoder->Convert(inbuffer,&insize, medbuffer, &medsize);
|
||||||
if(NS_FAILED(res)) {
|
if(NS_FAILED(res)) {
|
||||||
fprintf(stderr, "failed in decoder->Convert %x\n",res);
|
fprintf(stderr, "failed in decoder->Convert %x\n",res);
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ PRBool nsScanner::Append(const char* aBuffer, PRUint32 aLen){
|
|||||||
do {
|
do {
|
||||||
PRInt32 srcLength = aLen;
|
PRInt32 srcLength = aLen;
|
||||||
PRInt32 unicharLength = unicharBufLen;
|
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.
|
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
|
// Now convert as much of the byte buffer to unicode as possible
|
||||||
PRInt32 dstLen = mUnicharData->GetBufferSize();
|
PRInt32 dstLen = mUnicharData->GetBufferSize();
|
||||||
PRInt32 srcLen = remainder + nb;
|
PRInt32 srcLen = remainder + nb;
|
||||||
*aErrorCode = mConverter->Convert(mUnicharData->GetBuffer(), 0, &dstLen,
|
*aErrorCode = mConverter->Convert(mByteData->GetBuffer(), &srcLen,
|
||||||
mByteData->GetBuffer(), 0, &srcLen);
|
mUnicharData->GetBuffer(), &dstLen);
|
||||||
mUnicharDataOffset = 0;
|
mUnicharDataOffset = 0;
|
||||||
mUnicharDataLength = dstLen;
|
mUnicharDataLength = dstLen;
|
||||||
mByteDataOffset += srcLen;
|
mByteDataOffset += srcLen;
|
||||||
|
|||||||
Reference in New Issue
Block a user