Browse Source

Fixes for 64bit compilation on OSX

James Urquhart 12 years ago
parent
commit
9b07d3df37

+ 4 - 0
engine/source/2d/core/SpriteBatchItem.h

@@ -134,7 +134,11 @@ public:
         // This should be as unique as possible as it is used for hashing.
         // This should be as unique as possible as it is used for hashing.
         operator const U32() const
         operator const U32() const
         {
         {
+#ifdef TORQUE_64
+            return (U64)(mArgString) * (U32)2654435761;
+#else
             return (U32)(mArgString) * (U32)2654435761;
             return (U32)(mArgString) * (U32)2654435761;
+#endif
         }
         }
 
 
         /// Value equality check for hashing.
         /// Value equality check for hashing.

+ 4 - 4
engine/source/2d/scene/Scene.cc

@@ -1669,11 +1669,11 @@ S32 Scene::findJointId( b2Joint* pJoint )
     AssertFatal( pJoint != NULL, "Joint cannot be NULL." );
     AssertFatal( pJoint != NULL, "Joint cannot be NULL." );
 
 
     // Find joint.
     // Find joint.
-    typeReverseJointHash::iterator itr = mReverseJoints.find( (U32)pJoint );
+    typeReverseJointHash::iterator itr = mReverseJoints.find( (U64)pJoint );
 
 
     if ( itr == mReverseJoints.end() )
     if ( itr == mReverseJoints.end() )
     {
     {
-        Con::warnf("The joint Id could not be found via a joint reference of %x", (U32)pJoint);
+        Con::warnf("The joint Id could not be found via a joint reference of %x", (U64)pJoint);
         return 0;
         return 0;
     }
     }
 
 
@@ -1700,7 +1700,7 @@ S32 Scene::createJoint( b2JointDef* pJointDef )
     AssertFatal( itr != mJoints.end(), "Joint already in hash table." );
     AssertFatal( itr != mJoints.end(), "Joint already in hash table." );
 
 
     // Insert reverse joint.
     // Insert reverse joint.
-    mReverseJoints.insert( (U32)pJoint, jointId );
+    mReverseJoints.insert( (U64)pJoint, jointId );
 
 
     return jointId;
     return jointId;
 }
 }
@@ -3798,7 +3798,7 @@ void Scene::SayGoodbye( b2Joint* pJoint )
 
 
     // Remove joint references.
     // Remove joint references.
     mJoints.erase( jointId );
     mJoints.erase( jointId );
-    mReverseJoints.erase( (U32)pJoint );
+    mReverseJoints.erase( (U64)pJoint );
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------

+ 4 - 0
engine/source/collection/hashTable.h

@@ -41,7 +41,11 @@ namespace Hash
 
 
    inline U32 hash(const void *data)
    inline U32 hash(const void *data)
    {
    {
+#ifdef TORQUE_64
+      return (U64)data;
+#else
       return (U32)data;
       return (U32)data;
+#endif
    }
    }
 
 
    U32 nextPrime(U32);
    U32 nextPrime(U32);

+ 48 - 48
engine/source/console/astNodes.cc

@@ -798,9 +798,9 @@ U32 VarNode::precompile(TypeReq type)
 
 
    precompileIdent(varName);
    precompileIdent(varName);
    if(arrayIndex)
    if(arrayIndex)
-      return arrayIndex->precompile(TypeReqString) + 6;
+      return arrayIndex->precompile(TypeReqString) + 7;
    else
    else
-      return 3;
+      return 4;
 }
 }
 
 
 U32 VarNode::compile(U32 *codeStream, U32 ip, TypeReq type)
 U32 VarNode::compile(U32 *codeStream, U32 ip, TypeReq type)
@@ -809,8 +809,8 @@ U32 VarNode::compile(U32 *codeStream, U32 ip, TypeReq type)
       return ip;
       return ip;
 
 
    codeStream[ip++] = arrayIndex ? OP_LOADIMMED_IDENT : OP_SETCURVAR;
    codeStream[ip++] = arrayIndex ? OP_LOADIMMED_IDENT : OP_SETCURVAR;
