From a888a1b2b8c8f26ea02e714f7e9933b355f6819c Mon Sep 17 00:00:00 2001 From: "rogerl%netscape.com" Date: Wed, 18 Oct 2000 23:55:47 +0000 Subject: [PATCH] Quiet warnings git-svn-id: svn://10.0.0.236/trunk@81413 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js/js2/icodegenerator.cpp | 44 +++++++++++++++--------------- mozilla/js/js2/xmlparser.cpp | 4 +-- mozilla/js/js2/xmlparser.h | 4 +-- mozilla/js2/src/icodegenerator.cpp | 44 +++++++++++++++--------------- mozilla/js2/src/xmlparser.cpp | 4 +-- mozilla/js2/src/xmlparser.h | 4 +-- 6 files changed, 52 insertions(+), 52 deletions(-) diff --git a/mozilla/js/js2/icodegenerator.cpp b/mozilla/js/js2/icodegenerator.cpp index 0202b84f6ef..f4c63f6e86f 100644 --- a/mozilla/js/js2/icodegenerator.cpp +++ b/mozilla/js/js2/icodegenerator.cpp @@ -1874,7 +1874,6 @@ TypedRegister ICodeGenerator::genStmt(StmtNode *p, LabelSet *currentLabelSet) ASSERT(v->name->getKind() == ExprNode::identifier); if (v->initializer) { IdentifierExprNode* idExpr = static_cast(v->name); - JSType* type = extractType(v->type); if (isStatic) { scg.setStatic(thisClass, idExpr->name, scg.genExpr(v->initializer)); scg.resetStatement(); @@ -2415,23 +2414,23 @@ void ICodeGenerator::readICode(const char *fileName) XMLNode *node = *i; if (node->name().compare(widenCString("class")) == 0) { - String className; - String superName; + String* className; + String* superName; JSClass* superclass = 0; - node->getValue(widenCString("name"), className); - if (node->getValue(widenCString("super"), superName)) { - const JSValue& superclassValue = mGlobal->getVariable(superName); + node->getValue(widenCString("name"), &className); + if (node->getValue(widenCString("super"), &superName)) { + const JSValue& superclassValue = mGlobal->getVariable(*superName); superclass = static_cast(superclassValue.object); } - JSClass* thisClass = new JSClass(mGlobal, className, superclass); + JSClass* thisClass = new JSClass(mGlobal, *className, superclass); JSScope* thisScope = thisClass->getScope(); ICodeGenerator scg(mWorld, thisScope, thisClass, kIsStaticMethod); ICodeGenerator ccg(mWorld, thisScope, thisClass, kNoFlags); ccg.allocateParameter(mWorld->identifiers["this"], thisClass); thisClass->defineStatic(mInitName, &Function_Type); - mGlobal->defineVariable(className, &Type_Type, JSValue(thisClass)); + mGlobal->defineVariable(*className, &Type_Type, JSValue(thisClass)); bool hasDefaultConstructor = false; XMLNodeList &elements = node->children(); @@ -2439,10 +2438,12 @@ void ICodeGenerator::readICode(const char *fileName) XMLNode *element = *j; if (element->name().compare(widenCString("method")) == 0) { - String methodName, resultTypeName; - element->getValue(widenCString("name"), methodName); - element->getValue(widenCString("result"), resultTypeName); + String *methodName, *resultTypeName; + element->getValue(widenCString("name"), &methodName); + element->getValue(widenCString("result"), &resultTypeName); +#ifdef ROB_DONE JSType *resultType = findType(mWorld->identifiers[resultTypeName]); +#endif String &body = element->body(); if (body.length()) { std::string str(body.length(), char()); @@ -2469,18 +2470,17 @@ void ICodeGenerator::readICode(const char *fileName) } else { if (element->name().compare(widenCString("field")) == 0) { - String fieldName; - String fieldType; + String *fieldName; + String *fieldType; - element->getValue(widenCString("name"), fieldName); - element->getValue(widenCString("type"), fieldType); - JSType *type = findType(mWorld->identifiers[fieldType]); + element->getValue(widenCString("name"), &fieldName); + element->getValue(widenCString("type"), &fieldType); + JSType *type = findType(mWorld->identifiers[*fieldType]); if (element->hasAttribute(widenCString("static"))) - thisClass->defineStatic(fieldName, type); - else { - const JSSlot& slot = thisClass->defineSlot(fieldName, type); - } + thisClass->defineStatic(*fieldName, type); + else + thisClass->defineSlot(*fieldName, type); } } } @@ -2496,8 +2496,8 @@ void ICodeGenerator::readICode(const char *fileName) if (thisClass->hasStatic(mInitName)) icg.call(icg.getStatic(thisClass, mInitName), thisValue, &args); icg.returnStmt(thisValue); - thisClass->defineConstructor(className); - scg.setStatic(thisClass, mWorld->identifiers[className], scg.newFunction(icg.complete(&Void_Type))); + thisClass->defineConstructor(*className); + scg.setStatic(thisClass, mWorld->identifiers[*className], scg.newFunction(icg.complete(&Void_Type))); } thisClass->complete(); diff --git a/mozilla/js/js2/xmlparser.cpp b/mozilla/js/js2/xmlparser.cpp index 4ac4d49a9f8..ce96bc14a3c 100644 --- a/mozilla/js/js2/xmlparser.cpp +++ b/mozilla/js/js2/xmlparser.cpp @@ -8,13 +8,13 @@ namespace JavaScript { -bool XMLTag::getValue(String &name, String &value) +bool XMLTag::getValue(String &name, String **value) { AttributeList::iterator i = mAttributeList.find(name); if (i == mAttributeList.end()) return false; else { - value = i->second; + *value = &i->second; return true; } } diff --git a/mozilla/js/js2/xmlparser.h b/mozilla/js/js2/xmlparser.h index 6594b1e9dd9..12b0a62e1dd 100644 --- a/mozilla/js/js2/xmlparser.h +++ b/mozilla/js/js2/xmlparser.h @@ -24,7 +24,7 @@ public: XMLTag(String name) : mName(name), mFlag(Tag) { } void addAttribute(String name, String value) { mAttributeList.insert(AttributeValue(name, value) ); } - bool getValue(String &name, String &value); + bool getValue(String &name, String **value); bool hasAttribute(String &name) { return (mAttributeList.find(name) != mAttributeList.end()); } String &name() { return mName; } @@ -72,7 +72,7 @@ public: void addChild(XMLNode *child) { mChildren.push_back(child); } XMLNodeList &children() { return mChildren; } - bool getValue(String &name, String &value) + bool getValue(String &name, String **value) { return mTag->getValue(name, value); } bool hasAttribute(String &name) { return mTag->hasAttribute(name); } diff --git a/mozilla/js2/src/icodegenerator.cpp b/mozilla/js2/src/icodegenerator.cpp index 0202b84f6ef..f4c63f6e86f 100644 --- a/mozilla/js2/src/icodegenerator.cpp +++ b/mozilla/js2/src/icodegenerator.cpp @@ -1874,7 +1874,6 @@ TypedRegister ICodeGenerator::genStmt(StmtNode *p, LabelSet *currentLabelSet) ASSERT(v->name->getKind() == ExprNode::identifier); if (v->initializer) { IdentifierExprNode* idExpr = static_cast(v->name); - JSType* type = extractType(v->type); if (isStatic) { scg.setStatic(thisClass, idExpr->name, scg.genExpr(v->initializer)); scg.resetStatement(); @@ -2415,23 +2414,23 @@ void ICodeGenerator::readICode(const char *fileName) XMLNode *node = *i; if (node->name().compare(widenCString("class")) == 0) { - String className; - String superName; + String* className; + String* superName; JSClass* superclass = 0; - node->getValue(widenCString("name"), className); - if (node->getValue(widenCString("super"), superName)) { - const JSValue& superclassValue = mGlobal->getVariable(superName); + node->getValue(widenCString("name"), &className); + if (node->getValue(widenCString("super"), &superName)) { + const JSValue& superclassValue = mGlobal->getVariable(*superName); superclass = static_cast(superclassValue.object); } - JSClass* thisClass = new JSClass(mGlobal, className, superclass); + JSClass* thisClass = new JSClass(mGlobal, *className, superclass); JSScope* thisScope = thisClass->getScope(); ICodeGenerator scg(mWorld, thisScope, thisClass, kIsStaticMethod); ICodeGenerator ccg(mWorld, thisScope, thisClass, kNoFlags); ccg.allocateParameter(mWorld->identifiers["this"], thisClass); thisClass->defineStatic(mInitName, &Function_Type); - mGlobal->defineVariable(className, &Type_Type, JSValue(thisClass)); + mGlobal->defineVariable(*className, &Type_Type, JSValue(thisClass)); bool hasDefaultConstructor = false; XMLNodeList &elements = node->children(); @@ -2439,10 +2438,12 @@ void ICodeGenerator::readICode(const char *fileName) XMLNode *element = *j; if (element->name().compare(widenCString("method")) == 0) { - String methodName, resultTypeName; - element->getValue(widenCString("name"), methodName); - element->getValue(widenCString("result"), resultTypeName); + String *methodName, *resultTypeName; + element->getValue(widenCString("name"), &methodName); + element->getValue(widenCString("result"), &resultTypeName); +#ifdef ROB_DONE JSType *resultType = findType(mWorld->identifiers[resultTypeName]); +#endif String &body = element->body(); if (body.length()) { std::string str(body.length(), char()); @@ -2469,18 +2470,17 @@ void ICodeGenerator::readICode(const char *fileName) } else { if (element->name().compare(widenCString("field")) == 0) { - String fieldName; - String fieldType; + String *fieldName; + String *fieldType; - element->getValue(widenCString("name"), fieldName); - element->getValue(widenCString("type"), fieldType); - JSType *type = findType(mWorld->identifiers[fieldType]); + element->getValue(widenCString("name"), &fieldName); + element->getValue(widenCString("type"), &fieldType); + JSType *type = findType(mWorld->identifiers[*fieldType]); if (element->hasAttribute(widenCString("static"))) - thisClass->defineStatic(fieldName, type); - else { - const JSSlot& slot = thisClass->defineSlot(fieldName, type); - } + thisClass->defineStatic(*fieldName, type); + else + thisClass->defineSlot(*fieldName, type); } } } @@ -2496,8 +2496,8 @@ void ICodeGenerator::readICode(const char *fileName) if (thisClass->hasStatic(mInitName)) icg.call(icg.getStatic(thisClass, mInitName), thisValue, &args); icg.returnStmt(thisValue); - thisClass->defineConstructor(className); - scg.setStatic(thisClass, mWorld->identifiers[className], scg.newFunction(icg.complete(&Void_Type))); + thisClass->defineConstructor(*className); + scg.setStatic(thisClass, mWorld->identifiers[*className], scg.newFunction(icg.complete(&Void_Type))); } thisClass->complete(); diff --git a/mozilla/js2/src/xmlparser.cpp b/mozilla/js2/src/xmlparser.cpp index 4ac4d49a9f8..ce96bc14a3c 100644 --- a/mozilla/js2/src/xmlparser.cpp +++ b/mozilla/js2/src/xmlparser.cpp @@ -8,13 +8,13 @@ namespace JavaScript { -bool XMLTag::getValue(String &name, String &value) +bool XMLTag::getValue(String &name, String **value) { AttributeList::iterator i = mAttributeList.find(name); if (i == mAttributeList.end()) return false; else { - value = i->second; + *value = &i->second; return true; } } diff --git a/mozilla/js2/src/xmlparser.h b/mozilla/js2/src/xmlparser.h index 6594b1e9dd9..12b0a62e1dd 100644 --- a/mozilla/js2/src/xmlparser.h +++ b/mozilla/js2/src/xmlparser.h @@ -24,7 +24,7 @@ public: XMLTag(String name) : mName(name), mFlag(Tag) { } void addAttribute(String name, String value) { mAttributeList.insert(AttributeValue(name, value) ); } - bool getValue(String &name, String &value); + bool getValue(String &name, String **value); bool hasAttribute(String &name) { return (mAttributeList.find(name) != mAttributeList.end()); } String &name() { return mName; } @@ -72,7 +72,7 @@ public: void addChild(XMLNode *child) { mChildren.push_back(child); } XMLNodeList &children() { return mChildren; } - bool getValue(String &name, String &value) + bool getValue(String &name, String **value) { return mTag->getValue(name, value); } bool hasAttribute(String &name) { return mTag->hasAttribute(name); }