get parser back on line

git-svn-id: svn://10.0.0.236/trunk@7243 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rickg%netscape.com
1998-08-04 19:04:14 +00:00
parent bad06dcb17
commit 647cb7ac32
4 changed files with 6 additions and 28 deletions

View File

@@ -37,17 +37,6 @@ static char* tagTable[] = {
"TR", "TT", "U", "UL", "VAR", "WBR", "XMP"
};
/**
* This method converts a tagname (string) into an int.
* Note that we use a caseless comparision, because the tag
* data we get is so inconsistent. It seems that doing a
* caseless compare is faster than constantly copying the
* tag name to a buffer, uppercasing, then comparing.
* @update gess8/4/98
* @param aTagname is the name of the tag to find an id for
* @return enumerated tag value (may be eHTMLTag_unknown).
*/
nsHTMLTag NS_TagToEnum(const char* aTagName) {
int low = 0;
int high = NS_HTML_TAG_MAX - 1;
@@ -57,7 +46,7 @@ nsHTMLTag NS_TagToEnum(const char* aTagName) {
if (result == 0)
return (nsHTMLTag) (middle + 1);
if (result < 0)
high = middle - 1;
high = middle - 1;
else
low = middle + 1;
}

View File

@@ -245,7 +245,7 @@ close(HEADER_FILE);
# Generate the source file
open(CPP_FILE, ">$file_base.cpp");
print CPP_FILE $copyright;
print CPP_FILE "#include <string.h>\n";
print CPP_FILE "#include \"nsCRT.h\"\n";
print CPP_FILE "#include \"$file_base.h\"\n\n";
# Print out table of tag names
@@ -276,7 +276,7 @@ nsHTMLTag NS_TagToEnum(const char* aTagName) {
int high = NS_HTML_TAG_MAX - 1;
while (low <= high) {
int middle = (low + high) >> 1;
int result = strcmp(aTagName, tagTable[middle]);
int result = nsCRT::strcasecmp(aTagName, tagTable[middle]);
if (result == 0)
return (nsHTMLTag) (middle + 1);
if (result < 0)

View File

@@ -37,17 +37,6 @@ static char* tagTable[] = {
"TR", "TT", "U", "UL", "VAR", "WBR", "XMP"
};
/**
* This method converts a tagname (string) into an int.
* Note that we use a caseless comparision, because the tag
* data we get is so inconsistent. It seems that doing a
* caseless compare is faster than constantly copying the
* tag name to a buffer, uppercasing, then comparing.
* @update gess8/4/98
* @param aTagname is the name of the tag to find an id for
* @return enumerated tag value (may be eHTMLTag_unknown).
*/
nsHTMLTag NS_TagToEnum(const char* aTagName) {
int low = 0;
int high = NS_HTML_TAG_MAX - 1;
@@ -57,7 +46,7 @@ nsHTMLTag NS_TagToEnum(const char* aTagName) {
if (result == 0)
return (nsHTMLTag) (middle + 1);
if (result < 0)
high = middle - 1;
high = middle - 1;
else
low = middle + 1;
}

View File

@@ -245,7 +245,7 @@ close(HEADER_FILE);
# Generate the source file
open(CPP_FILE, ">$file_base.cpp");
print CPP_FILE $copyright;
print CPP_FILE "#include <string.h>\n";
print CPP_FILE "#include \"nsCRT.h\"\n";
print CPP_FILE "#include \"$file_base.h\"\n\n";
# Print out table of tag names
@@ -276,7 +276,7 @@ nsHTMLTag NS_TagToEnum(const char* aTagName) {
int high = NS_HTML_TAG_MAX - 1;
while (low <= high) {
int middle = (low + high) >> 1;
int result = strcmp(aTagName, tagTable[middle]);
int result = nsCRT::strcasecmp(aTagName, tagTable[middle]);
if (result == 0)
return (nsHTMLTag) (middle + 1);
if (result < 0)