-   codeStream[ip] = STEtoU32(varName, ip);
-   ip++;
+   STEtoCode(varName, ip, codeStream);
+   ip += 2;
    if(arrayIndex)
    if(arrayIndex)
    {
    {
       codeStream[ip++] = OP_ADVANCE_STR;
       codeStream[ip++] = OP_ADVANCE_STR;
@@ -990,7 +990,7 @@ U32 ConstantNode::precompile(TypeReq type)
    if(type == TypeReqString)
    if(type == TypeReqString)
    {
    {
       precompileIdent(value);
       precompileIdent(value);
-      return 2;
+      return 3;
    }
    }
    else if(type == TypeReqNone)
    else if(type == TypeReqNone)
       return 0;
       return 0;
@@ -1007,8 +1007,8 @@ U32 ConstantNode::compile(U32 *codeStream, U32 ip, TypeReq type)
    {
    {
    case TypeReqString:
    case TypeReqString:
       codeStream[ip++] = OP_LOADIMMED_IDENT;
       codeStream[ip++] = OP_LOADIMMED_IDENT;
-      codeStream[ip] = STEtoU32(value, ip);
-      ip++;
+      STEtoCode(value, ip, codeStream);
+      ip += 2;
       break;
       break;
    case TypeReqUInt:
    case TypeReqUInt:
       codeStream[ip++] = OP_LOADIMMED_UINT;
       codeStream[ip++] = OP_LOADIMMED_UINT;
@@ -1064,12 +1064,12 @@ U32 AssignExprNode::precompile(TypeReq type)
    if(arrayIndex)
    if(arrayIndex)
    {
    {
       if(subType == TypeReqString)
       if(subType == TypeReqString)
-         return arrayIndex->precompile(TypeReqString) + retSize + addSize + 8;
+         return arrayIndex->precompile(TypeReqString) + retSize + addSize + 9;
       else
       else
-         return arrayIndex->precompile(TypeReqString) + retSize + addSize + 6;
+         return arrayIndex->precompile(TypeReqString) + retSize + addSize + 7;
    }
    }
    else
    else
-      return retSize + addSize + 3;
+      return retSize + addSize + 4;
 }
 }
 
 
 U32 AssignExprNode::compile(U32 *codeStream, U32 ip, TypeReq type)
 U32 AssignExprNode::compile(U32 *codeStream, U32 ip, TypeReq type)
@@ -1081,8 +1081,8 @@ U32 AssignExprNode::compile(U32 *codeStream, U32 ip, TypeReq type)
          codeStream[ip++] = OP_ADVANCE_STR;
          codeStream[ip++] = OP_ADVANCE_STR;
 
 
       codeStream[ip++] = OP_LOADIMMED_IDENT;
       codeStream[ip++] = OP_LOADIMMED_IDENT;
-      codeStream[ip] = STEtoU32(varName, ip);
-      ip++;
+      STEtoCode(varName, ip, codeStream);
+      ip += 2;
       codeStream[ip++] = OP_ADVANCE_STR;
       codeStream[ip++] = OP_ADVANCE_STR;
       ip = arrayIndex->compile(codeStream, ip, TypeReqString);
       ip = arrayIndex->compile(codeStream, ip, TypeReqString);
       codeStream[ip++] = OP_REWIND_STR;
       codeStream[ip++] = OP_REWIND_STR;
@@ -1093,8 +1093,8 @@ U32 AssignExprNode::compile(U32 *codeStream, U32 ip, TypeReq type)
    else
    else
    {
    {
       codeStream[ip++] = OP_SETCURVAR_CREATE;
       codeStream[ip++] = OP_SETCURVAR_CREATE;
-      codeStream[ip] = STEtoU32(varName, ip);
-      ip++;
+      STEtoCode(varName, ip, codeStream);
+      ip += 2;
    }
    }
    switch(subType)
    switch(subType)
    {
    {
@@ -1197,11 +1197,11 @@ U32 AssignOpExprNode::precompile(TypeReq type)
    if(type != subType)
    if(type != subType)
       size++;
       size++;
    if(!arrayIndex)
    if(!arrayIndex)
-      return size + 5;
+      return size + 6;
    else
    else
    {
    {
       size += arrayIndex->precompile(TypeReqString);
       size += arrayIndex->precompile(TypeReqString);
-      return size + 8;
+      return size + 9;
    }
    }
 }
 }
 
 
@@ -1211,14 +1211,14 @@ U32 AssignOpExprNode::compile(U32 *codeStream, U32 ip, TypeReq type)
    if(!arrayIndex)
    if(!arrayIndex)
    {
    {
       codeStream[ip++] = OP_SETCURVAR_CREATE;
       codeStream[ip++] = OP_SETCURVAR_CREATE;
-      codeStream[ip] = STEtoU32(varName, ip);
-      ip++;
+      STEtoCode(varName, ip, codeStream);
+      ip += 2;
    }
    }
    else
    else
    {
    {
       codeStream[ip++] = OP_LOADIMMED_IDENT;
       codeStream[ip++] = OP_LOADIMMED_IDENT;
-      codeStream[ip] = STEtoU32(varName, ip);
-      ip++;
+      STEtoCode(varName, ip, codeStream);
+      ip += 2;
       codeStream[ip++] = OP_ADVANCE_STR;
       codeStream[ip++] = OP_ADVANCE_STR;
       ip = arrayIndex->compile(codeStream, ip, TypeReqString);
       ip = arrayIndex->compile(codeStream, ip, TypeReqString);
       codeStream[ip++] = OP_REWIND_STR;
       codeStream[ip++] = OP_REWIND_STR;
@@ -1304,7 +1304,7 @@ U32 FuncCallExprNode::precompile(TypeReq type)
    precompileIdent(nameSpace);
    precompileIdent(nameSpace);
    for(ExprNode *walk = args; walk; walk = (ExprNode *) walk->getNext())
    for(ExprNode *walk = args; walk; walk = (ExprNode *) walk->getNext())
       size += walk->precompile(TypeReqString) + 1;
       size += walk->precompile(TypeReqString) + 1;
-   return size + 5;
+   return size + 7;
 }
 }
 
 
 U32 FuncCallExprNode::compile(U32 *codeStream, U32 ip, TypeReq type)
 U32 FuncCallExprNode::compile(U32 *codeStream, U32 ip, TypeReq type)
@@ -1320,10 +1320,10 @@ U32 FuncCallExprNode::compile(U32 *codeStream, U32 ip, TypeReq type)
    else
    else
       codeStream[ip++] = OP_CALLFUNC_RESOLVE;
       codeStream[ip++] = OP_CALLFUNC_RESOLVE;
 
 
-   codeStream[ip] = STEtoU32(funcName, ip);
-   ip++;
-   codeStream[ip] = STEtoU32(nameSpace, ip);
-   ip++;
+   STEtoCode(funcName, ip, codeStream);
+   ip += 2;
+   STEtoCode(nameSpace, ip, codeStream);
+   ip += 2;
    codeStream[ip++] = callType;
    codeStream[ip++] = callType;
    if(type != TypeReqString)
    if(type != TypeReqString)
       codeStream[ip++] = conversionOp(TypeReqString, type);
       codeStream[ip++] = conversionOp(TypeReqString, type);
@@ -1354,7 +1354,7 @@ U32 SlotAccessNode::precompile(TypeReq type)
       size += 3 + arrayExpr->precompile(TypeReqString);
       size += 3 + arrayExpr->precompile(TypeReqString);
    }
    }
    // eval object expression sub + 3 (op_setCurField + OP_SETCUROBJECT)
    // eval object expression sub + 3 (op_setCurField + OP_SETCUROBJECT)
-   size += objectExpr->precompile(TypeReqString) + 3;
+   size += objectExpr->precompile(TypeReqString) + 4;
 
 
    // get field in desired type:
    // get field in desired type:
    return size + 1;
    return size + 1;
@@ -1375,8 +1375,8 @@ U32 SlotAccessNode::compile(U32 *codeStream, U32 ip, TypeReq type)
    
    
    codeStream[ip++] = OP_SETCURFIELD;
    codeStream[ip++] = OP_SETCURFIELD;
    
    
-   codeStream[ip] = STEtoU32(slotName, ip);
-   ip++;
+   STEtoCode(slotName, ip, codeStream);
+   ip += 2;
 
 
    if(arrayExpr)
    if(arrayExpr)
    {
    {
@@ -1490,9 +1490,9 @@ U32 SlotAssignNode::precompile(TypeReq type)
    size += valueExpr->precompile(TypeReqString);
    size += valueExpr->precompile(TypeReqString);
 
 
    if(objectExpr)
    if(objectExpr)
-      size += objectExpr->precompile(TypeReqString) + 5;
+      size += objectExpr->precompile(TypeReqString) + 6;
    else
    else
-      size += 5;
+      size += 6;
 
 
    if(arrayExpr)
    if(arrayExpr)
       size += arrayExpr->precompile(TypeReqString) + 3;
       size += arrayExpr->precompile(TypeReqString) + 3;
@@ -1516,8 +1516,8 @@ U32 SlotAssignNode::compile(U32 *codeStream, U32 ip, TypeReq type)
    else
    else
       codeStream[ip++] = OP_SETCUROBJECT_NEW;
       codeStream[ip++] = OP_SETCUROBJECT_NEW;
    codeStream[ip++] = OP_SETCURFIELD;
    codeStream[ip++] = OP_SETCURFIELD;
-   codeStream[ip] = STEtoU32(slotName, ip);
-   ip++;
+   STEtoCode(slotName, ip, codeStream);
+   ip += 2;
    if(arrayExpr)
    if(arrayExpr)
    {
    {
       codeStream[ip++] = OP_TERMINATE_REWIND_STR;
       codeStream[ip++] = OP_TERMINATE_REWIND_STR;
@@ -1568,9 +1568,9 @@ U32 SlotAssignOpNode::precompile(TypeReq type)
    if(type != subType)
    if(type != subType)
       size++;
       size++;
    if(arrayExpr)
    if(arrayExpr)
-      return size + 9 + arrayExpr->precompile(TypeReqString) + objectExpr->precompile(TypeReqString);
+      return size + 10 + arrayExpr->precompile(TypeReqString) + objectExpr->precompile(TypeReqString);
    else
    else
-      return size + 6 + objectExpr->precompile(TypeReqString);
+      return size + 7 + objectExpr->precompile(TypeReqString);
 }
 }
 
 
 U32 SlotAssignOpNode::compile(U32 *codeStream, U32 ip, TypeReq type)
 U32 SlotAssignOpNode::compile(U32 *codeStream, U32 ip, TypeReq type)
@@ -1584,8 +1584,8 @@ U32 SlotAssignOpNode::compile(U32 *codeStream, U32 ip, TypeReq type)
    ip = objectExpr->compile(codeStream, ip, TypeReqString);
    ip = objectExpr->compile(codeStream, ip, TypeReqString);
    codeStream[ip++] = OP_SETCUROBJECT;
    codeStream[ip++] = OP_SETCUROBJECT;
    codeStream[ip++] = OP_SETCURFIELD;
    codeStream[ip++] = OP_SETCURFIELD;
-   codeStream[ip] = STEtoU32(slotName, ip);
-   ip++;
+   STEtoCode(slotName, ip, codeStream);
+   ip += 2;
    if(arrayExpr)
    if(arrayExpr)
    {
    {
       codeStream[ip++] = OP_TERMINATE_REWIND_STR;
       codeStream[ip++] = OP_TERMINATE_REWIND_STR;
@@ -1634,7 +1634,7 @@ U32 ObjectDeclNode::precompileSubObject(bool)
       argSize += exprWalk->precompile(TypeReqString) + 1;
       argSize += exprWalk->precompile(TypeReqString) + 1;
    argSize += classNameExpr->precompile(TypeReqString) + 1;
    argSize += classNameExpr->precompile(TypeReqString) + 1;
 
 
-   U32 nameSize = objectNameExpr->precompile(TypeReqString) + 2;
+   U32 nameSize = objectNameExpr->precompile(TypeReqString) + 3; // 2
 
 
    U32 slotSize = 0;
    U32 slotSize = 0;
    for(SlotAssignNode *slotWalk = slotDecls; slotWalk; slotWalk = (SlotAssignNode *) slotWalk->getNext())
    for(SlotAssignNode *slotWalk = slotDecls; slotWalk; slotWalk = (SlotAssignNode *) slotWalk->getNext())
@@ -1679,8 +1679,8 @@ U32 ObjectDeclNode::compileSubObject(U32 *codeStream, U32 ip, bool root)
       codeStream[ip++] = OP_PUSH;
       codeStream[ip++] = OP_PUSH;
    }
    }
    codeStream[ip++] = OP_CREATE_OBJECT;
    codeStream[ip++] = OP_CREATE_OBJECT;
-   codeStream[ip] = STEtoU32(parentObject, ip);
-   ip++;
+   STEtoCode(parentObject, ip, codeStream);
+   ip += 2;
    codeStream[ip++] = structDecl;
    codeStream[ip++] = structDecl;
    codeStream[ip++] = isClassNameInternal;
    codeStream[ip++] = isClassNameInternal;
    codeStream[ip++] = isMessage;
    codeStream[ip++] = isMessage;
@@ -1747,7 +1747,7 @@ U32 FunctionDeclStmtNode::precompileStmt(U32)
    setCurrentStringTable(&getGlobalStringTable());
    setCurrentStringTable(&getGlobalStringTable());
    setCurrentFloatTable(&getGlobalFloatTable());
    setCurrentFloatTable(&getGlobalFloatTable());
 
 
-   endOffset = argc + subSize + 8;
+   endOffset = (argc*2) + subSize + 11;
    return endOffset;
    return endOffset;
 }
 }
 
 
@@ -1755,19 +1755,19 @@ U32 FunctionDeclStmtNode::compileStmt(U32 *codeStream, U32 ip, U32, U32)
 {
 {
    U32 start = ip;
    U32 start = ip;
    codeStream[ip++] = OP_FUNC_DECL;
    codeStream[ip++] = OP_FUNC_DECL;
-   codeStream[ip] = STEtoU32(fnName, ip);
-   ip++;
-   codeStream[ip] = STEtoU32(nameSpace, ip);
-   ip++;
-   codeStream[ip] = STEtoU32(package, ip);
-   ip++;
+   STEtoCode(fnName, ip, codeStream);
+   ip += 2;
+   STEtoCode(nameSpace, ip, codeStream);
+   ip += 2;
+   STEtoCode(package, ip, codeStream);
+   ip += 2;
    codeStream[ip++] = bool(stmts != NULL);
    codeStream[ip++] = bool(stmts != NULL);
    codeStream[ip++] = start + endOffset;
    codeStream[ip++] = start + endOffset;
    codeStream[ip++] = argc;
    codeStream[ip++] = argc;
    for(VarNode *walk = args; walk; walk = (VarNode *)((StmtNode*)walk)->getNext())
    for(VarNode *walk = args; walk; walk = (VarNode *)((StmtNode*)walk)->getNext())
    {
    {
-      codeStream[ip] = STEtoU32(walk->varName, ip);
-      ip++;
+      STEtoCode(walk->varName, ip, codeStream);
+      ip += 2;
    }
    }
    CodeBlock::smInFunction = true;
    CodeBlock::smInFunction = true;
    ip = compileBlock(stmts, codeStream, ip, 0, 0);
    ip = compileBlock(stmts, codeStream, ip, 0, 0);

+ 8 - 3
engine/source/console/codeBlock.cc

@@ -453,13 +453,18 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st)
          ste = StringTable->insert(globalStrings + offset);
          ste = StringTable->insert(globalStrings + offset);
       else
       else
          ste = StringTable->EmptyString;
          ste = StringTable->EmptyString;
+      
       U32 count;
       U32 count;
       st.read(&count);
       st.read(&count);
       while(count--)
       while(count--)
       {
       {
          U32 ip;
          U32 ip;
          st.read(&ip);
          st.read(&ip);
-         code[ip] = *((U32 *) &ste);
+#ifdef TORQUE_64
+         *(U64*)(code+ip) = (U64)ste;
+#else
+         code[ip] = (U32)ste;
+#endif
       }
       }
    }
    }
 
 
@@ -476,7 +481,7 @@ bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, con
 
 
    consoleAllocReset();
    consoleAllocReset();
 
 
-   STEtoU32 = compileSTEtoU32;
+   STEtoCode = compileSTEtoCode;
 
 
    statementList = NULL;
    statementList = NULL;
 
 
@@ -566,7 +571,7 @@ bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, con
 
 
 const char *CodeBlock::compileExec(StringTableEntry fileName, const char *string, bool noCalls, int setFrame)
 const char *CodeBlock::compileExec(StringTableEntry fileName, const char *string, bool noCalls, int setFrame)
 {
 {
-   STEtoU32 = evalSTEtoU32;
+   STEtoCode = evalSTEtoCode;
    consoleAllocReset();
    consoleAllocReset();
 
 
    name = fileName;
    name = fileName;

+ 44 - 35
engine/source/console/compiledEval.cc

@@ -219,7 +219,7 @@ void CodeBlock::getFunctionArgs(char buffer[1024], U32 ip)
    buffer[0] = 0;
    buffer[0] = 0;
    for(U32 i = 0; i < fnArgc; i++)
    for(U32 i = 0; i < fnArgc; i++)
    {
    {
-      StringTableEntry var = U32toSTE(code[ip + i + 6]);
+      StringTableEntry var = CodeToSTE(code, ip + (i*2) + 6);
       
       
       // Add a comma so it looks nice!
       // Add a comma so it looks nice!
       if(i != 0)
       if(i != 0)
@@ -465,8 +465,8 @@ const char *CodeBlock::exec(U32 ip, const char *functionName, Namespace *thisNam
    if(argv)
    if(argv)
    {
    {
       // assume this points into a function decl:
       // assume this points into a function decl:
-      U32 fnArgc = code[ip + 5];
-      thisFunctionName = U32toSTE(code[ip]);
+      U32 fnArgc = code[ip + 2 + 6];
+      thisFunctionName = CodeToSTE(code, ip);
       argc = getMin(argc-1, fnArgc); // argv[0] is func name
       argc = getMin(argc-1, fnArgc); // argv[0] is func name
       if(gEvalState.traceOn)
       if(gEvalState.traceOn)
       {
       {
@@ -501,11 +501,11 @@ const char *CodeBlock::exec(U32 ip, const char *functionName, Namespace *thisNam
       popFrame = true;
       popFrame = true;
       for(i = 0; i < argc; i++)
       for(i = 0; i < argc; i++)
       {
       {
-         StringTableEntry var = U32toSTE(code[ip + i + 6]);
+         StringTableEntry var = CodeToSTE(code, ip + (2 + 6 + 1) + (i * 2));
          gEvalState.setCurVarNameCreate(var);
          gEvalState.setCurVarNameCreate(var);
          gEvalState.setStringVariable(argv[i+1]);
          gEvalState.setStringVariable(argv[i+1]);
       }
       }
-      ip = ip + fnArgc + 6;
+      ip = ip + (fnArgc * 2) + (2 + 6 + 1);
       curFloatTable = functionFloats;
       curFloatTable = functionFloats;
       curStringTable = functionStrings;
       curStringTable = functionStrings;
    }
    }
@@ -589,10 +589,10 @@ breakContinue:
          case OP_FUNC_DECL:
          case OP_FUNC_DECL:
             if(!noCalls)
             if(!noCalls)
             {
             {
-               fnName       = U32toSTE(code[ip]);
-               fnNamespace  = U32toSTE(code[ip+1]);
-               fnPackage    = U32toSTE(code[ip+2]);
-               bool hasBody = bool(code[ip+3]);
+               fnName       = CodeToSTE(code, ip);
+               fnNamespace  = CodeToSTE(code, ip+2);
+               fnPackage    = CodeToSTE(code, ip+4);
+               bool hasBody = bool(code[ip+6]);
                
                
                Namespace::unlinkPackages();
                Namespace::unlinkPackages();
                ns = Namespace::find(fnNamespace, fnPackage);
                ns = Namespace::find(fnNamespace, fnPackage);
@@ -615,17 +615,17 @@ breakContinue:
 
 
                //Con::printf("Adding function %s::%s (%d)", fnNamespace, fnName, ip);
                //Con::printf("Adding function %s::%s (%d)", fnNamespace, fnName, ip);
             }
             }
-            ip = code[ip + 4];
+            ip = code[ip + 7];
             break;
             break;
 
 
          case OP_CREATE_OBJECT:
          case OP_CREATE_OBJECT:
          {
          {
             // Read some useful info.
             // Read some useful info.
-            objParent        = U32toSTE(code[ip    ]);
-            bool isDataBlock =          code[ip + 1];
-            bool isInternal  =          code[ip + 2];
-            bool isMessage   =          code[ip + 3];
-            failJump         =          code[ip + 4];
+            objParent        = CodeToSTE(code, ip);
+            bool isDataBlock =          code[ip + 2];
+            bool isInternal  =          code[ip + 3];
+            bool isMessage   =          code[ip + 4];
+            failJump         =          code[ip + 5];
             
             
             // If we don't allow calls, we certainly don't allow creating objects!
             // If we don't allow calls, we certainly don't allow creating objects!
             // Moved this to after failJump is set. Engine was crashing when
             // Moved this to after failJump is set. Engine was crashing when
@@ -778,7 +778,7 @@ breakContinue:
             }
             }
 
 
             // Advance the IP past the create info...
             // Advance the IP past the create info...
-            ip += 5;
+            ip += 6;
             break;
             break;
          }
          }
 
 
@@ -1081,8 +1081,8 @@ breakContinue:
             break;
             break;
 
 
          case OP_SETCURVAR:
          case OP_SETCURVAR:
-            var = U32toSTE(code[ip]);
-            ip++;
+            var = CodeToSTE(code, ip);
+            ip += 2;
 
 
             // If a variable is set, then these must be NULL. It is necessary
             // If a variable is set, then these must be NULL. It is necessary
             // to set this here so that the vector parser can appropriately
             // to set this here so that the vector parser can appropriately
@@ -1101,8 +1101,8 @@ breakContinue:
             break;
             break;
 
 
          case OP_SETCURVAR_CREATE:
          case OP_SETCURVAR_CREATE:
-            var = U32toSTE(code[ip]);
-            ip++;
+            var = CodeToSTE(code, ip);
+            ip += 2;
 
 
             // See OP_SETCURVAR
             // See OP_SETCURVAR
             prevField = NULL;
             prevField = NULL;
@@ -1221,9 +1221,9 @@ breakContinue:
             // Save the previous field for parsing vector fields.
             // Save the previous field for parsing vector fields.
             prevField = curField;
             prevField = curField;
             dStrcpy( prevFieldArray, curFieldArray );
             dStrcpy( prevFieldArray, curFieldArray );
-            curField = U32toSTE(code[ip]);
+            curField = CodeToSTE(code, ip);
             curFieldArray[0] = 0;
             curFieldArray[0] = 0;
-            ip++;
+            ip += 2;
             break;
             break;
 
 
          case OP_SETCURFIELD_ARRAY:
          case OP_SETCURFIELD_ARRAY:
@@ -1410,20 +1410,21 @@ breakContinue:
             break;
             break;
 
 
          case OP_LOADIMMED_IDENT:
          case OP_LOADIMMED_IDENT:
-            STR.setStringValue(U32toSTE(code[ip++]));
+            STR.setStringValue(CodeToSTE(code, ip));
+            ip += 2;
             break;
             break;
 
 
          case OP_CALLFUNC_RESOLVE:
          case OP_CALLFUNC_RESOLVE:
             // This deals with a function that is potentially living in a namespace.
             // This deals with a function that is potentially living in a namespace.
-            fnNamespace = U32toSTE(code[ip+1]);
-            fnName      = U32toSTE(code[ip]);
+            fnNamespace = CodeToSTE(code, ip+2);
+            fnName      = CodeToSTE(code, ip);
 
 
             // Try to look it up.
             // Try to look it up.
             ns = Namespace::find(fnNamespace);
             ns = Namespace::find(fnNamespace);
             nsEntry = ns->lookup(fnName);
             nsEntry = ns->lookup(fnName);
             if(!nsEntry)
             if(!nsEntry)
             {
             {
-               ip+= 3;
+               ip+= 5;
                Con::warnf(ConsoleLogEntry::General,
                Con::warnf(ConsoleLogEntry::General,
                   "%s: Unable to find function %s%s%s",
                   "%s: Unable to find function %s%s%s",
                   getFileLine(ip-4), fnNamespace ? fnNamespace : "",
                   getFileLine(ip-4), fnNamespace ? fnNamespace : "",
@@ -1433,7 +1434,11 @@ breakContinue:
             }
             }
             // Now, rewrite our code a bit (ie, avoid future lookups) and fall
             // Now, rewrite our code a bit (ie, avoid future lookups) and fall
             // through to OP_CALLFUNC
             // through to OP_CALLFUNC
-            code[ip+1] = *((U32 *) &nsEntry);
+#ifdef TORQUE_64
+            *((U64*)(code+ip+2)) = ((U64)nsEntry);
+#else
+            code[ip+2] = ((U32)nsEntry);
+#endif
             code[ip-1] = OP_CALLFUNC;
             code[ip-1] = OP_CALLFUNC;
 
 
          case OP_CALLFUNC:
          case OP_CALLFUNC:
@@ -1444,7 +1449,7 @@ breakContinue:
             // or just on the object.
             // or just on the object.
             S32 routingId = 0;
             S32 routingId = 0;
 
 
-            fnName = U32toSTE(code[ip]);
+            fnName = CodeToSTE(code, ip);
 
 
             //if this is called from inside a function, append the ip and codeptr
             //if this is called from inside a function, append the ip and codeptr
             if (!gEvalState.stack.empty())
             if (!gEvalState.stack.empty())
@@ -1453,14 +1458,18 @@ breakContinue:
                gEvalState.stack.last()->ip = ip - 1;
                gEvalState.stack.last()->ip = ip - 1;
             }
             }
 
 
-            U32 callType = code[ip+2];
+            U32 callType = code[ip+4];
 
 
-            ip += 3;
+            ip += 5;
             STR.getArgcArgv(fnName, &callArgc, &callArgv);
             STR.getArgcArgv(fnName, &callArgc, &callArgv);
 
 
             if(callType == FuncCallExprNode::FunctionCall) 
             if(callType == FuncCallExprNode::FunctionCall) 
             {
             {
-               nsEntry = *((Namespace::Entry **) &code[ip-2]);
+#ifdef TORQUE_64
+               nsEntry = ((Namespace::Entry *) *((U64*)(code+ip-3)));
+#else
+               nsEntry = ((Namespace::Entry *) *(code+ip-3));
+#endif
                ns = NULL;
                ns = NULL;
             }
             }
             else if(callType == FuncCallExprNode::MethodCall)
             else if(callType == FuncCallExprNode::MethodCall)
@@ -1470,7 +1479,7 @@ breakContinue:
                if(!gEvalState.thisObject)
                if(!gEvalState.thisObject)
                {
                {
                   gEvalState.thisObject = 0;
                   gEvalState.thisObject = 0;
-                  Con::warnf(ConsoleLogEntry::General,"%s: Unable to find object: '%s' attempting to call function '%s'", getFileLine(ip-4), callArgv[1], fnName);
+                  Con::warnf(ConsoleLogEntry::General,"%s: Unable to find object: '%s' attempting to call function '%s'", getFileLine(ip-6), callArgv[1], fnName);
                   
                   
                   STR.popFrame(); // [neo, 5/7/2007 - #2974]
                   STR.popFrame(); // [neo, 5/7/2007 - #2974]
 
 
@@ -1527,7 +1536,7 @@ breakContinue:
             {
             {
                if(!noCalls && !( routingId == MethodOnComponent ) )
                if(!noCalls && !( routingId == MethodOnComponent ) )
                {
                {
-                  Con::warnf(ConsoleLogEntry::General,"%s: Unknown command %s.", getFileLine(ip-4), fnName);
+                  Con::warnf(ConsoleLogEntry::General,"%s: Unknown command %s.", getFileLine(ip-6), fnName);
                   if(callType == FuncCallExprNode::MethodCall)
                   if(callType == FuncCallExprNode::MethodCall)
                   {
                   {
                      Con::warnf(ConsoleLogEntry::General, "  Object %s(%d) %s",
                      Con::warnf(ConsoleLogEntry::General, "  Object %s(%d) %s",
@@ -1553,7 +1562,7 @@ breakContinue:
                const char* nsName = ns? ns->mName: "";
                const char* nsName = ns? ns->mName: "";
                if((nsEntry->mMinArgs && S32(callArgc) < nsEntry->mMinArgs) || (nsEntry->mMaxArgs && S32(callArgc) > nsEntry->mMaxArgs))
                if((nsEntry->mMinArgs && S32(callArgc) < nsEntry->mMinArgs) || (nsEntry->mMaxArgs && S32(callArgc) > nsEntry->mMaxArgs))
                {
                {
-                  Con::warnf(ConsoleLogEntry::Script, "%s: %s::%s - wrong number of arguments.", getFileLine(ip-4), nsName, fnName);
+                  Con::warnf(ConsoleLogEntry::Script, "%s: %s::%s - wrong number of arguments.", getFileLine(ip-6), nsName, fnName);
                   Con::warnf(ConsoleLogEntry::Script, "%s: usage: %s", getFileLine(ip-4), nsEntry->mUsage);
                   Con::warnf(ConsoleLogEntry::Script, "%s: usage: %s", getFileLine(ip-4), nsEntry->mUsage);
                   STR.popFrame();
                   STR.popFrame();
                }
                }
@@ -1618,7 +1627,7 @@ breakContinue:
                      case Namespace::Entry::VoidCallbackType:
                      case Namespace::Entry::VoidCallbackType:
                         nsEntry->cb.mVoidCallbackFunc(gEvalState.thisObject, callArgc, callArgv);
                         nsEntry->cb.mVoidCallbackFunc(gEvalState.thisObject, callArgc, callArgv);
                         if(code[ip] != OP_STR_TO_NONE)
                         if(code[ip] != OP_STR_TO_NONE)
-                           Con::warnf(ConsoleLogEntry::General, "%s: Call to %s in %s uses result of void function call.", getFileLine(ip-4), fnName, functionName);
+                           Con::warnf(ConsoleLogEntry::General, "%s: Call to %s in %s uses result of void function call.", getFileLine(ip-6), fnName, functionName);
                         
                         
                         STR.popFrame();
                         STR.popFrame();
                         STR.setStringValue("");
                         STR.setStringValue("");

+ 20 - 6
engine/source/console/compiler.cc

@@ -72,19 +72,33 @@ namespace Compiler
 
 
    //------------------------------------------------------------
    //------------------------------------------------------------
 
 
-   U32 evalSTEtoU32(StringTableEntry ste, U32)
+   StringTableEntry CodeToSTE(U32 *code, U32 ip)
    {
    {
-      return *((U32 *) &ste);
+#ifdef TORQUE_64
+      return (StringTableEntry)(*((U64*)(code+ip)));
+#else
+      return (StringTableEntry)(*(code+ip));
+#endif
    }
    }
-
-   U32 compileSTEtoU32(StringTableEntry ste, U32 ip)
+   
+   void evalSTEtoCode(StringTableEntry ste, U32 ip, U32 *codeStream)
+   {
+#ifdef TORQUE_64
+      *((U64*)(codeStream+ip)) = (U64)ste;
+#else
+      codeStream[ip] = (U32)ste;
+#endif
+   }
+   
+   void compileSTEtoCode(StringTableEntry ste, U32 ip, U32 *codeStream)
    {
    {
       if(ste)
       if(ste)
          getIdentTable().add(ste, ip);
          getIdentTable().add(ste, ip);
-      return 0;
+      codeStream[ip] = 0;
+      codeStream[ip+1] = 0;
    }
    }
 
 
-   U32 (*STEtoU32)(StringTableEntry ste, U32 ip) = evalSTEtoU32;
+   void (*STEtoCode)(StringTableEntry ste, U32 ip, U32 *codeStream) = evalSTEtoCode;
 
 
    //------------------------------------------------------------
    //------------------------------------------------------------
 
 

+ 5 - 9
engine/source/console/compiler.h

@@ -211,16 +211,12 @@ namespace Compiler
    };
    };
 
 
    //------------------------------------------------------------
    //------------------------------------------------------------
+   
+   extern StringTableEntry CodeToSTE(U32 *code, U32 ip);
+   extern void (*STEtoCode)(StringTableEntry ste, U32 ip, U32 *codeStream);
 
 
-   inline StringTableEntry U32toSTE(U32 u)
-   {
-      return *((StringTableEntry *) &u);
-   }
-
-   extern U32 (*STEtoU32)(StringTableEntry ste, U32 ip);
-
-   U32 evalSTEtoU32(StringTableEntry ste, U32);
-   U32 compileSTEtoU32(StringTableEntry ste, U32 ip);
+   void evalSTEtoCode(StringTableEntry ste, U32 ip, U32 *codeStream);
+   void compileSTEtoCode(StringTableEntry ste, U32 ip, U32 *codeStream);
 
 
    CompilerStringTable *getCurrentStringTable();
    CompilerStringTable *getCurrentStringTable();
    CompilerStringTable &getGlobalStringTable();
    CompilerStringTable &getGlobalStringTable();

+ 1 - 1
engine/source/console/console.cc

@@ -213,7 +213,7 @@ static U32 completionBaseStart;
 static U32 completionBaseLen;
 static U32 completionBaseLen;
 
 
 #ifdef TORQUE_MULTITHREAD
 #ifdef TORQUE_MULTITHREAD
-static S32 gMainThreadID = -1;
+static ThreadIdent gMainThreadID = -1;
 #endif
 #endif
 
 
 /// Current script file name and root, these are registered as
 /// Current script file name and root, these are registered as

+ 1 - 1
engine/source/console/consoleDictionary.cc

@@ -161,7 +161,7 @@ void Dictionary::deleteVariables(const char *varString)
 
 
 S32 HashPointer(StringTableEntry ptr)
 S32 HashPointer(StringTableEntry ptr)
 {
 {
-   return (S32)(((dsize_t)ptr) >> 2);
+   return (U32)(((dsize_t)ptr) >> 2);
 }
 }
 
 
 Dictionary::Entry *Dictionary::lookup(StringTableEntry name)
 Dictionary::Entry *Dictionary::lookup(StringTableEntry name)

+ 1 - 1
engine/source/debug/profiler.cc

@@ -35,7 +35,7 @@ ProfilerRootData *ProfilerRootData::sRootList = NULL;
 Profiler *gProfiler = NULL;
 Profiler *gProfiler = NULL;
 
 
 #ifdef TORQUE_MULTITHREAD
 #ifdef TORQUE_MULTITHREAD
-U32 gMainThread = 0;
+ThreadIdent gMainThread = 0;
 #endif
 #endif
 
 
 #if defined(TORQUE_SUPPORTS_VC_INLINE_X86_ASM)
 #if defined(TORQUE_SUPPORTS_VC_INLINE_X86_ASM)

+ 1 - 1
engine/source/io/resource/resourceDictionary.cc

@@ -47,7 +47,7 @@ ResDictionary::~ResDictionary()
 
 
 S32 ResDictionary::hash(StringTableEntry path, StringTableEntry file)
 S32 ResDictionary::hash(StringTableEntry path, StringTableEntry file)
 {
 {
-   return ((S32)((((dsize_t)path) >> 2) + (((dsize_t)file) >> 2) )) % hashTableSize;
+   return ((U32)((((dsize_t)path) >> 2) + (((dsize_t)file) >> 2) )) % hashTableSize;
 }
 }
 
 
 void ResDictionary::insert(ResourceObject *obj, StringTableEntry path, StringTableEntry file)
 void ResDictionary::insert(ResourceObject *obj, StringTableEntry path, StringTableEntry file)

+ 2 - 2
engine/source/platform/platformString.h

@@ -83,9 +83,9 @@ extern int dFflushStdout();
 extern int dFflushStderr();
 extern int dFflushStderr();
 
 
 extern void dPrintf(const char *format, ...);
 extern void dPrintf(const char *format, ...);
-extern int dVprintf(const char *format, void *arglist);
+extern int dVprintf(const char *format, va_list arglist);
 extern int dSprintf(char *buffer, dsize_t bufferSize, const char *format, ...);
 extern int dSprintf(char *buffer, dsize_t bufferSize, const char *format, ...);
-extern int dVsprintf(char *buffer, dsize_t bufferSize, const char *format, void *arglist);
+extern int dVsprintf(char *buffer, dsize_t bufferSize, const char *format, va_list arglist);
 
 
 #define QSORT_CALLBACK FN_CDECL
 #define QSORT_CALLBACK FN_CDECL
 extern void dQsort(void *base, U32 nelem, U32 width, int (QSORT_CALLBACK *fcmp)(const void *, const void *));
 extern void dQsort(void *base, U32 nelem, U32 width, int (QSORT_CALLBACK *fcmp)(const void *, const void *));

+ 14 - 8
engine/source/platform/threads/thread.h

@@ -33,6 +33,12 @@ struct PlatformThreadData;
 // Typedefs
 // Typedefs
 typedef void (*ThreadRunFunction)(void *data);
 typedef void (*ThreadRunFunction)(void *data);
 
 
+#ifdef TORQUE_64
+typedef U64 ThreadIdent;
+#else
+typedef U32 ThreadIdent;
+#endif
+
 class Thread
 class Thread
 {
 {
 protected:
 protected:
@@ -82,7 +88,7 @@ public:
    bool isAlive();
    bool isAlive();
 
 
    /// Returns the platform specific thread id for this thread.
    /// Returns the platform specific thread id for this thread.
-   U32 getId();
+   ThreadIdent getId();
 };
 };
 
 
 class ThreadManager 
 class ThreadManager 
@@ -101,18 +107,18 @@ class ThreadManager
 public:
 public:
 
 
    /// Returns true if threadId is the same as the calling thread's id.
    /// Returns true if threadId is the same as the calling thread's id.
-   static bool isCurrentThread(U32 threadId);
+   static bool isCurrentThread(ThreadIdent threadId);
 
 
    /// Returns true if the 2 thread ids represent the same thread. Some thread
    /// Returns true if the 2 thread ids represent the same thread. Some thread
    /// APIs return an opaque object as a thread id, so the == operator cannot
    /// APIs return an opaque object as a thread id, so the == operator cannot
    /// reliably compare thread ids.
    /// reliably compare thread ids.
    // this comparator is needed by pthreads and ThreadManager.
    // this comparator is needed by pthreads and ThreadManager.
-   static bool compare(U32 threadId_1, U32 threadId_2);
+   static bool compare(ThreadIdent threadId_1, ThreadIdent threadId_2);
       
       
    /// Returns the platform specific thread id of the calling thread. Some 
    /// Returns the platform specific thread id of the calling thread. Some 
    /// platforms do not guarantee that this ID stays the same over the life of 
    /// platforms do not guarantee that this ID stays the same over the life of 
    /// the thread, so use ThreadManager::compare() to compare thread ids.
    /// the thread, so use ThreadManager::compare() to compare thread ids.
-   static U32 getCurrentThreadId();
+   static ThreadIdent getCurrentThreadId();
    
    
    /// Each thread should add itself to the thread pool the first time it runs.
    /// Each thread should add itself to the thread pool the first time it runs.
    
    
@@ -131,7 +137,7 @@ public:
       ThreadManager &manager = *singleton();
       ThreadManager &manager = *singleton();
       manager.poolLock.lock();
       manager.poolLock.lock();
       
       
-      U32 threadID = thread->getId();
+      ThreadIdent threadID = thread->getId();
       for( U32 i = 0;i < (U32)manager.threadPool.size();++i)
       for( U32 i = 0;i < (U32)manager.threadPool.size();++i)
       {
       {
          if(manager.threadPool[i]->getId() == threadID)
          if(manager.threadPool[i]->getId() == threadID)
@@ -146,7 +152,7 @@ public:
    
    
    /// Searches the pool of known threads for a thread whose id is equivalent to
    /// Searches the pool of known threads for a thread whose id is equivalent to
    /// the given threadid. Compares thread ids with ThreadManager::compare().
    /// the given threadid. Compares thread ids with ThreadManager::compare().
-   static Thread* getThreadById(U32 threadid)
+   static Thread* getThreadById(ThreadIdent threadid)
    {
    {
       AssertFatal(threadid != 0, "ThreadManager::getThreadById() Searching for a bad thread id.");
       AssertFatal(threadid != 0, "ThreadManager::getThreadById() Searching for a bad thread id.");
       Thread* ret = NULL;
       Thread* ret = NULL;
@@ -172,9 +178,9 @@ public:
    }
    }
 };
 };
 
 
-inline bool ThreadManager::isCurrentThread(U32 threadId)
+inline bool ThreadManager::isCurrentThread(ThreadIdent threadId)
 {
 {
-   U32 current = getCurrentThreadId();
+   ThreadIdent current = getCurrentThreadId();
    return compare(current, threadId);
    return compare(current, threadId);
 }
 }
 
 

+ 6 - 0
engine/source/platform/types.gcc.h

@@ -112,6 +112,12 @@ typedef unsigned long long  U64;
 #  define TORQUE_CPU_X86
 #  define TORQUE_CPU_X86
 #  define TORQUE_LITTLE_ENDIAN
 #  define TORQUE_LITTLE_ENDIAN
 
 
+#elif defined(__amd64__)
+#  define TORQUE_CPU_STRING "Intel x86-64"
+#  define TORQUE_CPU_X86_64
+#  define TORQUE_LITTLE_ENDIAN
+#  define TORQUE_64
+
 #elif defined(__ppc__)
 #elif defined(__ppc__)
 #  define TORQUE_CPU_STRING "PowerPC"
 #  define TORQUE_CPU_STRING "PowerPC"
 #  define TORQUE_CPU_PPC
 #  define TORQUE_CPU_PPC

+ 1 - 1
engine/source/platform/types.h

@@ -140,7 +140,7 @@ inline U32 endianSwap(const U32 in_swap)
 
 
 // define all the variants of Offset that we might use
 // define all the variants of Offset that we might use
 #define _Offset_Normal(x, cls) ((dsize_t)((const char *)&(((cls *)1)->x)-(const char *)1))
 #define _Offset_Normal(x, cls) ((dsize_t)((const char *)&(((cls *)1)->x)-(const char *)1))
-#define _Offset_Variant_1(x, cls) ((int)(&((cls *)1)->x) - 1)
+#define _Offset_Variant_1(x, cls) ((dsize_t)(&((cls *)1)->x) - 1)
 #define _Offset_Variant_2(x, cls) offsetof(cls, x) // also requires #include <stddef.h>
 #define _Offset_Variant_2(x, cls) offsetof(cls, x) // also requires #include <stddef.h>
 
 
 // now, for each compiler type, define the Offset macros that should be used.
 // now, for each compiler type, define the Offset macros that should be used.

+ 1 - 1
engine/source/platformOSX/osxMutex.mm

@@ -35,7 +35,7 @@ struct PlatformMutexData
 {
 {
     pthread_mutex_t   mMutex;
     pthread_mutex_t   mMutex;
     bool              locked;
     bool              locked;
-    U32         lockedByThread;
+    ThreadIdent       lockedByThread;
 };
 };
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------

+ 4 - 4
engine/source/platformOSX/osxString.mm

@@ -404,9 +404,9 @@ void dPrintf(const char *format, ...)
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-int dVprintf(const char *format, void *arglist)
+int dVprintf(const char *format, va_list arglist)
 {
 {
-    S32 len = vprintf(format, (char*)arglist);
+    S32 len = vprintf(format, arglist);
     
     
     return (len);
     return (len);
 }
 }
@@ -427,9 +427,9 @@ int dSprintf(char *buffer, dsize_t bufferSize, const char *format, ...)
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-int dVsprintf(char *buffer, dsize_t bufferSize, const char *format, void *arglist)
+int dVsprintf(char *buffer, dsize_t bufferSize, const char *format, va_list arglist)
 {
 {
-	S32 len = vsprintf(buffer, format, (char*)arglist);
+	S32 len = vsprintf(buffer, format, arglist);
 
 
     // Sanity!
     // Sanity!
     AssertFatal(len <= bufferSize, "dSprintf - String format exceeded buffer size.  This will cause corruption.");
     AssertFatal(len <= bufferSize, "dSprintf - String format exceeded buffer size.  This will cause corruption.");

+ 5 - 5
engine/source/platformOSX/osxThread.mm

@@ -39,7 +39,7 @@ struct PlatformThreadData
     void*                   mRunArg;
     void*                   mRunArg;
     Thread*                 mThread;
     Thread*                 mThread;
     Semaphore               mGateway; // default count is 1
     Semaphore               mGateway; // default count is 1
-    U32                     mThreadID;
+    U64                     mThreadID;
 };
 };
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -160,7 +160,7 @@ bool Thread::isAlive()
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-U32 Thread::getId()
+ThreadIdent Thread::getId()
 {
 {
    return mData->mThreadID;
    return mData->mThreadID;
 }
 }
@@ -169,14 +169,14 @@ U32 Thread::getId()
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-U32 ThreadManager::getCurrentThreadId()
+ThreadIdent ThreadManager::getCurrentThreadId()
 {
 {
-   return (U32)pthread_self();
+   return (ThreadIdent)pthread_self();
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-bool ThreadManager::compare( U32 threadId_1, U32 threadId_2 )
+bool ThreadManager::compare( ThreadIdent threadId_1, ThreadIdent threadId_2 )
 {
 {
    return (bool)pthread_equal((pthread_t)threadId_1, (pthread_t)threadId_2);
    return (bool)pthread_equal((pthread_t)threadId_1, (pthread_t)threadId_2);
 }
 }

+ 4 - 4
engine/source/platformWin32/threads/thread.cc

@@ -38,7 +38,7 @@ struct PlatformThreadData
    Thread*                 mThread;
    Thread*                 mThread;
    HANDLE                  mThreadHnd;
    HANDLE                  mThreadHnd;
    Semaphore               mGateway;
    Semaphore               mGateway;
-   U32                     mThreadID;
+   ThreadIdent             mThreadID;
 
 
    PlatformThreadData()
    PlatformThreadData()
    {
    {
@@ -139,17 +139,17 @@ bool Thread::isAlive()
    return res != WAIT_OBJECT_0 && res != WAIT_FAILED;
    return res != WAIT_OBJECT_0 && res != WAIT_FAILED;
 }
 }
 
 
-U32 Thread::getId()
+ThreadIdent Thread::getId()
 {
 {
    return mData->mThreadID;
    return mData->mThreadID;
 }
 }
 
 
-U32 ThreadManager::getCurrentThreadId()
+ThreadIdent ThreadManager::getCurrentThreadId()
 {
 {
    return GetCurrentThreadId();
    return GetCurrentThreadId();
 }
 }
 
 
-bool ThreadManager::compare(U32 threadId_1, U32 threadId_2)
+bool ThreadManager::compare(ThreadIdent threadId_1, ThreadIdent threadId_2)
 {
 {
    return (threadId_1 == threadId_2);
    return (threadId_1 == threadId_2);
 }
 }

+ 4 - 4
engine/source/platformWin32/winStrings.cc

@@ -306,9 +306,9 @@ void dPrintf(const char *format, ...)
    vprintf(format, args);
    vprintf(format, args);
 }
 }
 
 
-S32 dVprintf(const char *format, void *arglist)
+S32 dVprintf(const char *format, va_list arglist)
 {
 {
-   S32 len = vprintf(format, (char*)arglist);
+   S32 len = vprintf(format, arglist);
    return (len);
    return (len);
 }
 }
 
 
@@ -325,9 +325,9 @@ S32 dSprintf(char *buffer, U32 bufferSize, const char *format, ...)
 }
 }
 
 
 
 
-S32 dVsprintf(char *buffer, U32 bufferSize, const char *format, void *arglist)
+S32 dVsprintf(char *buffer, U32 bufferSize, const char *format, va_list arglist)
 {
 {
-   S32 len = vsnprintf(buffer, bufferSize, format, (char*)arglist);
+   S32 len = vsnprintf(buffer, bufferSize, format, arglist);
     
     
    AssertFatal( (U32)len < bufferSize, "dVsprintf wrote to more memory than the specified buffer size - Stack Corruption Possible" );
    AssertFatal( (U32)len < bufferSize, "dVsprintf wrote to more memory than the specified buffer size - Stack Corruption Possible" );
 
 

+ 4 - 4
engine/source/platformX86UNIX/x86UNIXStrings.cc

@@ -332,9 +332,9 @@ void dPrintf(const char *format, ...)
    vprintf(format, args);
    vprintf(format, args);
 }   
 }   
 
 
-S32 dVprintf(const char *format, void *arglist)
+S32 dVprintf(const char *format, va_list arglist)
 {
 {
-   S32 len = vprintf(format, (char*)arglist);
+   S32 len = vprintf(format, arglist);
    return (len);
    return (len);
 }   
 }   
 
 
@@ -348,9 +348,9 @@ S32 dSprintf(char *buffer, U32 bufferSize, const char *format, ...)
 }   
 }   
 
 
 
 
-S32 dVsprintf(char *buffer, U32 bufferSize, const char *format, void *arglist)
+S32 dVsprintf(char *buffer, U32 bufferSize, const char *format, va_list arglist)
 {
 {
-   S32 len = vsnprintf(buffer, bufferSize, format, (char*)arglist);
+   S32 len = vsnprintf(buffer, bufferSize, format, arglist);
    return (len);
    return (len);
 }   
 }   
 
 

+ 2 - 2
engine/source/platformX86UNIX/x86UNIXThread.cc

@@ -129,9 +129,9 @@ bool Thread::isAlive()
   return false;
   return false;
 }
 }
 
 
-U32 Thread::getCurrentThreadId()
+ThreadIdent Thread::getCurrentThreadId()
 {
 {
-   return (U32)SDL_ThreadID();
+   return SDL_ThreadID();
 }
 }
 
 
 class PlatformThreadStorage
 class PlatformThreadStorage

+ 1 - 1
engine/source/platformiOS/iOSMutex.mm

@@ -34,7 +34,7 @@ struct PlatformMutexData
 {
 {
    pthread_mutex_t   mMutex;
    pthread_mutex_t   mMutex;
    bool              locked;
    bool              locked;
-   U32         lockedByThread;
+   ThreadIdent       lockedByThread;
 };
 };
 
 
 Mutex::Mutex(void)
 Mutex::Mutex(void)

+ 4 - 4
engine/source/platformiOS/iOSStrings.mm

@@ -322,9 +322,9 @@ void dPrintf(const char *format, ...)
    vprintf(format, args);
    vprintf(format, args);
 }   
 }   
 
 
-int dVprintf(const char *format, void *arglist)
+int dVprintf(const char *format, va_list arglist)
 {
 {
-   S32 len = vprintf(format, (char*)arglist);
+   S32 len = vprintf(format, arglist);
 
 
    return (len);
    return (len);
 }   
 }   
@@ -342,9 +342,9 @@ int dSprintf(char *buffer, dsize_t bufferSize, const char *format, ...)
 }   
 }   
 
 
 
 
-int dVsprintf(char *buffer, dsize_t bufferSize, const char *format, void *arglist)
+int dVsprintf(char *buffer, dsize_t bufferSize, const char *format, va_list arglist)
 {
 {
-	S32 len = vsprintf(buffer, format, (char*)arglist);
+	S32 len = vsprintf(buffer, format, arglist);
 
 
     // Sanity!
     // Sanity!
     AssertFatal(len <= bufferSize, "dSprintf - String format exceeded buffer size.  This will cause corruption.");
     AssertFatal(len <= bufferSize, "dSprintf - String format exceeded buffer size.  This will cause corruption.");

+ 5 - 5
engine/source/platformiOS/iOSThread.mm

@@ -34,7 +34,7 @@ struct PlatformThreadData
    void*                   mRunArg;
    void*                   mRunArg;
    Thread*                 mThread;
    Thread*                 mThread;
    Semaphore               mGateway; // default count is 1
    Semaphore               mGateway; // default count is 1
-   U32                     mThreadID;
+   ThreadIdent             mThreadID;
 };
 };
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -133,17 +133,17 @@ bool Thread::isAlive()
      return true; // we could not get the lock, it must be alive.
      return true; // we could not get the lock, it must be alive.
 }
 }
 
 
-U32 Thread::getId()
+ThreadIdent Thread::getId()
 {
 {
    return mData->mThreadID;
    return mData->mThreadID;
 }
 }
 
 
-U32 ThreadManager::getCurrentThreadId()
+ThreadIdent ThreadManager::getCurrentThreadId()
 {
 {
-   return (U32)pthread_self();
+   return (ThreadIdent)pthread_self();
 }
 }
 
 
-bool ThreadManager::compare(U32 threadId_1, U32 threadId_2)
+bool ThreadManager::compare(ThreadIdent threadId_1, ThreadIdent threadId_2)
 {
 {
    return (bool)pthread_equal((pthread_t)threadId_1, (pthread_t)threadId_2);
    return (bool)pthread_equal((pthread_t)threadId_1, (pthread_t)threadId_2);
 }
 }