Clean up compiler warnings. Thanks, slamm!

git-svn-id: svn://10.0.0.236/trunk@38243 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
waterson%netscape.com 1999-07-03 04:43:44 +00:00
parent ea0549998b
commit 08fffac86f
2 changed files with 30 additions and 30 deletions

View File

@ -95,30 +95,30 @@ nsRDFParserUtils::StripAndConvert(nsString& aResult)
// should we be doing that? If so then it needs to live in two places (bad)
// so we should add a translate numeric entity method from the parser...
char cbuf[100];
PRInt32 index = 0;
while (index < aResult.Length()) {
PRInt32 i = 0;
while (i < aResult.Length()) {
// If we have the start of an entity (and it's not at the end of
// our string) then translate the entity into it's unicode value.
if ((aResult.CharAt(index++) == '&') && (index < aResult.Length())) {
PRInt32 start = index - 1;
PRUnichar e = aResult.CharAt(index);
if ((aResult.CharAt(i++) == '&') && (i < aResult.Length())) {
PRInt32 start = i - 1;
PRUnichar e = aResult.CharAt(i);
if (e == '#') {
// Convert a numeric character reference
index++;
i++;
char* cp = cbuf;
char* limit = cp + sizeof(cbuf) - 1;
PRBool ok = PR_FALSE;
PRInt32 slen = aResult.Length();
while ((index < slen) && (cp < limit)) {
PRUnichar e = aResult.CharAt(index);
if (e == ';') {
index++;
while ((i < slen) && (cp < limit)) {
PRUnichar f = aResult.CharAt(i);
if (f == ';') {
i++;
ok = PR_TRUE;
break;
}
if ((e >= '0') && (e <= '9')) {
*cp++ = char(e);
index++;
if ((f >= '0') && (f <= '9')) {
*cp++ = char(f);
i++;
continue;
}
break;
@ -137,31 +137,31 @@ nsRDFParserUtils::StripAndConvert(nsString& aResult)
// Remove entity from string and replace it with the integer
// value.
aResult.Cut(start, index - start);
aResult.Cut(start, i - start);
aResult.Insert(PRUnichar(ch), start);
index = start + 1;
i = start + 1;
}
else if (((e >= 'A') && (e <= 'Z')) ||
((e >= 'a') && (e <= 'z'))) {
// Convert a named entity
index++;
i++;
char* cp = cbuf;
char* limit = cp + sizeof(cbuf) - 1;
*cp++ = char(e);
PRBool ok = PR_FALSE;
PRInt32 slen = aResult.Length();
while ((index < slen) && (cp < limit)) {
PRUnichar e = aResult.CharAt(index);
if (e == ';') {
index++;
while ((i < slen) && (cp < limit)) {
PRUnichar f = aResult.CharAt(i);
if (f == ';') {
i++;
ok = PR_TRUE;
break;
}
if (((e >= '0') && (e <= '9')) ||
((e >= 'A') && (e <= 'Z')) ||
((e >= 'a') && (e <= 'z'))) {
*cp++ = char(e);
index++;
if (((f >= '0') && (f <= '9')) ||
((f >= 'A') && (f <= 'Z')) ||
((f >= 'a') && (f <= 'z'))) {
*cp++ = char(f);
i++;
continue;
}
break;
@ -183,9 +183,9 @@ nsRDFParserUtils::StripAndConvert(nsString& aResult)
// Remove entity from string and replace it with the integer
// value.
aResult.Cut(start, index - start);
aResult.Cut(start, i - start);
aResult.Insert(PRUnichar(ch), start);
index = start + 1;
i = start + 1;
}
else if (e == '{') {
// Convert a script entity

View File

@ -540,7 +540,7 @@ ServiceImpl::GetResource(const char* aURI, nsIRDFResource** aResource)
// Safely convert to a C-string for the XPCOM APIs
char buf[128];
char* progID = buf;
if (len >= sizeof(buf))
if (len >= PRInt32(sizeof buf))
progID = new char[len + 1];
if (progID == nsnull)
@ -589,7 +589,7 @@ ServiceImpl::GetUnicodeResource(const PRUnichar* aURI, nsIRDFResource** aResourc
char buf[128];
char* uri = buf;
if (uriStr.Length() >= sizeof(buf))
if (uriStr.Length() >= PRInt32(sizeof buf))
uri = new char[uriStr.Length() + 1];
uriStr.ToCString(uri, uriStr.Length() + 1);
@ -873,7 +873,7 @@ ServiceImpl::GetDataSource(const char* uri, nsIRDFDataSource** aDataSource)
// Safely convert it to a C-string for the XPCOM APIs
char buf[64];
char* progID = buf, *p;
if (progIDStr.Length() >= sizeof(buf))
if (progIDStr.Length() >= PRInt32(sizeof buf))
progID = new char[progIDStr.Length() + 1];
if (progID == nsnull)