mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 393080: Make count and offset in nsCSSScanner unsigned. r+sr=bzbarsky, a=dbaron
This commit is contained in:
parent
a5a4e42120
commit
e37155ba7f
@ -250,7 +250,7 @@ PR_STATIC_CALLBACK(int) CSSErrorsPrefChanged(const char *aPref, void *aClosure)
|
||||
}
|
||||
|
||||
void nsCSSScanner::Init(nsIUnicharInputStream* aInput,
|
||||
const PRUnichar * aBuffer, PRInt32 aCount,
|
||||
const PRUnichar * aBuffer, PRUint32 aCount,
|
||||
nsIURI* aURI, PRUint32 aLineNumber)
|
||||
{
|
||||
NS_PRECONDITION(!mInputStream, "Should not have an existing input stream!");
|
||||
@ -473,16 +473,13 @@ PRInt32 nsCSSScanner::Read(nsresult& aErrorCode)
|
||||
if (0 < mPushbackCount) {
|
||||
rv = PRInt32(mPushback[--mPushbackCount]);
|
||||
} else {
|
||||
if (mCount < 0) {
|
||||
return -1;
|
||||
}
|
||||
if (mOffset == mCount) {
|
||||
mOffset = 0;
|
||||
if (!mInputStream) {
|
||||
mCount = 0;
|
||||
return -1;
|
||||
}
|
||||
aErrorCode = mInputStream->Read(mBuffer, CSS_BUFFER_SIZE, (PRUint32*)&mCount);
|
||||
aErrorCode = mInputStream->Read(mBuffer, CSS_BUFFER_SIZE, &mCount);
|
||||
if (NS_FAILED(aErrorCode) || mCount == 0) {
|
||||
mCount = 0;
|
||||
return -1;
|
||||
|
@ -139,7 +139,7 @@ class nsCSSScanner {
|
||||
// when the line number is unknown.
|
||||
// Either aInput or (aBuffer and aCount) must be set.
|
||||
void Init(nsIUnicharInputStream* aInput,
|
||||
const PRUnichar *aBuffer, PRInt32 aCount,
|
||||
const PRUnichar *aBuffer, PRUint32 aCount,
|
||||
nsIURI* aURI, PRUint32 aLineNumber);
|
||||
void Close();
|
||||
|
||||
@ -225,8 +225,8 @@ protected:
|
||||
PRUnichar mBuffer[CSS_BUFFER_SIZE];
|
||||
|
||||
const PRUnichar *mReadPointer;
|
||||
PRInt32 mOffset;
|
||||
PRInt32 mCount;
|
||||
PRUint32 mOffset;
|
||||
PRUint32 mCount;
|
||||
PRUnichar* mPushback;
|
||||
PRInt32 mPushbackCount;
|
||||
PRInt32 mPushbackSize;
|
||||
|
Loading…
Reference in New Issue
Block a user