mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +00:00
Fix x64 problems for WIN64.
This commit is contained in:
parent
6bfb7d8186
commit
fcf7bee64a
12 changed files with 52 additions and 22 deletions
|
|
@ -70,11 +70,42 @@ namespace Compiler
|
|||
|
||||
//------------------------------------------------------------
|
||||
|
||||
#ifdef TORQUE_CPU_X64
|
||||
// Fixed unsafe conversion from pointer to U32. @todo x64 revise
|
||||
U32 u32toSTEId = 0;
|
||||
typedef Map< U32, StringTableEntry > U32toSteMap;
|
||||
U32toSteMap u32toSTEMap;
|
||||
|
||||
StringTableEntry U32toSTE( U32 u )
|
||||
{
|
||||
// @todo x64 Added thread-safe convertion.
|
||||
const U32toSteMap::Iterator result = u32toSTEMap.find( u );
|
||||
AssertFatal( result != u32toSTEMap.end( ),
|
||||
"Don't converted U32 to STE. See evalSTEtoU32()." );
|
||||
return result->value;
|
||||
}
|
||||
|
||||
U32 evalSTEtoU32( StringTableEntry ste, U32 )
|
||||
{
|
||||
// @todo x64 Added thread-safe convertion.
|
||||
u32toSTEMap.insert( u32toSTEId++, ste );
|
||||
return (u32toSTEId - 1); // pointer to inserted
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
StringTableEntry U32toSTE(U32 u)
|
||||
{
|
||||
return *((StringTableEntry *) &u);
|
||||
}
|
||||
|
||||
U32 evalSTEtoU32(StringTableEntry ste, U32)
|
||||
{
|
||||
return *((U32 *) &ste);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
U32 compileSTEtoU32(StringTableEntry ste, U32 ip)
|
||||
{
|
||||
if(ste)
|
||||
|
|
|
|||
|
|
@ -218,10 +218,7 @@ namespace Compiler
|
|||
|
||||
//------------------------------------------------------------
|
||||
|
||||
inline StringTableEntry U32toSTE(U32 u)
|
||||
{
|
||||
return *((StringTableEntry *) &u);
|
||||
}
|
||||
StringTableEntry U32toSTE(U32 u);
|
||||
|
||||
extern U32 (*STEtoU32)(StringTableEntry ste, U32 ip);
|
||||
|
||||
|
|
|
|||
|
|
@ -696,7 +696,7 @@ namespace Con
|
|||
|
||||
extern void expandEscape(char *dest, const char *src);
|
||||
extern bool collapseEscape(char *buf);
|
||||
extern S32 HashPointer(StringTableEntry ptr);
|
||||
extern U32 HashPointer(StringTableEntry ptr);
|
||||
|
||||
|
||||
/// Extended information about a console function.
|
||||
|
|
|
|||
|
|
@ -262,9 +262,9 @@ void Dictionary::deleteVariables(const char *varString)
|
|||
}
|
||||
}
|
||||
|
||||
S32 HashPointer(StringTableEntry ptr)
|
||||
U32 HashPointer(StringTableEntry ptr)
|
||||
{
|
||||
return (S32)(((dsize_t)ptr) >> 2);
|
||||
return (U32)(((dsize_t)ptr) >> 2);
|
||||
}
|
||||
|
||||
Dictionary::Entry *Dictionary::lookup(StringTableEntry name)
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
//----------------------------------------------------------------------------
|
||||
extern S32 HashPointer(StringTableEntry e);
|
||||
extern U32 HashPointer(StringTableEntry e);
|
||||
|
||||
SimNameDictionary::SimNameDictionary()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue