mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
More warning whining.
This commit is contained in:
parent
216cd29273
commit
68b8fcce5f
@ -2414,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<JSClass*>(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();
|
||||
@ -2438,9 +2438,9 @@ 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
|
||||
@ -2470,17 +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);
|
||||
thisClass->defineStatic(fieldName, type);
|
||||
else
|
||||
thisClass->defineSlot(*fieldName, type);
|
||||
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();
|
||||
|
||||
|
@ -8,13 +8,13 @@
|
||||
namespace JavaScript {
|
||||
|
||||
|
||||
bool XMLTag::getValue(String &name, String **value)
|
||||
bool XMLTag::getValue(const 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;
|
||||
}
|
||||
}
|
||||
|
@ -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(const 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(const String &name, String &value)
|
||||
{ return mTag->getValue(name, value); }
|
||||
bool hasAttribute(String &name) { return mTag->hasAttribute(name); }
|
||||
|
||||
|
@ -2414,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<JSClass*>(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();
|
||||
@ -2438,9 +2438,9 @@ 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
|
||||
@ -2470,17 +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);
|
||||
thisClass->defineStatic(fieldName, type);
|
||||
else
|
||||
thisClass->defineSlot(*fieldName, type);
|
||||
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();
|
||||
|
||||
|
@ -8,13 +8,13 @@
|
||||
namespace JavaScript {
|
||||
|
||||
|
||||
bool XMLTag::getValue(String &name, String **value)
|
||||
bool XMLTag::getValue(const 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;
|
||||
}
|
||||
}
|
||||
|
@ -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(const 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(const String &name, String &value)
|
||||
{ return mTag->getValue(name, value); }
|
||||
bool hasAttribute(String &name) { return mTag->hasAttribute(name); }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user