Bug 203422 fix some warnings in netwerk p=gautheri@noos.fr r=andreas.otte sr=darin

This commit is contained in:
neil%parkwaycc.co.uk 2004-01-07 23:43:12 +00:00
Родитель 76e6b49f50
Коммит cac0311c73
4 изменённых файлов: 7 добавлений и 21 удалений

Просмотреть файл

@ -69,7 +69,7 @@ race_decode_decompress(const char *from, unsigned short *buf, size_t buflen)
unsigned short *p = buf;
unsigned int bitbuf = 0;
int bitlen = 0;
int i, j;
unsigned int i, j;
size_t len;
while (*from != '\0') {

Просмотреть файл

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ----- BEGIN LICENSE BLOCK -----
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -167,7 +167,7 @@ int ParseFTPList(const char *line, struct list_state *state,
while (pos < linelen && isdigit(line[pos]))
pos++;
if (pos < linelen && line[pos] == ',' &&
((&line[pos]) - (p+1)) < (sizeof(result->fe_size)-1) )
((&line[pos]) - (p+1)) < int(sizeof(result->fe_size)-1) )
{
memcpy( result->fe_size, p+1, (unsigned)(&line[pos] - (p+1)) );
result->fe_size[(&line[pos] - (p+1))] = '\0';

Просмотреть файл

@ -165,7 +165,6 @@ nsBinHexDecoder::OnDataAvailable(nsIRequest* request,
if (mOutputStream && mDataBuffer && aCount > 0)
{
PRUint32 numBytesRead = 0;
PRUint32 numBytesWritten = 0;
while (aCount > 0) // while we still have bytes to copy...
{
aStream->Read(mDataBuffer, PR_MIN(aCount, DATA_BUFFER_SIZE - 1), &numBytesRead);
@ -255,7 +254,7 @@ nsresult nsBinHexDecoder::ProcessNextState(nsIRequest * aRequest, nsISupports *
{
PRUint32 numBytesWritten = 0;
mOutputStream->Write(mOutgoingBuffer, mPosOutputBuff, &numBytesWritten);
if (numBytesWritten != mPosOutputBuff)
if (PRInt32(numBytesWritten) != mPosOutputBuff)
status = NS_ERROR_FAILURE;
// now propagate the data we just wrote
@ -269,9 +268,7 @@ nsresult nsBinHexDecoder::ProcessNextState(nsIRequest * aRequest, nsISupports *
if (status != NS_OK)
mState = BINHEX_STATE_DONE;
else
{
mState ++;
}
mInCRC = 1;
}
@ -281,7 +278,7 @@ nsresult nsBinHexDecoder::ProcessNextState(nsIRequest * aRequest, nsISupports *
{
PRUint32 numBytesWritten = 0;
mOutputStream->Write(mOutgoingBuffer, mPosOutputBuff, &numBytesWritten);
if (numBytesWritten != mPosOutputBuff)
if (PRInt32(numBytesWritten) != mPosOutputBuff)
status = NS_ERROR_FAILURE;
mNextListener->OnDataAvailable(aRequest, aContext, mInputStream, 0, numBytesWritten);
@ -294,9 +291,7 @@ nsresult nsBinHexDecoder::ProcessNextState(nsIRequest * aRequest, nsISupports *
case BINHEX_STATE_DCRC:
case BINHEX_STATE_RCRC:
if (!mCount++)
{
mFileCRC = (unsigned short) c << 8;
}
else
{
if ((mFileCRC | c) != mCRC)
@ -319,9 +314,7 @@ nsresult nsBinHexDecoder::ProcessNextState(nsIRequest * aRequest, nsISupports *
}
if (mState == BINHEX_STATE_DFORK)
{
mCount = PR_ntohl(mHeader.dlen);
}
else
{
// we aren't processing the resurce Fork. uncomment this line if we make this converter
@ -331,14 +324,10 @@ nsresult nsBinHexDecoder::ProcessNextState(nsIRequest * aRequest, nsISupports *
}
if (mCount)
{
mInCRC = 0;
}
else
{
/* nothing inside, so skip to the next state. */
mState ++;
}
}
break;
}
@ -396,7 +385,7 @@ nsresult nsBinHexDecoder::ProcessNextChunk(nsIRequest * aRequest, nsISupports *
c = GetNextChar(numBytesInBuffer);
if (c == 0) return NS_OK;
if ((val = BHEXVAL(c)) == -1)
if ((val = BHEXVAL(c)) == PRUint32(-1))
{
/* we incount an invalid character. */
if (c)
@ -437,9 +426,7 @@ nsresult nsBinHexDecoder::ProcessNextChunk(nsIRequest * aRequest, nsISupports *
else
{
while (--c > 0) /* we are in the run lenght mode */
{
ProcessNextState(aRequest, aContext);
}
}
mMarker = 0;
}

Просмотреть файл

@ -363,7 +363,7 @@ nsFTPDirListingConv::DigestBufferLines(char *aBuffer, nsCString &aString) {
if (type != 'd')
{
for (int i = 0; i < sizeof(result.fe_size); i++)
for (int i = 0; i < int(sizeof(result.fe_size)); ++i)
{
if (result.fe_size[i] != '\0')
aString.Append((const char*)&result.fe_size[i], 1);
@ -425,4 +425,3 @@ NS_NewFTPDirListingConv(nsFTPDirListingConv** aFTPDirListingConv)
NS_ADDREF(*aFTPDirListingConv);
return (*aFTPDirListingConv)->Init();
}