2
0
Jeff Hutchinson 4 жил өмнө
parent
commit
1b54162580

+ 1 - 3
Engine/source/console/astNodes.cpp

@@ -382,7 +382,7 @@ U32 IterStmtNode::compileStmt(CodeStream& codeStream, U32 ip)
    TypeReq varType = isStringIter ? TypeReqString : TypeReqUInt;
    TypeReq varType = isStringIter ? TypeReqString : TypeReqUInt;
 
 
    const U32 startIp = ip;
    const U32 startIp = ip;
-   containerExpr->compile(codeStream, startIp, TypeReqString); // todo: figure out better way to codegen this so we don't rely on STR
+   containerExpr->compile(codeStream, startIp, TypeReqString);
 
 
    codeStream.emit(isStringIter ? OP_ITER_BEGIN_STR : OP_ITER_BEGIN);
    codeStream.emit(isStringIter ? OP_ITER_BEGIN_STR : OP_ITER_BEGIN);
    codeStream.emit(isGlobal);
    codeStream.emit(isGlobal);
@@ -544,8 +544,6 @@ void IntBinaryExprNode::getSubTypeOperand()
 
 
 U32 IntBinaryExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type)
 U32 IntBinaryExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type)
 {
 {
-   // TODO: What if we do other optimizations and this doesn't work for it..this
-   // so far only works for simple MOD optimizations...
    if (optimize())
    if (optimize())
       right = optimizedNode;
       right = optimizedNode;
 
 

+ 1 - 2
Engine/source/console/console.cpp

@@ -1921,9 +1921,8 @@ StringTableEntry getModNameFromPath(const char *path)
 
 
 void postConsoleInput( RawData data )
 void postConsoleInput( RawData data )
 {
 {
-   // TODO(JTH): Mem leak
    // Schedule this to happen at the next time event.
    // Schedule this to happen at the next time event.
-   ConsoleValue* argv = new ConsoleValue[2]();
+   ConsoleValue argv[2];
    argv[0].setString("eval");
    argv[0].setString("eval");
    argv[1].setString(reinterpret_cast<const char*>(data.data));
    argv[1].setString(reinterpret_cast<const char*>(data.data));
 
 

+ 0 - 1
Engine/source/console/console.h

@@ -133,7 +133,6 @@ struct ConsoleValueConsoleType
    EnumTable* enumTable;
    EnumTable* enumTable;
 };
 };
 
 
-// TODO: replace malloc/free with custom allocator...
 class ConsoleValue
 class ConsoleValue
 {
 {
    union
    union

+ 2 - 10
Engine/source/console/simSet.cpp

@@ -231,20 +231,13 @@ void SimSet::scriptSort( const String &scriptCallbackFn )
 
 
 void SimSet::callOnChildren( const String &method, S32 argc, ConsoleValue argv[], bool executeOnChildGroups )
 void SimSet::callOnChildren( const String &method, S32 argc, ConsoleValue argv[], bool executeOnChildGroups )
 {
 {
-   // TODO(JTH): Implement
-   AssertISV(false, "TODO Implement");
-   return;
-
-   /*
    // Prep the arguments for the console exec...
    // Prep the arguments for the console exec...
    // Make sure and leave args[1] empty.
    // Make sure and leave args[1] empty.
    ConsoleValue args[21] = { };
    ConsoleValue args[21] = { };
-   ConsoleValue name_method;
-   name_method.setStackStringValue(method.c_str());
-   args[0] = ConsoleValueRef::fromValue(&name_method);
+   args[0].setString(method.c_str());
 
 
    for (S32 i = 0; i < argc; i++)
    for (S32 i = 0; i < argc; i++)
-      args[i + 2] = argv[i];
+      args[i + 2].setString(argv[i].getString());
 
 
    for( iterator i = begin(); i != end(); i++ )
    for( iterator i = begin(); i != end(); i++ )
    {
    {
@@ -260,7 +253,6 @@ void SimSet::callOnChildren( const String &method, S32 argc, ConsoleValue argv[]
             childSet->callOnChildren( method, argc, argv, executeOnChildGroups );
             childSet->callOnChildren( method, argc, argv, executeOnChildGroups );
       }
       }
    }
    }
-   */
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------