Browse Source

Update core GM to VS2017.
Remove older GME solution and projects.

Greg 8 years ago
parent
commit
5cf1079776
42 changed files with 490 additions and 2247 deletions
  1. 4 3
      .gitignore
  2. 6 6
      gmsrc/src/binds/gmArrayLib.cpp
  3. 2 2
      gmsrc/src/binds/gmCall.h
  4. 7 7
      gmsrc/src/binds/gmHelpers.cpp
  5. 11 11
      gmsrc/src/binds/gmHelpers.h
  6. 87 87
      gmsrc/src/binds/gmMathLib.cpp
  7. 8 8
      gmsrc/src/binds/gmStringLib.cpp
  8. 2 2
      gmsrc/src/binds/gmSystemLib.cpp
  9. 63 63
      gmsrc/src/binds/gmVector3Lib.cpp
  10. 1 1
      gmsrc/src/gm/bison.simple
  11. 28 28
      gmsrc/src/gm/gmArraySimple.h
  12. 4 4
      gmsrc/src/gm/gmByteCode.cpp
  13. 23 4
      gmsrc/src/gm/gmByteCodeGen.cpp
  14. 2 0
      gmsrc/src/gm/gmByteCodeGen.h
  15. 34 36
      gmsrc/src/gm/gmCodeGen.cpp
  16. 33 34
      gmsrc/src/gm/gmCodeTree.cpp
  17. 2 2
      gmsrc/src/gm/gmCodeTree.h
  18. 1 1
      gmsrc/src/gm/gmConfig.h
  19. 1 1
      gmsrc/src/gm/gmDebug.cpp
  20. 6 6
      gmsrc/src/gm/gmHash.h
  21. 4 4
      gmsrc/src/gm/gmLibHooks.cpp
  22. 10 14
      gmsrc/src/gm/gmMachine.cpp
  23. 14 14
      gmsrc/src/gm/gmMachineLib.cpp
  24. 1 1
      gmsrc/src/gm/gmMem.h
  25. 5 5
      gmsrc/src/gm/gmOperators.cpp
  26. 4 4
      gmsrc/src/gm/gmParser.y
  27. 5 5
      gmsrc/src/gm/gmStream.h
  28. 24 24
      gmsrc/src/gm/gmStreamBuffer.cpp
  29. 18 18
      gmsrc/src/gm/gmStreamBuffer.h
  30. 1 1
      gmsrc/src/gm/gmTableObject.h
  31. 10 9
      gmsrc/src/gm/gmThread.cpp
  32. 10 10
      gmsrc/src/gm/gmThread.h
  33. 15 0
      gmsrc/src/gm/gmUtil.h
  34. 2 2
      gmsrc/src/gm/gmVariable.cpp
  35. 11 12
      gmsrc/src/gm/gmVariable.h
  36. 8 8
      gmsrc/src/gme/gme.cpp
  37. 0 438
      gmsrc/src/gme/gme.dsp
  38. 0 33
      gmsrc/src/gme/gme.dsw
  39. 0 1314
      gmsrc/src/gme/gme.vcproj
  40. 6 1
      gmsrc/src/gme/gme.vcxproj
  41. 0 20
      gmsrc/src/gme/gme_VC8.sln
  42. 17 4
      gmsrc/src/platform/win32msvc/gmConfig_p.h

+ 4 - 3
.gitignore

@@ -51,8 +51,9 @@ log.txt
 */bin/gml.debug.exe
 */bin/gml.exe
 */bin/gml.exe
-*/*/gm/gmParser.cpp
-*/*/gm/gmParser.cpp.h
-*/*/gm/gmScanner.cpp
+# Generated code. We may want to check this in for convenience
+# */*/gm/gmParser.cpp
+# */*/gm/gmParser.cpp.h
+# */*/gm/gmScanner.cpp
 gmdoc.html
 gmdoc.xml

+ 6 - 6
gmsrc/src/binds/gmArrayLib.cpp

@@ -197,7 +197,7 @@ static int GM_CDECL gmfArray(gmThread * a_thread) // size
 {
   GM_INT_PARAM(size, 0, 0);
   gmUserArray * array = (gmUserArray *) a_thread->GetMachine()->Sys_Alloc(sizeof(gmUserArray));
-  array->Construct(a_thread->GetMachine(), size);
+  array->Construct(a_thread->GetMachine(), (int)size);
   a_thread->PushNewUser(array, GM_ARRAY);
   return GM_OK;
 }
@@ -222,7 +222,7 @@ static int GM_CDECL gmfArrayResize(gmThread * a_thread) // size
   if(arrayObject->m_user)
   {
     gmUserArray * array = (gmUserArray *) arrayObject->m_user;
-    array->Resize(a_thread->GetMachine(), size);
+    array->Resize(a_thread->GetMachine(), (int)size);
   }
   return GM_OK;
 }
@@ -237,7 +237,7 @@ static int GM_CDECL gmfArrayShift(gmThread * a_thread) // shift
   if(arrayObject->m_user)
   {
     gmUserArray * array = (gmUserArray *) arrayObject->m_user;
-    array->Shift(shift);
+    array->Shift((int)shift);
   }
   return GM_OK;
 }
@@ -254,7 +254,7 @@ static int GM_CDECL gmfArrayMove(gmThread * a_thread) // dst, src, size
   if(arrayObject->m_user)
   {
     gmUserArray * array = (gmUserArray *) arrayObject->m_user;
-    array->Move(dst, src, size);
+    array->Move((int)dst, (int)src, (int)size);
   }
   return GM_OK;
 }
@@ -266,7 +266,7 @@ static void GM_CDECL gmArrayGetInd(gmThread * a_thread, gmVariable * a_operands)
   gmUserArray * array = (gmUserArray *) arrayObject->m_user;
   if(a_operands[1].m_type == GM_INT)
   {
-    int index = a_operands[1].m_value.m_int;
+    int index = (int)a_operands[1].m_value.m_int;
     *a_operands = array->GetAt(index);
     return;
   }
@@ -280,7 +280,7 @@ static void GM_CDECL gmArraySetInd(gmThread * a_thread, gmVariable * a_operands)
   gmUserArray * array = (gmUserArray *) arrayObject->m_user;
   if(a_operands[1].m_type == GM_INT)
   {
-    int index = a_operands[1].m_value.m_int;
+    int index = (int)a_operands[1].m_value.m_int;
 
 #if GM_USE_INCGC
     //Apply write barrier

+ 2 - 2
gmsrc/src/binds/gmCall.h

@@ -333,7 +333,7 @@ public:
 
   /// \brief Get returned int
   /// \return true if function returned an int. 
-  bool GetReturnedInt(int& a_value)
+  bool GetReturnedInt(gmint& a_value)
   {
     if(m_returnFlag && (m_returnVar.m_type == GM_INT))
     {
@@ -345,7 +345,7 @@ public:
 
   /// \brief Get returned float
   /// \return true if function returned an float. 
-  bool GetReturnedFloat(float& a_value)
+  bool GetReturnedFloat(gmfloat& a_value)
   {
     if(m_returnFlag && (m_returnVar.m_type == GM_FLOAT))
     {

+ 7 - 7
gmsrc/src/binds/gmHelpers.cpp

@@ -17,11 +17,11 @@
   \brief gmRandomInt() returns a random int b/n two values
   \return number is >= min and < max (exclusive of max)
 */
-int gmRandomInt(int a_min, int a_max)
+gmint gmRandomInt(gmint a_min, gmint a_max)
 {
   if(a_min > a_max)
   {
-    int temp = a_max;
+    gmint temp = a_max;
     a_max = a_min;
     a_min = temp;
   }
@@ -30,8 +30,8 @@ int gmRandomInt(int a_min, int a_max)
     return a_min; // hmmm, not good.
   }
  
-  int randVal = rand();
-  int val = (randVal % (a_max - a_min)) + a_min;
+  gmint randVal = rand();
+  gmint val = (randVal % (a_max - a_min)) + a_min;
  
   return val;
 }
@@ -41,11 +41,11 @@ int gmRandomInt(int a_min, int a_max)
   \brief gmRandomInt() returns a random int b/n two values
   \return number is >= min and < max (exclusive of max)
 */
-float gmRandomFloat(float a_min, float a_max)
+gmfloat gmRandomFloat(gmfloat a_min, gmfloat a_max)
 {
   if(a_min > a_max)
   {
-    float temp = a_max;
+    gmfloat temp = a_max;
     a_max = a_min;
     a_min = temp;
   }
@@ -55,6 +55,6 @@ float gmRandomFloat(float a_min, float a_max)
   }
   
   int randVal = rand() % RAND_MAX;
-  float frandVal = (float)randVal / (float)RAND_MAX;
+  gmfloat frandVal = (gmfloat)randVal / (gmfloat)RAND_MAX;
   return a_min + (frandVal * (a_max - a_min));
 }

+ 11 - 11
gmsrc/src/binds/gmHelpers.h

@@ -20,7 +20,7 @@
 // Helpers
 //
 
-#define GM_PI_VALUE 3.1415927f
+#define GM_PI_VALUE 3.14159265358979323846
 
 // Clamp value between to range
 template <class TYPE>
@@ -91,11 +91,11 @@ GM_FORCEINLINE TYPE gmMax3(const TYPE a_x, const TYPE a_y, const TYPE a_z)
   }
 }
 
-GM_FORCEINLINE float gmGetFloatOrIntParamAsFloat(gmThread * a_thread, int a_paramIndex)
+GM_FORCEINLINE gmfloat gmGetFloatOrIntParamAsFloat(gmThread * a_thread, int a_paramIndex)
 {
   if(a_thread->ParamType(a_paramIndex) == GM_INT)
   {
-    return (float)a_thread->Param(a_paramIndex).m_value.m_int;
+    return (gmfloat)a_thread->Param(a_paramIndex).m_value.m_int;
   }
   else
   {
@@ -104,7 +104,7 @@ GM_FORCEINLINE float gmGetFloatOrIntParamAsFloat(gmThread * a_thread, int a_para
 }
 
 
-GM_FORCEINLINE bool gmGetFloatOrIntParamAsFloat(gmThread * a_thread, int a_paramIndex, float& a_retValue)
+GM_FORCEINLINE bool gmGetFloatOrIntParamAsFloat(gmThread * a_thread, int a_paramIndex, gmfloat& a_retValue)
 {
   if(a_thread->ParamType(a_paramIndex) == GM_INT)
   {
@@ -122,7 +122,7 @@ GM_FORCEINLINE bool gmGetFloatOrIntParamAsFloat(gmThread * a_thread, int a_param
   }
 }
 
-GM_FORCEINLINE int gmGetFloatOrIntParamAsInt(gmThread * a_thread, int a_paramIndex)
+GM_FORCEINLINE gmint gmGetFloatOrIntParamAsInt(gmThread * a_thread, int a_paramIndex)
 {
   if(a_thread->ParamType(a_paramIndex) == GM_INT)
   {
@@ -134,7 +134,7 @@ GM_FORCEINLINE int gmGetFloatOrIntParamAsInt(gmThread * a_thread, int a_paramInd
   }
 }
 
-GM_FORCEINLINE bool gmGetFloatOrIntParamAsInt(gmThread * a_thread, int a_paramIndex, int& a_retValue)
+GM_FORCEINLINE bool gmGetFloatOrIntParamAsInt(gmThread * a_thread, int a_paramIndex, gmint& a_retValue)
 {
   if(a_thread->ParamType(a_paramIndex) == GM_INT)
   {
@@ -157,23 +157,23 @@ GM_FORCEINLINE bool gmGetFloatOrIntParamAsInt(gmThread * a_thread, int a_paramIn
          Beware of overflow since ints are only 32bit on Intel
   \return number is >= min and < max (exclusive of max)
 */
-int gmRandomInt(int a_min, int a_max);
+gmint gmRandomInt(gmint a_min, gmint a_max);
 
 /*!
   \brief gmRandomInt() returns a random int b/n two values
          Note this is a low precision random value since it is generated from an int.
   \return number is >= min and < max (exclusive of max)
 */
-float gmRandomFloat(float a_min, float a_max);
+gmfloat gmRandomFloat(gmfloat a_min, gmfloat a_max);
 
 /*!
   \brief Returns the sine and cosine of values
          Note should make platform specific version
 */
-GM_FORCEINLINE void gmSinCos(const float a_angle, float& a_sin, float& a_cos)
+GM_FORCEINLINE void gmSinCos(const gmfloat a_angle, gmfloat& a_sin, gmfloat& a_cos)
 {
-  a_sin = (float)sinf(a_angle);
-  a_cos = (float)cosf(a_angle);
+  a_sin = (gmfloat)sin(a_angle);
+  a_cos = (gmfloat)cos(a_angle);
 }
 
 #endif // _GMHELPERS_H_

+ 87 - 87
gmsrc/src/binds/gmMathLib.cpp

@@ -29,7 +29,7 @@ int GM_CDECL gmfToString(gmThread * a_thread)
   if(GM_INT == var->m_type)
   {
     char numberAsStringBuffer[64];
-    sprintf(numberAsStringBuffer, "%d", var->m_value.m_int); // this won't be > 64 chars
+    sprintf(numberAsStringBuffer, "%lld", (gmint64)var->m_value.m_int); // this won't be > 64 chars
     a_thread->PushNewString(numberAsStringBuffer);
   }
   else if (GM_FLOAT == var->m_type)
@@ -157,7 +157,7 @@ static int GM_CDECL gmfRandSeed(gmThread * a_thread)
   GM_CHECK_NUM_PARAMS(1);
   GM_CHECK_INT_PARAM(seed, 0);
   
-  srand(seed);
+  srand((unsigned int)seed);
   
   return GM_OK;
 }
@@ -170,15 +170,15 @@ static int GM_CDECL gmfAbs(gmThread * a_thread)
 
   if(a_thread->ParamType(0) == GM_INT)
   {
-    int intValue = a_thread->Param(0).m_value.m_int;
+    gmint intValue = a_thread->Param(0).m_value.m_int;
     a_thread->PushInt(abs(intValue));
 
     return GM_OK;
   }
   else if(a_thread->ParamType(0) == GM_FLOAT)
   {
-    float floatValue = a_thread->Param(0).m_value.m_float;
-    a_thread->PushFloat((float)fabsf(floatValue));
+    gmfloat floatValue = a_thread->Param(0).m_value.m_float;
+    a_thread->PushFloat((gmfloat)fabs(floatValue));
 
     return GM_OK;
   }
@@ -194,15 +194,15 @@ static int GM_CDECL gmfSqrt(gmThread * a_thread)
 
   if(a_thread->ParamType(0) == GM_INT)
   {
-    int intValue = a_thread->Param(0).m_value.m_int;
-    a_thread->PushInt((int)sqrtf((float)intValue));
+    gmint intValue = a_thread->Param(0).m_value.m_int;
+    a_thread->PushInt((gmint)sqrt((gmfloat)intValue));
 
     return GM_OK;
   }
   else if(a_thread->ParamType(0) == GM_FLOAT)
   {
-    float floatValue = a_thread->Param(0).m_value.m_float;
-    a_thread->PushFloat(sqrtf(floatValue));
+    gmfloat floatValue = a_thread->Param(0).m_value.m_float;
+    a_thread->PushFloat(sqrt(floatValue));
 
     return GM_OK;
   }
@@ -216,26 +216,26 @@ static int GM_CDECL gmfPower(gmThread * a_thread)
 {
   GM_CHECK_NUM_PARAMS(2);
 
-  int minType = gmMin<int>(a_thread->ParamType(0), a_thread->ParamType(1));
+  gmint minType = gmMin<int>(a_thread->ParamType(0), a_thread->ParamType(1));
   if(minType < GM_INT)
   {
     return GM_EXCEPTION;
   }
-  int maxType = gmMax<int>(a_thread->ParamType(0), a_thread->ParamType(1));
+  gmint maxType = gmMax<int>(a_thread->ParamType(0), a_thread->ParamType(1));
 
   if(maxType == GM_INT)
   {
-    int valX = a_thread->Param(0).m_value.m_int;
-    int valY = a_thread->Param(1).m_value.m_int;
-    a_thread->PushInt((int)pow((float)valX, (float)valY));
+    gmint valX = a_thread->Param(0).m_value.m_int;
+    gmint valY = a_thread->Param(1).m_value.m_int;
+    a_thread->PushInt((gmint)pow((gmfloat)valX, (gmfloat)valY));
 
     return GM_OK;
   }
   else if(maxType == GM_FLOAT)
   {
-    float valX = gmGetFloatOrIntParamAsFloat(a_thread, 0);
-    float valY = gmGetFloatOrIntParamAsFloat(a_thread, 1);
-    a_thread->PushFloat((float)pow(valX, valY));
+    gmfloat valX = gmGetFloatOrIntParamAsFloat(a_thread, 0);
+    gmfloat valY = gmGetFloatOrIntParamAsFloat(a_thread, 1);
+    a_thread->PushFloat((gmfloat)pow(valX, valY));
 
     return GM_OK;
   }
@@ -253,15 +253,15 @@ static int GM_CDECL gmfFloor(gmThread * a_thread)
 
   if(a_thread->ParamType(0) == GM_INT) //Do nothing if Int
   {
-    int intValue = a_thread->Param(0).m_value.m_int;
+    gmint intValue = a_thread->Param(0).m_value.m_int;
     a_thread->PushInt(intValue);
 
     return GM_OK;
   }
   else if(a_thread->ParamType(0) == GM_FLOAT)
   {
-    float floatValue = a_thread->Param(0).m_value.m_float;
-    a_thread->PushFloat(floorf(floatValue));
+    gmfloat floatValue = a_thread->Param(0).m_value.m_float;
+    a_thread->PushFloat(floor(floatValue));
 
     return GM_OK;
   }
@@ -277,15 +277,15 @@ static int GM_CDECL gmfCeil(gmThread * a_thread)
 
   if(a_thread->ParamType(0) == GM_INT) //Do nothing if Int
   {
-    int intValue = a_thread->Param(0).m_value.m_int;
+    gmint intValue = a_thread->Param(0).m_value.m_int;
     a_thread->PushInt(intValue);
 
     return GM_OK;
   }
   else if(a_thread->ParamType(0) == GM_FLOAT)
   {
-    float floatValue = a_thread->Param(0).m_value.m_float;
-    a_thread->PushFloat(ceilf(floatValue));
+    gmfloat floatValue = a_thread->Param(0).m_value.m_float;
+    a_thread->PushFloat(ceil(floatValue));
 
     return GM_OK;
   }
@@ -301,15 +301,15 @@ static int GM_CDECL gmfRound(gmThread * a_thread)
 
   if(a_thread->ParamType(0) == GM_INT) //Do nothing if Int
   {
-    int intValue = a_thread->Param(0).m_value.m_int;
+    gmint intValue = a_thread->Param(0).m_value.m_int;
     a_thread->PushInt(intValue);
 
     return GM_OK;
   }
   else if(a_thread->ParamType(0) == GM_FLOAT)
   {
-    float floatValue = a_thread->Param(0).m_value.m_float;
-    a_thread->PushFloat(floorf(floatValue + 0.5f));
+    gmfloat floatValue = a_thread->Param(0).m_value.m_float;
+    a_thread->PushFloat(floor(floatValue + gmfloat(0.5)));
 
     return GM_OK;
   }
@@ -323,13 +323,13 @@ static int GM_CDECL gmfDegToRad(gmThread * a_thread)
 {
   GM_CHECK_NUM_PARAMS(1);
 
-  float floatValue;
+  gmfloat floatValue;
 
-  if(a_thread->ParamType(0) == GM_INT) { floatValue = (float) a_thread->Param(0).m_value.m_int; }
+  if(a_thread->ParamType(0) == GM_INT) { floatValue = (gmfloat) a_thread->Param(0).m_value.m_int; }
   else if(a_thread->ParamType(0) == GM_FLOAT) { floatValue = a_thread->Param(0).m_value.m_float; }
   else { return GM_EXCEPTION; }
 
-  a_thread->PushFloat( floatValue * (GM_PI_VALUE / 180.0f) );
+  a_thread->PushFloat( floatValue * (gmfloat(GM_PI_VALUE) / gmfloat(180.0)) );
 
   return GM_OK;
 }
@@ -340,13 +340,13 @@ static int GM_CDECL gmfRadToDeg(gmThread * a_thread)
 {
   GM_CHECK_NUM_PARAMS(1);
 
-  float floatValue;
+  gmfloat floatValue;
 
-  if(a_thread->ParamType(0) == GM_INT) { floatValue = (float) a_thread->Param(0).m_value.m_int; }
+  if(a_thread->ParamType(0) == GM_INT) { floatValue = (gmfloat) a_thread->Param(0).m_value.m_int; }
   else if(a_thread->ParamType(0) == GM_FLOAT) { floatValue = a_thread->Param(0).m_value.m_float; }
   else { return GM_EXCEPTION; }
 
-  a_thread->PushFloat( floatValue * (180.0f / GM_PI_VALUE) );
+  a_thread->PushFloat( floatValue * (gmfloat(180.0) / gmfloat(GM_PI_VALUE)) );
 
   return GM_OK;
 }
@@ -357,13 +357,13 @@ static int GM_CDECL gmfSin(gmThread * a_thread)
 {
   GM_CHECK_NUM_PARAMS(1);
 
-  float floatValue;
+  gmfloat floatValue;
 
-  if(a_thread->ParamType(0) == GM_INT) { floatValue = (float) a_thread->Param(0).m_value.m_int; }
+  if(a_thread->ParamType(0) == GM_INT) { floatValue = (gmfloat) a_thread->Param(0).m_value.m_int; }
   else if(a_thread->ParamType(0) == GM_FLOAT) { floatValue = a_thread->Param(0).m_value.m_float; }
   else { return GM_EXCEPTION; }
 
-  a_thread->PushFloat(sinf(floatValue));
+  a_thread->PushFloat(sin(floatValue));
 
   return GM_OK;
 }
@@ -374,13 +374,13 @@ static int GM_CDECL gmfASin(gmThread * a_thread)
 {
   GM_CHECK_NUM_PARAMS(1);
 
-  float floatValue;
+  gmfloat floatValue;
 
-  if(a_thread->ParamType(0) == GM_INT) { floatValue = (float) a_thread->Param(0).m_value.m_int; }
+  if(a_thread->ParamType(0) == GM_INT) { floatValue = (gmfloat) a_thread->Param(0).m_value.m_int; }
   else if(a_thread->ParamType(0) == GM_FLOAT) { floatValue = a_thread->Param(0).m_value.m_float; }
   else { return GM_EXCEPTION; }
 
-  a_thread->PushFloat(asinf(floatValue));
+  a_thread->PushFloat(asin(floatValue));
 
   return GM_OK;
 }
@@ -391,13 +391,13 @@ static int GM_CDECL gmfCos(gmThread * a_thread)
 {
   GM_CHECK_NUM_PARAMS(1);
 
-  float floatValue;
+  gmfloat floatValue;
 
-  if(a_thread->ParamType(0) == GM_INT) { floatValue = (float) a_thread->Param(0).m_value.m_int; }
+  if(a_thread->ParamType(0) == GM_INT) { floatValue = (gmfloat) a_thread->Param(0).m_value.m_int; }
   else if(a_thread->ParamType(0) == GM_FLOAT) { floatValue = a_thread->Param(0).m_value.m_float; }
   else { return GM_EXCEPTION; }
 
-  a_thread->PushFloat(cosf(floatValue));
+  a_thread->PushFloat(cos(floatValue));
 
   return GM_OK;
 }
@@ -408,13 +408,13 @@ static int GM_CDECL gmfACos(gmThread * a_thread)
 {
   GM_CHECK_NUM_PARAMS(1);
 
-  float floatValue;
+  gmfloat floatValue;
 
-  if(a_thread->ParamType(0) == GM_INT) { floatValue = (float) a_thread->Param(0).m_value.m_int; }
+  if(a_thread->ParamType(0) == GM_INT) { floatValue = (gmfloat) a_thread->Param(0).m_value.m_int; }
   else if(a_thread->ParamType(0) == GM_FLOAT) { floatValue = a_thread->Param(0).m_value.m_float; }
   else { return GM_EXCEPTION; }
 
-  a_thread->PushFloat(acosf(floatValue));
+  a_thread->PushFloat(acos(floatValue));
 
   return GM_OK;
 }
@@ -425,13 +425,13 @@ static int GM_CDECL gmfTan(gmThread * a_thread)
 {
   GM_CHECK_NUM_PARAMS(1);
 
-  float floatValue;
+  gmfloat floatValue;
 
-  if(a_thread->ParamType(0) == GM_INT) { floatValue = (float) a_thread->Param(0).m_value.m_int; }
+  if(a_thread->ParamType(0) == GM_INT) { floatValue = (gmfloat) a_thread->Param(0).m_value.m_int; }
   else if(a_thread->ParamType(0) == GM_FLOAT) { floatValue = a_thread->Param(0).m_value.m_float; }
   else { return GM_EXCEPTION; }
 
-  a_thread->PushFloat(tanf(floatValue));
+  a_thread->PushFloat(tan(floatValue));
 
   return GM_OK;
 }
@@ -442,13 +442,13 @@ static int GM_CDECL gmfATan(gmThread * a_thread)
 {
   GM_CHECK_NUM_PARAMS(1);
 
-  float floatValue;
+  gmfloat floatValue;
 
-  if(a_thread->ParamType(0) == GM_INT) { floatValue = (float) a_thread->Param(0).m_value.m_int; }
+  if(a_thread->ParamType(0) == GM_INT) { floatValue = (gmfloat) a_thread->Param(0).m_value.m_int; }
   else if(a_thread->ParamType(0) == GM_FLOAT) { floatValue = a_thread->Param(0).m_value.m_float; }
   else { return GM_EXCEPTION; }
 
-  a_thread->PushFloat(atanf(floatValue));
+  a_thread->PushFloat(atan(floatValue));
 
   return GM_OK;
 }
@@ -460,18 +460,18 @@ static int GM_CDECL gmfATan2(gmThread * a_thread)
 {
   GM_CHECK_NUM_PARAMS(2);
 
-  float floatValueY;
-  float floatValueX;
+  gmfloat floatValueY;
+  gmfloat floatValueX;
 
-  if(a_thread->ParamType(0) == GM_INT) {floatValueY = (float) a_thread->Param(0).m_value.m_int;}
+  if(a_thread->ParamType(0) == GM_INT) {floatValueY = (gmfloat) a_thread->Param(0).m_value.m_int;}
   else if(a_thread->ParamType(0) == GM_FLOAT) {floatValueY = a_thread->Param(0).m_value.m_float;}
   else {return GM_EXCEPTION;}
 
-  if(a_thread->ParamType(1) == GM_INT) {floatValueX = (float) a_thread->Param(1).m_value.m_int;}
+  if(a_thread->ParamType(1) == GM_INT) {floatValueX = (gmfloat) a_thread->Param(1).m_value.m_int;}
   else if(a_thread->ParamType(1) == GM_FLOAT) {floatValueX = a_thread->Param(1).m_value.m_float;}
   else {return GM_EXCEPTION;}
 
-  a_thread->PushFloat(atan2f(floatValueY, floatValueX));
+  a_thread->PushFloat(atan2(floatValueY, floatValueX));
 
   return GM_OK;
 }
@@ -486,43 +486,43 @@ static int GM_CDECL gmfLog(gmThread * a_thread)
   {
     if(a_thread->ParamType(0) == GM_INT) 
     {
-      float floatValue = (float) a_thread->Param(0).m_value.m_int;
-      a_thread->PushInt( (int) log(floatValue) );
+      gmfloat floatValue = (gmfloat) a_thread->Param(0).m_value.m_int;
+      a_thread->PushInt( (gmint) log(floatValue) );
       return GM_OK;
     }
     else if(a_thread->ParamType(0) == GM_FLOAT) 
     {
-      float floatValue = (float) a_thread->Param(0).m_value.m_float;
+      gmfloat floatValue = (gmfloat) a_thread->Param(0).m_value.m_float;
 
-      a_thread->PushFloat( logf(floatValue) );
+      a_thread->PushFloat( log(floatValue) );
       return GM_OK;
     }
     else {return GM_EXCEPTION;}
   }
   else if(numParams == 2) //Log to base params: base, value
   {
-    int minType = gmMin<int>(a_thread->ParamType(0), a_thread->ParamType(1));
+    gmint minType = gmMin<gmint>(a_thread->ParamType(0), a_thread->ParamType(1));
     if(minType < GM_INT)
     {
       return GM_EXCEPTION;
     }
-    int maxType = gmMax<int>(a_thread->ParamType(0), a_thread->ParamType(1));
+    gmint maxType = gmMax<gmint>(a_thread->ParamType(0), a_thread->ParamType(1));
 
     if(maxType == GM_INT)
     {
-      int base = a_thread->Param(0).m_value.m_int;
-      int value = a_thread->Param(1).m_value.m_int;
+      gmint base = a_thread->Param(0).m_value.m_int;
+      gmint value = a_thread->Param(1).m_value.m_int;
       
-      a_thread->PushInt( (int)( log10f((float)value) / log10f((float)base) ) );
+      a_thread->PushInt( (gmint)( log10((gmfloat)value) / log10((gmfloat)base) ) );
 
       return GM_OK;
     }
     else if(maxType == GM_FLOAT)
     {
-      float base = gmGetFloatOrIntParamAsFloat(a_thread, 0);
-      float value = gmGetFloatOrIntParamAsFloat(a_thread, 1);
+      gmfloat base = gmGetFloatOrIntParamAsFloat(a_thread, 0);
+      gmfloat value = gmGetFloatOrIntParamAsFloat(a_thread, 1);
       
-      a_thread->PushFloat( (float)( log10(value) / log10(base) ) );
+      a_thread->PushFloat( (gmfloat)( log10(value) / log10(base) ) );
 
       return GM_OK;
     }
@@ -543,26 +543,26 @@ static int GM_CDECL gmfMin(gmThread * a_thread)
 {
   GM_CHECK_NUM_PARAMS(2);
 
-  int minType = gmMin<int>(a_thread->ParamType(0), a_thread->ParamType(1));
+  gmint minType = gmMin<gmint>(a_thread->ParamType(0), a_thread->ParamType(1));
   if(minType < GM_INT)
   {
     return GM_EXCEPTION;
   }
 
-  int maxType = gmMax<int>(a_thread->ParamType(0), a_thread->ParamType(1));
+  gmint maxType = gmMax<gmint>(a_thread->ParamType(0), a_thread->ParamType(1));
 
   if(maxType == GM_INT)
   {
-    int valX = a_thread->Param(0).m_value.m_int;
-    int valY = a_thread->Param(1).m_value.m_int;
+    gmint valX = a_thread->Param(0).m_value.m_int;
+    gmint valY = a_thread->Param(1).m_value.m_int;
     a_thread->PushInt( gmMin(valX, valY) );
 
     return GM_OK;
   }
   else if(maxType == GM_FLOAT)
   {
-    float valX = gmGetFloatOrIntParamAsFloat(a_thread, 0);
-    float valY = gmGetFloatOrIntParamAsFloat(a_thread, 1);
+    gmfloat valX = gmGetFloatOrIntParamAsFloat(a_thread, 0);
+    gmfloat valY = gmGetFloatOrIntParamAsFloat(a_thread, 1);
     a_thread->PushFloat( gmMin(valX, valY) );
 
     return GM_OK;
@@ -579,26 +579,26 @@ static int GM_CDECL gmfMax(gmThread * a_thread)
 {
   GM_CHECK_NUM_PARAMS(2);
 
-  int minType = gmMin<int>(a_thread->ParamType(0), a_thread->ParamType(1));
+  gmint minType = gmMin<gmint>(a_thread->ParamType(0), a_thread->ParamType(1));
   if(minType < GM_INT)
   {
     return GM_EXCEPTION;
   }
 
-  int maxType = gmMax<int>(a_thread->ParamType(0), a_thread->ParamType(1));
+  gmint maxType = gmMax<gmint>(a_thread->ParamType(0), a_thread->ParamType(1));
 
   if(maxType == GM_INT)
   {
-    int valX = a_thread->Param(0).m_value.m_int;
-    int valY = a_thread->Param(1).m_value.m_int;
+    gmint valX = a_thread->Param(0).m_value.m_int;
+    gmint valY = a_thread->Param(1).m_value.m_int;
     a_thread->PushInt( gmMax(valX, valY) );
 
     return GM_OK;
   }
   else if(maxType == GM_FLOAT)
   {
-    float valX = gmGetFloatOrIntParamAsFloat(a_thread, 0);
-    float valY = gmGetFloatOrIntParamAsFloat(a_thread, 1);
+    gmfloat valX = gmGetFloatOrIntParamAsFloat(a_thread, 0);
+    gmfloat valY = gmGetFloatOrIntParamAsFloat(a_thread, 1);
     a_thread->PushFloat( gmMax(valX, valY) );
 
     return GM_OK;
@@ -617,19 +617,19 @@ static int GM_CDECL gmfClamp(gmThread * a_thread)
 
   //params: min, value, max
 
-  int minType = gmMin3(a_thread->ParamType(0), a_thread->ParamType(1), a_thread->ParamType(2));
+  gmint minType = gmMin3(a_thread->ParamType(0), a_thread->ParamType(1), a_thread->ParamType(2));
   if(minType < GM_INT)
   {
     return GM_EXCEPTION;
   }
 
-  int maxType = gmMax3(a_thread->ParamType(0), a_thread->ParamType(1), a_thread->ParamType(2));
+  gmint maxType = gmMax3(a_thread->ParamType(0), a_thread->ParamType(1), a_thread->ParamType(2));
 
   if(maxType == GM_INT)
   {
-    int limitMin = a_thread->Param(0).m_value.m_int;
-    int value = a_thread->Param(1).m_value.m_int;
-    int limitMax = a_thread->Param(2).m_value.m_int;
+    gmint limitMin = a_thread->Param(0).m_value.m_int;
+    gmint value = a_thread->Param(1).m_value.m_int;
+    gmint limitMax = a_thread->Param(2).m_value.m_int;
     
     a_thread->PushInt( gmClamp(limitMin, value, limitMax) );
 
@@ -637,9 +637,9 @@ static int GM_CDECL gmfClamp(gmThread * a_thread)
   }
   else if(maxType == GM_FLOAT)
   {
-    float limitMin = gmGetFloatOrIntParamAsFloat(a_thread, 0);
-    float value = gmGetFloatOrIntParamAsFloat(a_thread, 1);
-    float limitMax = gmGetFloatOrIntParamAsFloat(a_thread, 2);
+    gmfloat limitMin = gmGetFloatOrIntParamAsFloat(a_thread, 0);
+    gmfloat value = gmGetFloatOrIntParamAsFloat(a_thread, 1);
+    gmfloat limitMax = gmGetFloatOrIntParamAsFloat(a_thread, 2);
     
     a_thread->PushFloat( gmClamp(limitMin, value, limitMax) );
 

+ 8 - 8
gmsrc/src/binds/gmStringLib.cpp

@@ -37,7 +37,7 @@ static int GM_CDECL gmfStringLeft(gmThread * a_thread)
   const char * str = (const char *) *strObj;
   
   int length = strObj->GetLength();
-  count = gmClamp(0, count, length);
+  count = gmClamp(0, (int)count, length);
 
   char * buffer = (char *) alloca(count + 1);
   memcpy(buffer, str, count);
@@ -62,7 +62,7 @@ static int GM_CDECL gmfStringRight(gmThread * a_thread)
   const char * str = (const char *) *strObj;
   
   int length = strObj->GetLength();
-  count = gmClamp(0, count, length);
+  count = gmClamp(0, (int)count, length);
 
   char * buffer = (char *) alloca(count + 1);
   memcpy(buffer, str + length - count, count);
@@ -87,8 +87,8 @@ static int GM_CDECL gmfStringRightAt(gmThread * a_thread)
   const char * str = (const char *) *strObj;
   
   int length = strObj->GetLength();
-  index = gmClamp(0, index, length);
-  int count = (length - index);
+  index = gmClamp(0, (int)index, length);
+  int count = (length - (int)index);
   char * buffer = (char *) alloca(count + 1);
   memcpy(buffer, str + index, count);
   buffer[count] = 0;
@@ -103,7 +103,7 @@ static int GM_CDECL gmfStringMid(gmThread * a_thread)
 {
   GM_CHECK_NUM_PARAMS(2);
 
-  int first = 0, count = 0;
+  gmint first = 0, count = 0;
 
   if(!gmGetFloatOrIntParamAsInt(a_thread, 0, first)) {return GM_EXCEPTION;}
   if(!gmGetFloatOrIntParamAsInt(a_thread, 1, count)) {return GM_EXCEPTION;}
@@ -323,7 +323,7 @@ static int GM_CDECL gmfStringAppendPath(gmThread * a_thread)
   }
 
   //Optional trailing slash flag
-  int PutTrailingSlash = a_thread->ParamInt(1, false);
+  gmint PutTrailingSlash = a_thread->ParamInt(1, false);
 
   if(a_thread->ParamType(0) == GM_STRING)
   {
@@ -524,7 +524,7 @@ static void GM_CDECL gmStringOpAppendPath(gmThread * a_thread, gmVariable * a_op
 static int GM_CDECL gmStringFind(gmThread * a_thread)
 {
   int numParams = GM_THREAD_ARG->GetNumParams();
-  int startOffset = 0;
+  gmint startOffset = 0;
   char* retCharPtr = NULL;
   const gmVariable * var = a_thread->GetThis();
   GM_ASSERT(var->m_type == GM_STRING);
@@ -685,7 +685,7 @@ static void GM_CDECL gmStringOpGetInd(gmThread * a_thread, gmVariable * a_operan
 
   gmStringObject * strObjA = (gmStringObject *) GM_OBJECT(a_operands[0].m_value.m_ref);
   const char* cStrA = strObjA->GetString();
-  int index = a_operands[1].m_value.m_int;
+  gmint index = a_operands[1].m_value.m_int;
   
   if( index < 0 || index > strObjA->GetLength()-1 )
   {

+ 2 - 2
gmsrc/src/binds/gmSystemLib.cpp

@@ -234,7 +234,7 @@ static int GM_CDECL gmfFileSeek(gmThread * a_thread) // return false on error
     return GM_EXCEPTION;
   }
 
-  int result = fseek((FILE*)fileObject->m_user, offset, origin);
+  int result = fseek((FILE*)fileObject->m_user, (long)offset, (int)origin);
   if(result != 0)
   {
     a_thread->PushInt(false);
@@ -299,7 +299,7 @@ static int GM_CDECL gmfFileWriteChar(gmThread * a_thread) // int, return char wr
   GM_ASSERT(fileObject->m_userType == s_gmFileType);
   if(fileObject->m_user)
   {
-    int r = fputc(c, (FILE *) fileObject->m_user);
+    int r = fputc((int)c, (FILE *) fileObject->m_user);
     if(r != EOF) a_thread->PushInt(r);
   }
   return GM_OK;

+ 63 - 63
gmsrc/src/binds/gmVector3Lib.cpp

@@ -14,7 +14,7 @@
 #include "gmThread.h"
 #include "gmMachine.h"
 #include "gmHelpers.h"
-#include <math.h>
+#include <cmath>
 
 
 //
@@ -27,11 +27,11 @@ struct gmVector3
 {
   static int DominantAxis(const gmVector3& a_vec)
   {
-    float absX, absY, absZ;
+    gmfloat absX, absY, absZ;
 
-    absX = fabsf(a_vec.m_x);
-    absY = fabsf(a_vec.m_y);
-    absZ = fabsf(a_vec.m_z);
+    absX = fabs(a_vec.m_x);
+    absY = fabs(a_vec.m_y);
+    absZ = fabs(a_vec.m_z);
   
     if(absY > absX)
     {
@@ -45,7 +45,7 @@ struct gmVector3
     else
       {return 0;} // Dominant X
   }
-  static float Dot(const gmVector3& a_vec1, const gmVector3& a_vec2)
+  static gmfloat Dot(const gmVector3& a_vec1, const gmVector3& a_vec2)
   {
     return (a_vec1.m_x * a_vec2.m_x + a_vec1.m_y * a_vec2.m_y + a_vec1.m_z * a_vec2.m_z);
   }
@@ -57,27 +57,27 @@ struct gmVector3
     a_result.m_y = (a_vec1.m_z * a_vec2.m_x) - (a_vec1.m_x * a_vec2.m_z);
     a_result.m_z = (a_vec1.m_x * a_vec2.m_y) - (a_vec1.m_y * a_vec2.m_x);
   }
-  static float Length(const gmVector3& a_vec)
+  static gmfloat Length(const gmVector3& a_vec)
   {
     return (float)sqrt(LengthSquared(a_vec));
   }
-  static float LengthSquared(const gmVector3& a_vec)
+  static gmfloat LengthSquared(const gmVector3& a_vec)
   {
     return Dot(a_vec, a_vec);
   }
   static void Normalize(const gmVector3& a_vec, gmVector3& a_result)
   {
-    float len2 = LengthSquared(a_vec);
-    if(len2 != 0.0f)
+    gmfloat len2 = LengthSquared(a_vec);
+    if(len2 != gmfloat(0.0))
     {
-      float ooLen = 1.0f / (float)sqrt(len2);
+      gmfloat ooLen = gmfloat(1.0) / (gmfloat)sqrt(len2);
       MulScalar(a_vec, ooLen, a_result);
     }
     else
     {
-      a_result.m_x = 0.0f;
-      a_result.m_y = 0.0f;
-      a_result.m_z = 0.0f;
+      a_result.m_x = gmfloat(0.0);
+      a_result.m_y = gmfloat(0.0);
+      a_result.m_z = gmfloat(0.0);
     }
   }
   static void Add(const gmVector3& a_vec1, const gmVector3& a_vec2, gmVector3& a_result)
@@ -98,13 +98,13 @@ struct gmVector3
     a_result.m_y = a_vec1.m_y * a_vec2.m_y;
     a_result.m_z = a_vec1.m_z * a_vec2.m_z;
   }
-  static void MulScalar(const gmVector3& a_vec, const float& a_scale, gmVector3& a_result)
+  static void MulScalar(const gmVector3& a_vec, const gmfloat& a_scale, gmVector3& a_result)
   {
     a_result.m_x = a_vec.m_x * a_scale;
     a_result.m_y = a_vec.m_y * a_scale;
     a_result.m_z = a_vec.m_z * a_scale;
   }
-  static void LerpPoints(const gmVector3& a_vecFrom, const gmVector3& a_vecTo, const float a_frac, gmVector3& a_result)  
+  static void LerpPoints(const gmVector3& a_vecFrom, const gmVector3& a_vecTo, const gmfloat a_frac, gmVector3& a_result)  
   {
     a_result.m_x = a_vecFrom.m_x + a_frac * (a_vecTo.m_x - a_vecFrom.m_x);
     a_result.m_y = a_vecFrom.m_y + a_frac * (a_vecTo.m_y - a_vecFrom.m_y);
@@ -114,25 +114,25 @@ struct gmVector3
   // Set to Vector rotated by AxisAngle rotation 
   // Rotate a vector by a axis (unit vector) and angle (radians)
   // Only useful if you want to do this once off, otherwise, create a matrix and rotate multiple vectors more efficiently
-  static void RotateAxisAngle(const gmVector3& a_point, const gmVector3& a_axis, const float a_angle, gmVector3& a_result)
+  static void RotateAxisAngle(const gmVector3& a_point, const gmVector3& a_axis, const gmfloat a_angle, gmVector3& a_result)
   {
     //cos(t) V + (1 - cos(t)) (A dot V) A + sin(t) (A cross V).
 
-    float sinAng, cosAng;
+    gmfloat sinAng, cosAng;
     gmVector3 temp1, temp2;
     gmSinCos(a_angle, sinAng, cosAng);
 
     MulScalar(a_point, cosAng, temp1);
-    MulScalar(a_axis, (1 - cosAng) * Dot(a_axis, a_point), temp2);
+    MulScalar(a_axis, (gmfloat(1) - cosAng) * Dot(a_axis, a_point), temp2);
     Cross(a_axis, a_point, a_result);
     MulScalar(a_result, sinAng, a_result);
     Add(temp1, a_result, a_result);
     Add(temp2, a_result, a_result);
   }
 
-  static void RotateAboutX(const gmVector3& a_vec, float a_angle, gmVector3& a_result)
+  static void RotateAboutX(const gmVector3& a_vec, gmfloat a_angle, gmVector3& a_result)
   {
-    float sinAng, cosAng;
+    gmfloat sinAng, cosAng;
 
     gmSinCos(a_angle, sinAng, cosAng);
 
@@ -141,9 +141,9 @@ struct gmVector3
     a_result.m_x = a_vec.m_x;
   }
 
-  static void RotateAboutY(const gmVector3& a_vec, float a_angle, gmVector3& a_result)
+  static void RotateAboutY(const gmVector3& a_vec, gmfloat a_angle, gmVector3& a_result)
   {
-    float sinAng, cosAng;
+    gmfloat sinAng, cosAng;
 
     gmSinCos(a_angle, sinAng, cosAng);
 
@@ -152,9 +152,9 @@ struct gmVector3
     a_result.m_y = a_vec.m_y;
   }
 
-  static void RotateAboutZ(const gmVector3& a_vec, float a_angle, gmVector3& a_result)
+  static void RotateAboutZ(const gmVector3& a_vec, gmfloat a_angle, gmVector3& a_result)
   {
-    float sinAng, cosAng;
+    gmfloat sinAng, cosAng;
 
     gmSinCos(a_angle, sinAng, cosAng);
 
@@ -166,32 +166,32 @@ struct gmVector3
   // Spherical linear interpolation between two vectors
   // Using quaternion style, find vector along smallest great circle between vectors
   // [sin((1-t)*A)/sin(A)]*P + [sin(t*A)/sin(A)]*Q
-  static void SlerpVectors(const gmVector3& a_vecFrom, const gmVector3& a_vecTo, const float a_frac, gmVector3& a_result)
+  static void SlerpVectors(const gmVector3& a_vecFrom, const gmVector3& a_vecTo, const gmfloat a_frac, gmVector3& a_result)
   {
-    float sinA;
-    float ang;
-    float ooSinA;
+    gmfloat sinA;
+    gmfloat ang;
+    gmfloat ooSinA;
     gmVector3 partSrc, partDst;
-    float cosAng;
+    gmfloat cosAng;
 
     cosAng = Dot(a_vecFrom, a_vecTo);
-    if(fabsf(cosAng) >= 0.999f) //if From is very similar to To
+    if(fabs(cosAng) >= gmfloat(0.999)) //if From is very similar to To
     {
       a_result = a_vecFrom;
       return;
     }
 
-    ang = acosf(cosAng);
-    sinA = sinf(ang);
-    ooSinA = 1.0f / sinA;
+    ang = acos(cosAng);
+    sinA = sin(ang);
+    ooSinA = gmfloat(1.0) / sinA;
 
-    MulScalar(a_vecFrom, sinf((1 - a_frac) * ang) * ooSinA, partSrc);
-    MulScalar(a_vecTo, sinf(a_frac * ang) * ooSinA, partDst);
+    MulScalar(a_vecFrom, sin((gmfloat(1) - a_frac) * ang) * ooSinA, partSrc);
+    MulScalar(a_vecTo, sin(a_frac * ang) * ooSinA, partDst);
 
     Add(partSrc, partDst, a_result);
   }
 
-  static void Project(const gmVector3& a_dir, const gmVector3& a_point, const float a_time, gmVector3& a_result)
+  static void Project(const gmVector3& a_dir, const gmVector3& a_point, const gmfloat a_time, gmVector3& a_result)
   {
     a_result.m_x = a_point.m_x + a_dir.m_x * a_time;
     a_result.m_y = a_point.m_y + a_dir.m_y * a_time;
@@ -200,12 +200,12 @@ struct gmVector3
 
   union
   {
-    float m_v[3];
+    gmfloat m_v[3];
     struct
     {
-      float m_x;
-      float m_y;
-      float m_z;
+      gmfloat m_x;
+      gmfloat m_y;
+      gmfloat m_z;
     };
   };
 };
@@ -254,7 +254,7 @@ struct gmVector3Obj
     GM_CHECK_USER_PARAM(gmVector3*, GM_VECTOR3, otherVec, 0);
     gmVector3* thisVec = (gmVector3*)a_thread->ThisUser_NoChecks();
         
-    float angle = 0;
+    gmfloat angle = 0;
     if(!gmGetFloatOrIntParamAsFloat(a_thread, 1, angle))
     {
       return GM_EXCEPTION;
@@ -274,7 +274,7 @@ struct gmVector3Obj
     GM_CHECK_NUM_PARAMS(1);
     gmVector3* thisVec = (gmVector3*)a_thread->ThisUser_NoChecks();
         
-    float angle = 0;
+    gmfloat angle = 0;
     if(!gmGetFloatOrIntParamAsFloat(a_thread, 0, angle))
     {
       return GM_EXCEPTION;
@@ -292,7 +292,7 @@ struct gmVector3Obj
     GM_CHECK_NUM_PARAMS(1);
     gmVector3* thisVec = (gmVector3*)a_thread->ThisUser_NoChecks();
         
-    float angle = 0;
+    gmfloat angle = 0;
     if(!gmGetFloatOrIntParamAsFloat(a_thread, 0, angle))
     {
       return GM_EXCEPTION;
@@ -310,7 +310,7 @@ struct gmVector3Obj
     GM_CHECK_NUM_PARAMS(1);
     gmVector3* thisVec = (gmVector3*)a_thread->ThisUser_NoChecks();
         
-    float angle = 0;
+    gmfloat angle = 0;
     if(!gmGetFloatOrIntParamAsFloat(a_thread, 0, angle))
     {
       return GM_EXCEPTION;
@@ -400,7 +400,7 @@ struct gmVector3Obj
     GM_CHECK_USER_PARAM(gmVector3*, GM_VECTOR3, otherVec, 0);
     gmVector3* thisVec = (gmVector3*)a_thread->ThisUser_NoChecks();
 
-    float frac = 0;
+    gmfloat frac = 0;
     if(!gmGetFloatOrIntParamAsFloat(a_thread, 1, frac))
     {
       return GM_EXCEPTION;
@@ -420,7 +420,7 @@ struct gmVector3Obj
     GM_CHECK_USER_PARAM(gmVector3*, GM_VECTOR3, otherVec, 0);
     gmVector3* thisVec = (gmVector3*)a_thread->ThisUser_NoChecks();
 
-    float frac = 0;
+    gmfloat frac = 0;
     if(!gmGetFloatOrIntParamAsFloat(a_thread, 1, frac))
     {
       return GM_EXCEPTION;
@@ -440,7 +440,7 @@ struct gmVector3Obj
     GM_CHECK_USER_PARAM(gmVector3*, GM_VECTOR3, otherVec, 0);
     gmVector3* thisVec = (gmVector3*)a_thread->ThisUser_NoChecks();
 
-    float time = 0;
+    gmfloat time = 0;
     if(!gmGetFloatOrIntParamAsFloat(a_thread, 1, time))
     {
       return GM_EXCEPTION;
@@ -551,7 +551,7 @@ struct gmVector3Obj
     {
       // Get operands
       gmVector3* vecObjA = (gmVector3*) ((gmUserObject*)GM_OBJECT(a_operands[0].m_value.m_ref))->m_user;
-      float scaleB = 0.0f;
+      gmfloat scaleB = 0.0f;
       
       if(a_operands[1].m_type == GM_FLOAT)
       {
@@ -559,7 +559,7 @@ struct gmVector3Obj
       }
       else if(a_operands[1].m_type == GM_INT)
       {
-        scaleB = (float)a_operands[1].m_value.m_int;
+        scaleB = (gmfloat)a_operands[1].m_value.m_int;
       }
        
       // Create new
@@ -574,7 +574,7 @@ struct gmVector3Obj
     else if((a_operands[0].m_type != GM_VECTOR3) && a_operands[1].m_type == GM_VECTOR3)
     {
       // Get operands
-      float scaleA = 0.0f;
+      gmfloat scaleA = 0.0f;
       gmVector3* vecObjB = (gmVector3*) ((gmUserObject*)GM_OBJECT(a_operands[1].m_value.m_ref))->m_user;
 
       if(a_operands[0].m_type == GM_FLOAT)
@@ -583,7 +583,7 @@ struct gmVector3Obj
       }
       else if(a_operands[0].m_type == GM_INT)
       {
-        scaleA = (float)a_operands[0].m_value.m_int;
+        scaleA = (gmfloat)a_operands[0].m_value.m_int;
       }
 
       // Create new
@@ -672,14 +672,14 @@ struct gmVector3Obj
       return;
     }
 
-    float newFloat = 0.0f;
+    gmfloat newFloat = gmfloat(0.0);
     if(a_operands[1].m_type == GM_FLOAT)
     {
       newFloat = a_operands[1].m_value.m_float;
     }
     else if(a_operands[1].m_type == GM_INT)
     {
-      newFloat = (float)a_operands[1].m_value.m_int;
+      newFloat = (gmfloat)a_operands[1].m_value.m_int;
     }
 
     if(cstr[0] == 'x')
@@ -702,7 +702,7 @@ struct gmVector3Obj
     gmVector3* thisVec = (gmVector3*) ((gmUserObject*)GM_OBJECT(a_operands[0].m_value.m_ref))->m_user;
     if(a_operands[1].m_type == GM_INT)
     {
-      int index = a_operands[1].m_value.m_int;
+      gmint index = a_operands[1].m_value.m_int;
       a_operands[0].SetFloat(thisVec->m_v[index]);
       return;
     }
@@ -715,7 +715,7 @@ struct gmVector3Obj
     gmVector3* thisVec = (gmVector3*) ((gmUserObject*)GM_OBJECT(a_operands[0].m_value.m_ref))->m_user;
     if(a_operands[1].m_type == GM_INT)
     {
-      int index = a_operands[1].m_value.m_int;
+      gmint index = a_operands[1].m_value.m_int;
       if(index < 0 || index >= 3)
       {
         return;
@@ -727,7 +727,7 @@ struct gmVector3Obj
       }
       else if(a_operands[2].m_type == GM_INT)
       {
-        thisVec->m_v[index] = (float)a_operands[2].m_value.m_int;
+        thisVec->m_v[index] = (gmfloat)a_operands[2].m_value.m_int;
       }
       else
       {
@@ -743,11 +743,11 @@ struct gmVector3Obj
     gmVector3* thisVec = (gmVector3*) ((gmUserObject*)GM_OBJECT(a_operands[0].m_value.m_ref))->m_user;
     if (thisVec->m_x != 0 || thisVec->m_y != 0 && thisVec->m_z != 0)
     {
-      a_operands[0] = gmVariable(1);
+      a_operands[0] = gmVariable( gmint(1) );
     }
     else
     {
-      a_operands[0] = gmVariable(0);
+      a_operands[0] = gmVariable( gmint(0) );
     }
   }
 
@@ -758,11 +758,11 @@ struct gmVector3Obj
     gmVector3* thisVec = (gmVector3*) ((gmUserObject*)GM_OBJECT(a_operands[0].m_value.m_ref))->m_user;
     if (thisVec->m_x != 0 || thisVec->m_y != 0 && thisVec->m_z != 0)
     {
-      a_operands[0] = gmVariable(0);
+      a_operands[0] = gmVariable( gmint(0) );
     }
     else
     {
-      a_operands[0] = gmVariable(1);
+      a_operands[0] = gmVariable( gmint(1) );
     }
   }
 #endif // GM_BOOL_OP
@@ -849,7 +849,7 @@ gmMemFixed gmVector3Obj::s_mem(sizeof(gmVector3), 64);
 gmType GM_VECTOR3 = GM_NULL;
 
 /// \brief Push a Vector3. (Eg. Use to return result).
-void gmVector3_Push(gmThread* a_thread, const float* a_vec)
+void gmVector3_Push(gmThread* a_thread, const gmfloat* a_vec)
 {
   gmVector3* newVec = gmVector3Obj::Alloc(a_thread->GetMachine(), false);
   *newVec = *(gmVector3*)a_vec;
@@ -857,7 +857,7 @@ void gmVector3_Push(gmThread* a_thread, const float* a_vec)
 }
 
 /// \brief Create a Vector3 user object and fill it (Eg. use, to set as table member).
-gmUserObject* gmVector3_Create(gmMachine* a_machine, const float* a_vec)
+gmUserObject* gmVector3_Create(gmMachine* a_machine, const gmfloat* a_vec)
 {
   gmVector3* newVec = gmVector3Obj::Alloc(a_machine, false);
   *newVec = *(gmVector3*)a_vec;

+ 1 - 1
gmsrc/src/gm/bison.simple

@@ -245,7 +245,7 @@ yyparse(YYPARSE_PARAM)
 #endif
 #endif
 
-  YYSTYPE yyval;                /*  the variable used to return         */
+  YYSTYPE yyval = 0;            /*  the variable used to return         */ // _GD_ '= 0' for VS2017 'error C4703: potentially uninitialized local pointer variable'
                                 /*  semantic values from the action     */
                                 /*  routines                            */
 

+ 28 - 28
gmsrc/src/gm/gmArraySimple.h

@@ -46,31 +46,31 @@ public:
 
   /// \brief SetBlockSize() will set the hysteresis memory grow by in elements. 
   /// \param a_blockSize as 0 will set automatic power of 2.
-  inline void SetBlockSize(gmuint a_blockSize) { m_blockSize = a_blockSize; }
+  inline void SetBlockSize(gmint a_blockSize) { m_blockSize = a_blockSize; }
 
   inline bool InsertLastIfUnique(const T &a_elem);
   inline T& InsertLast(void);
-  inline void InsertBefore(gmuint a_index, const T &a_elem);
-  inline void Remove(gmuint a_index);
-  inline void RemoveSwapLast(gmuint a_index);
+  inline void InsertBefore(gmint a_index, const T &a_elem);
+  inline void Remove(gmint a_index);
+  inline void RemoveSwapLast(gmint a_index);
   inline void RemoveLast(void);
   
-  inline T &operator[](gmuint a_index);
-  inline const T &operator[](gmuint a_index) const;
+  inline T &operator[](gmint a_index);
+  inline const T &operator[](gmint a_index) const;
 
-  inline gmuint Count(void) const { return m_count; }
+  inline gmint Count(void) const { return m_count; }
   inline bool IsEmpty(void) const { return (m_count == 0); }
 
   inline void Reset(void) { SetCount(0); }
   inline void ResetAndFreeMemory(void);
 
-  inline void SetCount(gmuint a_count);
-  inline void SetCountAndFreeMemory(gmuint a_count);
-  inline void Touch(gmuint a_element);
+  inline void SetCount(gmint a_count);
+  inline void SetCountAndFreeMemory(gmint a_count);
+  inline void Touch(gmint a_element);
 
   inline T* GetData(void) { return m_elem; }
   inline const T* GetData(void) const { return m_elem; }
-  inline gmuint GetSize(void) { return m_size; }
+  inline gmint GetSize(void) { return m_size; }
   bool IsValid(const T* a_elem) const;
   
   inline QUAL &operator=(const QUAL &a_array);
@@ -78,12 +78,12 @@ public:
   inline bool FindRemove(const T &a_elem);
   
   template <class Q>
-  inline gmuint FindIndex(const Q &a_elem) const
+  inline gmint FindIndex(const Q &a_elem) const
   {
     // iterate backwards, better chance of finding a_elem, given InsertLast() is 
     // used commonly which presents possible element coherence
     if(m_count == 0) return NULL_INDEX;
-    gmuint i = m_count - 1;
+    gmint i = m_count - 1;
     do
     {
       if (m_elem[i] == a_elem)    // used commonly which presents possible element coherence
@@ -95,12 +95,12 @@ public:
 private:
     
   T *m_elem;
-  gmuint m_count, m_size;
-  gmuint m_blockSize; //!< 0 and will be power of 2 sizing.
+  gmint m_count, m_size;
+  gmint m_blockSize; //!< 0 and will be power of 2 sizing.
   
   /// \brief Resize() will resize the array.
   /// \param a_size is the required size.
-  void Resize(gmuint a_size, bool a_shrinkIfPossible = false);
+  void Resize(gmint a_size, bool a_shrinkIfPossible = false);
 };
 
 
@@ -161,7 +161,7 @@ TMPL inline T& QUAL::InsertLast(void)
 
 
 TMPL
-inline void QUAL::InsertBefore(gmuint a_index, const T &a_elem)
+inline void QUAL::InsertBefore(gmint a_index, const T &a_elem)
 {
   if(a_index >= m_count)
   {
@@ -181,7 +181,7 @@ inline void QUAL::InsertBefore(gmuint a_index, const T &a_elem)
 
 
 TMPL
-inline void QUAL::Remove(gmuint a_index)
+inline void QUAL::Remove(gmint a_index)
 {
   if(a_index >= m_count) return;
   memmove(&m_elem[a_index], &m_elem[a_index+1], (m_count - (a_index + 1)) * sizeof(T));
@@ -190,7 +190,7 @@ inline void QUAL::Remove(gmuint a_index)
 
 
 TMPL
-inline void QUAL::RemoveSwapLast(gmuint a_index)
+inline void QUAL::RemoveSwapLast(gmint a_index)
 {
   if (a_index >= m_count) return;
   if(--m_count != a_index)
@@ -209,7 +209,7 @@ inline void QUAL::RemoveLast(void)
 
 
 TMPL
-inline T &QUAL::operator[](gmuint a_index)
+inline T &QUAL::operator[](gmint a_index)
 {
   GM_ASSERT(a_index >= 0 && a_index < m_count);
   return m_elem[a_index];
@@ -217,7 +217,7 @@ inline T &QUAL::operator[](gmuint a_index)
 
 
 TMPL
-inline const T &QUAL::operator[](gmuint a_index) const
+inline const T &QUAL::operator[](gmint a_index) const
 {
   GM_ASSERT(a_index >= 0 && a_index < m_count);
   return m_elem[a_index];
@@ -237,7 +237,7 @@ inline void QUAL::ResetAndFreeMemory(void)
 
 
 TMPL
-inline void QUAL::SetCount(gmuint a_count)
+inline void QUAL::SetCount(gmint a_count)
 {
   if(a_count > m_size)
   {
@@ -248,7 +248,7 @@ inline void QUAL::SetCount(gmuint a_count)
 
 
 TMPL
-inline void QUAL::SetCountAndFreeMemory(gmuint a_count)
+inline void QUAL::SetCountAndFreeMemory(gmint a_count)
 {
   Resize(a_count, true);
   m_count = a_count;
@@ -256,7 +256,7 @@ inline void QUAL::SetCountAndFreeMemory(gmuint a_count)
 
 
 TMPL
-inline void QUAL::Touch(gmuint a_element)
+inline void QUAL::Touch(gmint a_element)
 {
   if(a_element >= m_count)
   {
@@ -267,7 +267,7 @@ inline void QUAL::Touch(gmuint a_element)
 
 TMPL bool QUAL::IsValid(const T* a_elem) const
 {
-  gmuint index = (a_elem - m_elem);
+  gmint index = (a_elem - m_elem);
   return (index < m_count);
 }
 
@@ -283,7 +283,7 @@ inline QUAL &QUAL::operator=(const QUAL &a_array)
 
 TMPL bool QUAL::FindRemove(const T &a_elem)
 {
-  gmuint index = FindIndex(a_elem);
+  gmint index = FindIndex(a_elem);
   if(index != NULL_INDEX)
   {
     Remove(index);
@@ -294,7 +294,7 @@ TMPL bool QUAL::FindRemove(const T &a_elem)
 
 
 TMPL
-void QUAL::Resize(gmuint a_size, bool a_shrinkIfPossible)
+void QUAL::Resize(gmint a_size, bool a_shrinkIfPossible)
 {
   if(m_size >= a_size)
   {
@@ -310,7 +310,7 @@ void QUAL::Resize(gmuint a_size, bool a_shrinkIfPossible)
   }
   else
   {
-    size = gmLog2ge(gmMax<gmuint>(4, a_size + 1));
+    size = gmLog2ge((gmuint)gmMax<gmint>(4, a_size + 1));
   }
 
   // alloc, copy, free

+ 4 - 4
gmsrc/src/gm/gmByteCode.cpp

@@ -116,23 +116,23 @@ void gmByteCodePrint(FILE * a_fp, const void * a_byteCode, int a_byteCodeLength)
     {
       float fval = *((float *) instruction);
       instruction += sizeof(gmint32);
-      fprintf(a_fp, "  %04d %s %f"GM_NL, addr, cp, fval);
+      fprintf(a_fp, "  %04d %s %f" GM_NL, addr, cp, fval);
     }
     if(opi32)
     {
       gmint32 ival = *((gmint32 *) instruction);
       instruction += sizeof(gmint32);
-      fprintf(a_fp, "  %04d %s %d"GM_NL, addr, cp, ival);
+      fprintf(a_fp, "  %04d %s %d" GM_NL, addr, cp, ival);
     }
     else if (opiptr)
     {
       gmptr ival = *((gmptr *) instruction);
       instruction += sizeof(gmptr);
-      fprintf(a_fp, "  %04d %s %d"GM_NL, addr, cp, ival);
+      fprintf(a_fp, "  %04d %s %lld" GM_NL, addr, cp, (gmint64)ival);
     }
     else
     {
-      fprintf(a_fp, "  %04d %s"GM_NL, addr, cp);
+      fprintf(a_fp, "  %04d %s" GM_NL, addr, cp);
     }
   }
 }

+ 23 - 4
gmsrc/src/gm/gmByteCodeGen.cpp

@@ -37,7 +37,7 @@ void gmByteCodeGen::Reset(void * a_context)
 
 bool gmByteCodeGen::Emit(gmByteCode a_instruction)
 {
-  if(m_emitCallback) m_emitCallback(Tell(), m_context);
+  if(m_emitCallback) m_emitCallback((int)Tell(), m_context);
   AdjustStack(a_instruction);
   *this << (gmuint32) a_instruction;
   return true;
@@ -47,7 +47,7 @@ bool gmByteCodeGen::Emit(gmByteCode a_instruction)
 
 bool gmByteCodeGen::Emit(gmByteCode a_instruction, gmuint32 a_operand32)
 {
-  if(m_emitCallback) m_emitCallback(Tell(), m_context);
+  if(m_emitCallback) m_emitCallback((int)Tell(), m_context);
   AdjustStack(a_instruction);
   *this << (gmuint32) a_instruction;
   *this << a_operand32;
@@ -55,10 +55,29 @@ bool gmByteCodeGen::Emit(gmByteCode a_instruction, gmuint32 a_operand32)
 }
 
 
+bool gmByteCodeGen::Emit(gmByteCode a_instruction, gmfloat a_operandValue)
+{
+  if(m_emitCallback) m_emitCallback((int)Tell(), m_context);
+  AdjustStack(a_instruction);
+  *this << (gmuint32) a_instruction;
+  *this << a_operandValue;
+  return true;
+}
+
+
+bool gmByteCodeGen::Emit(gmByteCode a_instruction, gmint a_operandValue)
+{
+  if(m_emitCallback) m_emitCallback((int)Tell(), m_context);
+  AdjustStack(a_instruction);
+  *this << (gmuint32) a_instruction;
+  *this << a_operandValue;
+  return true;
+}
+
 
 bool gmByteCodeGen::EmitPtr(gmByteCode a_instruction, gmptr a_operand)
 {
-  if(m_emitCallback) m_emitCallback(Tell(), m_context);
+  if(m_emitCallback) m_emitCallback((int)Tell(), m_context);
   AdjustStack(a_instruction);
   *this << ((gmuint32) a_instruction);
   *this << a_operand;
@@ -68,7 +87,7 @@ bool gmByteCodeGen::EmitPtr(gmByteCode a_instruction, gmptr a_operand)
 
 unsigned int gmByteCodeGen::Skip(unsigned int p_n, unsigned char p_value)
 {
-  unsigned int oldPos = Tell();
+  int oldPos = (int)Tell();
   if(p_n)
   {
     char * fill = (char *) alloca(p_n);

+ 2 - 0
gmsrc/src/gm/gmByteCodeGen.h

@@ -26,6 +26,8 @@ public:
 
   bool Emit(gmByteCode a_instruction);
   bool Emit(gmByteCode a_instruction, gmuint32 a_operand32);
+  bool Emit(gmByteCode a_instruction, gmfloat a_operandValue);
+  bool Emit(gmByteCode a_instruction, gmint a_operandValue);
   bool EmitPtr(gmByteCode a_instruction, gmptr a_operand);
 
   unsigned int Skip(unsigned int p_n, unsigned char p_value = 0);

+ 34 - 36
gmsrc/src/gm/gmCodeGen.cpp

@@ -26,7 +26,7 @@ static const char * s_tempVarName1 = "__t1";
 /// \brief gmSortDebugLines will sort debug line information
 static void gmSortDebugLines(gmArraySimple<gmLineInfo> &a_lineInfo)
 {
-  int count = a_lineInfo.Count();
+  int count = (int)a_lineInfo.Count();
 
   // sort by address
   int i;
@@ -291,7 +291,7 @@ int gmCodeGenPrivate::Lock(const gmCodeTreeNode * a_codeTree, gmCodeGenHooks * a
     {
       locals = (const char **) alloca(sizeof(const char *) * m_currentFunction->m_numLocals);
       memset(locals, 0, sizeof(const char *) * m_currentFunction->m_numLocals);
-      for(gmuint v = 0; v < m_currentFunction->m_variables.Count(); ++v)
+      for(gmint v = 0; v < m_currentFunction->m_variables.Count(); ++v)
       {
         Variable &variable = m_currentFunction->m_variables[v];
         if(variable.m_offset != -1)
@@ -309,12 +309,12 @@ int gmCodeGenPrivate::Lock(const gmCodeTreeNode * a_codeTree, gmCodeGenHooks * a
     info.m_id = m_hooks->GetFunctionId();
     info.m_root = true;
     info.m_byteCode = m_currentFunction->m_byteCode.GetData();
-    info.m_byteCodeLength = m_currentFunction->m_byteCode.Tell();
+    info.m_byteCodeLength = (int)m_currentFunction->m_byteCode.Tell();
     info.m_numParams = 0;
     info.m_numLocals = m_currentFunction->m_numLocals;
     info.m_symbols = locals;
     info.m_maxStackSize = m_currentFunction->m_byteCode.GetMaxTos();
-    info.m_lineInfoCount = m_currentFunction->m_lineInfo.Count();
+    info.m_lineInfoCount = (int)m_currentFunction->m_lineInfo.Count();
     info.m_lineInfo = m_currentFunction->m_lineInfo.GetData();
     info.m_debugName = "__main";
     m_hooks->AddFunction(info);
@@ -577,7 +577,7 @@ bool gmCodeGenPrivate::GenExprFunction(const gmCodeTreeNode * a_node, gmByteCode
       locals = (const char **) alloca(sizeof(const char *) * m_currentFunction->m_numLocals);
       memset(locals, 0, sizeof(const char *) * m_currentFunction->m_numLocals);
 
-      for(gmuint v = 0; v < m_currentFunction->m_variables.Count(); ++v)
+      for(gmint v = 0; v < m_currentFunction->m_variables.Count(); ++v)
       {
         Variable &variable = m_currentFunction->m_variables[v];
         if(variable.m_offset != -1)
@@ -595,12 +595,12 @@ bool gmCodeGenPrivate::GenExprFunction(const gmCodeTreeNode * a_node, gmByteCode
     info.m_id = id;
     info.m_root = false;
     info.m_byteCode = m_currentFunction->m_byteCode.GetData();
-    info.m_byteCodeLength = m_currentFunction->m_byteCode.Tell();
+    info.m_byteCodeLength = (int)m_currentFunction->m_byteCode.Tell();
     info.m_numParams = numParams;
     info.m_numLocals = m_currentFunction->m_numLocals - numParams;
     info.m_symbols = locals;
     info.m_maxStackSize = m_currentFunction->m_byteCode.GetMaxTos();
-    info.m_lineInfoCount = m_currentFunction->m_lineInfo.Count();
+    info.m_lineInfoCount = (int)m_currentFunction->m_lineInfo.Count();
     info.m_lineInfo = m_currentFunction->m_lineInfo.GetData();
     info.m_debugName = m_currentFunction->m_debugName;
     m_hooks->AddFunction(info);
@@ -678,7 +678,7 @@ bool gmCodeGenPrivate::GenStmtBreak(const gmCodeTreeNode * a_node, gmByteCodeGen
     Patch * patch = &m_patches.InsertLast();
     patch->m_address = a_byteCode->Skip(sizeof(gmptr)); // NOTE: Using gmptr size addresses
     patch->m_next = m_loopStack[m_currentLoop].m_breaks;
-    m_loopStack[m_currentLoop].m_breaks = m_patches.Count()-1;
+    m_loopStack[m_currentLoop].m_breaks = (int)m_patches.Count()-1;
     return true;
   }
 
@@ -698,7 +698,7 @@ bool gmCodeGenPrivate::GenStmtContinue(const gmCodeTreeNode * a_node, gmByteCode
     Patch * patch = &m_patches.InsertLast();
     patch->m_address = a_byteCode->Skip(sizeof(gmptr)); // NOTE: Using gmptr size addresses
     patch->m_next = m_loopStack[m_currentLoop].m_continues;
-    m_loopStack[m_currentLoop].m_continues = m_patches.Count()-1;
+    m_loopStack[m_currentLoop].m_continues = (int)m_patches.Count()-1;
     return true;
   }
 
@@ -719,7 +719,7 @@ bool gmCodeGenPrivate::GenStmtFor(const gmCodeTreeNode * a_node, gmByteCodeGen *
 
   PushLoop();
 
-  loc1 = a_byteCode->Tell();
+  loc1 = (int)a_byteCode->Tell();
 
   // Condition expression
   if(!Generate(a_node->m_children[1], a_byteCode))
@@ -740,7 +740,7 @@ bool gmCodeGenPrivate::GenStmtFor(const gmCodeTreeNode * a_node, gmByteCodeGen *
   }
 
   // Continue patch
-  continueAddress = a_byteCode->Tell();
+  continueAddress = (int)a_byteCode->Tell();
 
   // Loop Expression
   if(!Generate(a_node->m_children[2], a_byteCode))
@@ -750,7 +750,7 @@ bool gmCodeGenPrivate::GenStmtFor(const gmCodeTreeNode * a_node, gmByteCodeGen *
   }
 
   a_byteCode->EmitPtr(BC_BRA, loc1);
-  loc1 = a_byteCode->Tell();
+  loc1 = (int)a_byteCode->Tell();
   if(a_node->m_children[1] != NULL)
   {
     a_byteCode->Seek(loc2);
@@ -782,7 +782,7 @@ bool gmCodeGenPrivate::GenStmtForEach(const gmCodeTreeNode * a_node, gmByteCodeG
   // Push the first iterator
   a_byteCode->Emit(BC_PUSHINT, (gmuint32) -2); // first iterator value.
 
-  continueAddress = a_byteCode->Tell();
+  continueAddress = (int)a_byteCode->Tell();
 
   // Generate call
   const char * keyVar = s_tempVarName1;
@@ -793,7 +793,7 @@ bool gmCodeGenPrivate::GenStmtForEach(const gmCodeTreeNode * a_node, gmByteCodeG
   gmuint16 valueOffset = (gmuint16) m_currentFunction->SetVariableType(valueVar, CTVT_LOCAL);
   gmuint32 opcode = (keyOffset << 16) | (valueOffset & 0xffff);
 
-  loc1 = a_byteCode->Tell();
+  loc1 = (int)a_byteCode->Tell();
   a_byteCode->Emit(BC_FOREACH, opcode);
 
   // Skip space for jump
@@ -807,7 +807,7 @@ bool gmCodeGenPrivate::GenStmtForEach(const gmCodeTreeNode * a_node, gmByteCodeG
   }
 
   a_byteCode->EmitPtr(BC_BRA, (gmuint32) loc1);
-  breakAddress = a_byteCode->Seek(loc2);
+  breakAddress = (int)a_byteCode->Seek(loc2);
   a_byteCode->EmitPtr(BC_BRZ, breakAddress);
   a_byteCode->Seek(breakAddress);
 
@@ -832,7 +832,7 @@ bool gmCodeGenPrivate::GenStmtWhile(const gmCodeTreeNode * a_node, gmByteCodeGen
   PushLoop();
 
   // Continue address
-  loc1 = continueAddress = a_byteCode->Tell();
+  loc1 = continueAddress = (int)a_byteCode->Tell();
 
   // Condition expression
   if(!Generate(a_node->m_children[0], a_byteCode)) 
@@ -851,7 +851,7 @@ bool gmCodeGenPrivate::GenStmtWhile(const gmCodeTreeNode * a_node, gmByteCodeGen
   }
   
   a_byteCode->EmitPtr(BC_BRA, loc1);
-  loc1 = a_byteCode->Seek(loc2);
+  loc1 = (int)a_byteCode->Seek(loc2);
   a_byteCode->EmitPtr(BC_BRZ, loc1);
   a_byteCode->Seek(loc1);
 
@@ -872,7 +872,7 @@ bool gmCodeGenPrivate::GenStmtDoWhile(const gmCodeTreeNode * a_node, gmByteCodeG
 
   PushLoop();
 
-  loc1 = a_byteCode->Tell();
+  loc1 = (int)a_byteCode->Tell();
 
   // Loop body
   if(!Generate(a_node->m_children[1], a_byteCode)) 
@@ -882,7 +882,7 @@ bool gmCodeGenPrivate::GenStmtDoWhile(const gmCodeTreeNode * a_node, gmByteCodeG
   }
 
   // Continue address
-  continueAddress = a_byteCode->Tell();
+  continueAddress = (int)a_byteCode->Tell();
 
   // Condition expression
   if(!Generate(a_node->m_children[0], a_byteCode)) 
@@ -893,7 +893,7 @@ bool gmCodeGenPrivate::GenStmtDoWhile(const gmCodeTreeNode * a_node, gmByteCodeG
 
   a_byteCode->EmitPtr(BC_BRNZ, loc1);
 
-  loc1 = a_byteCode->Tell();
+  loc1 = (int)a_byteCode->Tell();
 
   ApplyPatches(m_loopStack[m_currentLoop].m_breaks, a_byteCode, loc1);
   ApplyPatches(m_loopStack[m_currentLoop].m_continues, a_byteCode, continueAddress);
@@ -917,7 +917,7 @@ bool gmCodeGenPrivate::GenStmtIf(const gmCodeTreeNode * a_node, gmByteCodeGen *
     if(!Generate(a_node->m_children[1], a_byteCode)) return false;
     loc2 = a_byteCode->Skip(SIZEOF_BC_BRA);
     if(!Generate(a_node->m_children[2], a_byteCode)) return false;
-    loc3 = a_byteCode->Seek(loc1);
+    loc3 = (int)a_byteCode->Seek(loc1);
     a_byteCode->EmitPtr(BC_BRZ, loc2+SIZEOF_BC_BRA);
     a_byteCode->Seek(loc2);
     a_byteCode->EmitPtr(BC_BRA, loc3);
@@ -928,7 +928,7 @@ bool gmCodeGenPrivate::GenStmtIf(const gmCodeTreeNode * a_node, gmByteCodeGen *
     if(!Generate(a_node->m_children[0], a_byteCode)) return false;
     loc1 = a_byteCode->Skip(SIZEOF_BC_BRA);
     if(!Generate(a_node->m_children[1], a_byteCode)) return false;
-    loc2 = a_byteCode->Seek(loc1);
+    loc2 = (int)a_byteCode->Seek(loc1);
     m_currentFunction->m_currentLine = a_node->m_lineNumber;
     a_byteCode->EmitPtr(BC_BRZ, loc2);
     a_byteCode->Seek(loc2);
@@ -961,7 +961,7 @@ bool gmCodeGenPrivate::GenStmtFork(const gmCodeTreeNode * a_node, gmByteCodeGen
    if (!Generate(a_node->m_children[0], a_byteCode )) return false;
    a_byteCode->Emit( BC_RET );
    
-   loc2 = a_byteCode->Seek( loc1 );
+   loc2 = (int)a_byteCode->Seek( loc1 );
    a_byteCode->Emit( BC_FORK, loc2 );
    a_byteCode->Seek( loc2 );
    
@@ -1254,7 +1254,7 @@ bool gmCodeGenPrivate::GenExprOpAnd(const gmCodeTreeNode * a_node, gmByteCodeGen
   if(!Generate(a_node->m_children[1], a_byteCode)) return false;
 
   // Seek back and finish expression 1
-  loc2 = a_byteCode->Seek(loc1);
+  loc2 = (int)a_byteCode->Seek(loc1);
   a_byteCode->EmitPtr(BC_BRZK, loc2);
   a_byteCode->Seek(loc2);
 
@@ -1278,7 +1278,7 @@ bool gmCodeGenPrivate::GenExprOpOr(const gmCodeTreeNode * a_node, gmByteCodeGen
   if(!Generate(a_node->m_children[1], a_byteCode)) return false;
 
   // Seek back and finish expression 1
-  loc2 = a_byteCode->Seek(loc1);
+  loc2 = (int)a_byteCode->Seek(loc1);
   a_byteCode->EmitPtr(BC_BRNZK, loc2);
   a_byteCode->Seek(loc2);
 
@@ -1395,17 +1395,15 @@ bool gmCodeGenPrivate::GenExprConstant(const gmCodeTreeNode * a_node, gmByteCode
       }
       else
       {
-#if 1 // 32bit Integers
-        a_byteCode->Emit(BC_PUSHINT, *((gmint *) &a_node->m_data.m_iValue));
-#else
-        a_byteCode->EmitPtr(BC_PUSHINT, *((gmptr *) &a_node->m_data.m_iValue));
-#endif
+        // Note, must support 32 or 64 bit float
+        a_byteCode->Emit(BC_PUSHINT, a_node->m_data.m_iValue);
       }
       break;
     }
     case CTNCT_FLOAT : // FLOAT
     {
-      a_byteCode->Emit(BC_PUSHFP, *((gmuint32 *) ((void *) &a_node->m_data.m_fValue)));
+      // Note, must support 32 or 64 bit float
+      a_byteCode->Emit(BC_PUSHFP, a_node->m_data.m_fValue);
       break;
     }
     case CTNCT_STRING : // STRING
@@ -1577,7 +1575,7 @@ void gmCodeGenPrivate::FunctionState::Reset()
 
 int gmCodeGenPrivate::FunctionState::GetVariableOffset(const char * a_symbol, gmCodeTreeVariableType &a_type)
 {
-  for(gmuint v = 0; v < m_variables.Count(); ++v)
+  for(gmint v = 0; v < m_variables.Count(); ++v)
   {
     Variable &variable = m_variables[v];
     if(strcmp(variable.m_symbol, a_symbol) == 0)
@@ -1599,7 +1597,7 @@ int gmCodeGenPrivate::FunctionState::GetVariableOffset(const char * a_symbol, gm
 
 int gmCodeGenPrivate::FunctionState::SetVariableType(const char * a_symbol, gmCodeTreeVariableType a_type)
 {
-  for(gmuint v = 0; v < m_variables.Count(); ++v)
+  for(gmint v = 0; v < m_variables.Count(); ++v)
   {
     Variable &variable = m_variables[v];
     if(strcmp(variable.m_symbol, a_symbol) == 0)
@@ -1691,7 +1689,7 @@ gmCodeGenPrivate::FunctionState * gmCodeGenPrivate::PopFunction()
 void gmCodeGenPrivate::PushLoop()
 {
   LoopInfo * loop = &m_loopStack.InsertLast();
-  m_currentLoop = m_loopStack.Count()-1;
+  m_currentLoop = (int)m_loopStack.Count()-1;
   loop->m_breaks = -1;
   loop->m_continues = -1;
 }
@@ -1702,7 +1700,7 @@ void gmCodeGenPrivate::PopLoop()
   m_loopStack.RemoveLast();
   if(m_loopStack.Count())
   {
-    m_currentLoop = m_loopStack.Count() - 1;
+    m_currentLoop = (int)m_loopStack.Count() - 1;
   }
   else
   {
@@ -1713,7 +1711,7 @@ void gmCodeGenPrivate::PopLoop()
 
 void gmCodeGenPrivate::ApplyPatches(int a_patches, gmByteCodeGen * a_byteCode, gmuint32 a_value)
 {
-  unsigned int pos = a_byteCode->Tell();
+  int pos = (int)a_byteCode->Tell();
   while(a_patches >= 0)
   {
     Patch * curPatch = &m_patches[a_patches];

+ 33 - 34
gmsrc/src/gm/gmCodeTree.cpp

@@ -171,9 +171,9 @@ static void PrintRecursive(const gmCodeTreeNode * a_node, FILE * a_fp, bool a_fi
         //
         switch(a_node->m_subType)
         {
-          case CTNDT_PARAMETER : fprintf(a_fp, "CTNDT_PARAMETER:%04d"GM_NL, a_node->m_lineNumber); break;
-          case CTNDT_VARIABLE : fprintf(a_fp, "CTNDT_VARIABLE:%04d, type %d"GM_NL, a_node->m_lineNumber, a_node->m_subTypeType); break;
-          default : fprintf(a_fp, "UNKNOWN DECLARATION:"GM_NL); break;
+          case CTNDT_PARAMETER : fprintf(a_fp, "CTNDT_PARAMETER:%04d" GM_NL, a_node->m_lineNumber); break;
+          case CTNDT_VARIABLE : fprintf(a_fp, "CTNDT_VARIABLE:%04d, type %d" GM_NL, a_node->m_lineNumber, a_node->m_subTypeType); break;
+          default : fprintf(a_fp, "UNKNOWN DECLARATION:" GM_NL); break;
         }
       }
       else if(a_node->m_type == CTNT_STATEMENT)
@@ -183,19 +183,19 @@ static void PrintRecursive(const gmCodeTreeNode * a_node, FILE * a_fp, bool a_fi
         //
         switch(a_node->m_subType)
         {
-          case CTNST_RETURN : fprintf(a_fp, "CTNST_RETURN:%04d"GM_NL, a_node->m_lineNumber); break;
-          case CTNST_BREAK : fprintf(a_fp, "CTNST_BREAK:%04d"GM_NL, a_node->m_lineNumber); break;
-          case CTNST_CONTINUE : fprintf(a_fp, "CTNST_CONTINUE:%04d"GM_NL, a_node->m_lineNumber); break;
-          case CTNST_FOR : fprintf(a_fp, "CTNST_FOR:%04d"GM_NL, a_node->m_lineNumber); break;
-          case CTNST_FOREACH : fprintf(a_fp, "CTNST_FOREACH:%04d"GM_NL, a_node->m_lineNumber); break;
-          case CTNST_WHILE : fprintf(a_fp, "CTNST_WHILE:%04d"GM_NL, a_node->m_lineNumber); break;
-          case CTNST_DOWHILE : fprintf(a_fp, "CTNST_DOWHILE:%04d"GM_NL, a_node->m_lineNumber); break;
-          case CTNST_IF : fprintf(a_fp, "CTNST_IF:%04d"GM_NL, a_node->m_lineNumber); break;
-          case CTNST_COMPOUND : fprintf(a_fp, "CTNST_COMPOUND:%04d"GM_NL, a_node->m_lineNumber); break;
+          case CTNST_RETURN : fprintf(a_fp, "CTNST_RETURN:%04d" GM_NL, a_node->m_lineNumber); break;
+          case CTNST_BREAK : fprintf(a_fp, "CTNST_BREAK:%04d" GM_NL, a_node->m_lineNumber); break;
+          case CTNST_CONTINUE : fprintf(a_fp, "CTNST_CONTINUE:%04d" GM_NL, a_node->m_lineNumber); break;
+          case CTNST_FOR : fprintf(a_fp, "CTNST_FOR:%04d" GM_NL, a_node->m_lineNumber); break;
+          case CTNST_FOREACH : fprintf(a_fp, "CTNST_FOREACH:%04d" GM_NL, a_node->m_lineNumber); break;
+          case CTNST_WHILE : fprintf(a_fp, "CTNST_WHILE:%04d" GM_NL, a_node->m_lineNumber); break;
+          case CTNST_DOWHILE : fprintf(a_fp, "CTNST_DOWHILE:%04d" GM_NL, a_node->m_lineNumber); break;
+          case CTNST_IF : fprintf(a_fp, "CTNST_IF:%04d" GM_NL, a_node->m_lineNumber); break;
+          case CTNST_COMPOUND : fprintf(a_fp, "CTNST_COMPOUND:%04d" GM_NL, a_node->m_lineNumber); break;
 #if GM_USE_FORK
-          case CTNST_FORK : fprintf(a_fp, "CTNST_FORK:%04d"GM_NL, a_node->m_lineNumber); break;
+          case CTNST_FORK : fprintf(a_fp, "CTNST_FORK:%04d" GM_NL, a_node->m_lineNumber); break;
 #endif //GM_USE_FORK
-          default : fprintf(a_fp, "UNKNOWN STATEMENT:"GM_NL); break;
+          default : fprintf(a_fp, "UNKNOWN STATEMENT:" GM_NL); break;
         }
       }
       else if(a_node->m_type == CTNT_EXPRESSION)
@@ -209,11 +209,11 @@ static void PrintRecursive(const gmCodeTreeNode * a_node, FILE * a_fp, bool a_fi
           {
             if(a_node->m_subTypeType < CTNOT_MAX)
             {
-              fprintf(a_fp, "CTNET_OPERATION:%04d : %s"GM_NL, a_node->m_lineNumber, gmGetOperatorTypeName((gmCodeTreeNodeOperationType) a_node->m_subTypeType));
+              fprintf(a_fp, "CTNET_OPERATION:%04d : %s" GM_NL, a_node->m_lineNumber, gmGetOperatorTypeName((gmCodeTreeNodeOperationType) a_node->m_subTypeType));
             }
             else
             { 
-              fprintf(a_fp, "UNKNOWN CTNET_OPERATION"GM_NL);
+              fprintf(a_fp, "UNKNOWN CTNET_OPERATION" GM_NL);
             }
             break;
           }
@@ -222,26 +222,26 @@ static void PrintRecursive(const gmCodeTreeNode * a_node, FILE * a_fp, bool a_fi
           {
             switch(a_node->m_subTypeType)
             {
-              case CTNCT_INT : fprintf(a_fp, "CTNCT_INT:%04d : %d"GM_NL, a_node->m_lineNumber, a_node->m_data.m_iValue); break;
-              case CTNCT_FLOAT : fprintf(a_fp, "CTNCT_FLOAT:%04d : %f"GM_NL, a_node->m_lineNumber, a_node->m_data.m_fValue); break;
-              case CTNCT_STRING : fprintf(a_fp, "CTNCT_STRING:%04d : %s"GM_NL, a_node->m_lineNumber, a_node->m_data.m_string); break;
-              case CTNCT_NULL : fprintf(a_fp, "CTNCT_NULL:%04d"GM_NL, a_node->m_lineNumber); break;
-              default: fprintf(a_fp, "UNKNOWN CTNET_CONSTANT"GM_NL);
+              case CTNCT_INT : fprintf(a_fp, "CTNCT_INT:%04d : %lld" GM_NL, a_node->m_lineNumber, (gmint64)a_node->m_data.m_iValue); break;
+              case CTNCT_FLOAT : fprintf(a_fp, "CTNCT_FLOAT:%04d : %f" GM_NL, a_node->m_lineNumber, a_node->m_data.m_fValue); break;
+              case CTNCT_STRING : fprintf(a_fp, "CTNCT_STRING:%04d : %s" GM_NL, a_node->m_lineNumber, a_node->m_data.m_string); break;
+              case CTNCT_NULL : fprintf(a_fp, "CTNCT_NULL:%04d" GM_NL, a_node->m_lineNumber); break;
+              default: fprintf(a_fp, "UNKNOWN CTNET_CONSTANT" GM_NL);
             }
             break;
           }
 
-          case CTNET_IDENTIFIER : fprintf(a_fp, "CTNET_IDENTIFIER:%04d : %s"GM_NL, a_node->m_lineNumber, a_node->m_data.m_string); break;
-          case CTNET_THIS : fprintf(a_fp, "CTNET_THIS:%04d"GM_NL, a_node->m_lineNumber); break;
-          case CTNET_CALL : fprintf(a_fp, "CTNET_CALL:%04d"GM_NL, a_node->m_lineNumber); break;
-          case CTNET_FUNCTION : fprintf(a_fp, "CTNET_FUNCTION:%04d"GM_NL, a_node->m_lineNumber); break;
-          case CTNET_TABLE : fprintf(a_fp, "CTNET_TABLE:%04d"GM_NL, a_node->m_lineNumber); break;
-          default : fprintf(a_fp, "UNKNOWN EXPRESSION:"GM_NL); break;
+          case CTNET_IDENTIFIER : fprintf(a_fp, "CTNET_IDENTIFIER:%04d : %s" GM_NL, a_node->m_lineNumber, a_node->m_data.m_string); break;
+          case CTNET_THIS : fprintf(a_fp, "CTNET_THIS:%04d" GM_NL, a_node->m_lineNumber); break;
+          case CTNET_CALL : fprintf(a_fp, "CTNET_CALL:%04d" GM_NL, a_node->m_lineNumber); break;
+          case CTNET_FUNCTION : fprintf(a_fp, "CTNET_FUNCTION:%04d" GM_NL, a_node->m_lineNumber); break;
+          case CTNET_TABLE : fprintf(a_fp, "CTNET_TABLE:%04d" GM_NL, a_node->m_lineNumber); break;
+          default : fprintf(a_fp, "UNKNOWN EXPRESSION:" GM_NL); break;
         }
       }
       else
       {
-        fprintf(a_fp, "UNKNOWN NODE TYPE"GM_NL);
+        fprintf(a_fp, "UNKNOWN NODE TYPE" GM_NL);
       }
 
       // print the child nodes
@@ -301,7 +301,7 @@ void gmCodeTreeNode::SetChild(int a_index, gmCodeTreeNode * a_node)
 }
 
 
-static bool gmFold(float &a_r, float a_a, int a_op)
+static bool gmFold(gmfloat &a_r, gmfloat a_a, int a_op)
 {
   switch(a_op)
   {
@@ -313,7 +313,7 @@ static bool gmFold(float &a_r, float a_a, int a_op)
 }
 
 
-static bool gmFold(int &a_r, int a_a, int a_op)
+static bool gmFold(gmint &a_r, gmint a_a, int a_op)
 {
   switch(a_op)
   {
@@ -327,14 +327,13 @@ static bool gmFold(int &a_r, int a_a, int a_op)
 }
 
 
-#include <math.h>
-static bool gmFold(float &a_r, float a_a, float a_b, int a_op)
+static bool gmFold(gmfloat &a_r, gmfloat a_a, gmfloat a_b, int a_op)
 {
   switch(a_op)
   {
     case CTNOT_TIMES : a_r = a_a * a_b; break;
     case CTNOT_DIVIDE : if(a_b == 0) return false; a_r = a_a / a_b; break;
-    case CTNOT_REM : a_r = fmodf(a_a, a_b); break;
+    case CTNOT_REM : a_r = fmod(a_a, a_b); break;
     case CTNOT_ADD : a_r = a_a + a_b; break;
     case CTNOT_MINUS : a_r = a_a - a_b; break;
     default: return false;
@@ -343,7 +342,7 @@ static bool gmFold(float &a_r, float a_a, float a_b, int a_op)
 }
 
 
-static bool gmFold(int &a_r, int a_a, int a_b, int a_op)
+static bool gmFold(gmint &a_r, gmint a_a, gmint a_b, int a_op)
 {
   switch(a_op)
   {

+ 2 - 2
gmsrc/src/gm/gmCodeTree.h

@@ -206,8 +206,8 @@ enum gmCodeTreeNodeConstantType
 union gmCodeTreeNodeData
 {
   char * m_string;
-  int m_iValue;
-  float m_fValue;
+  gmint m_iValue;
+  gmfloat m_fValue;
 };
 
 

+ 1 - 1
gmsrc/src/gm/gmConfig.h

@@ -21,7 +21,7 @@
 #include <string.h> // stricmp, strcmp, strcpy, strlen, strcat, memset, memcpy (binds: strlwr, wtrupr, strspn, strcspn, strchr, strstr)
 #include <stdarg.h> // va_start, va_end
 #include <ctype.h> // isdigit
-#include <math.h> // floorf, fmodf
+#include <cmath> // floor, fmod (with overloads)
 
 
 /// \enum gmEndian Endian byte order

+ 1 - 1
gmsrc/src/gm/gmDebug.cpp

@@ -375,7 +375,7 @@ gmDebugSession &gmDebugSession::Pack(const char * a_val)
 
 void gmDebugSession::Send()
 {
-  m_sendMessage(this, m_out.GetData(), m_out.GetSize());
+  m_sendMessage(this, m_out.GetData(), (int)m_out.GetSize());
   m_out.Reset();
 }
 

+ 6 - 6
gmsrc/src/gm/gmHash.h

@@ -96,7 +96,7 @@ public:
 
   // members
 
-  gmHash(gmuint a_size);
+  gmHash(gmint a_size);
   ~gmHash();
 
   void RemoveAll();
@@ -171,7 +171,7 @@ public:
   
   static inline gmuint Hash(const void * a_key) 
   {
-    return (gmuint) (((gmuint) a_key) / sizeof(double));
+    return (gmuint) (((gmuint)(gmuptr)a_key) / sizeof(double)); // Note ptr -> int size ptr -> truncated int
   }
 
   static inline int Compare(const void * a_keyA, const void * a_keyB)
@@ -183,13 +183,13 @@ public:
 
 
 TMPL
-QUAL::gmHash(gmuint a_size)
+QUAL::gmHash(gmint a_size)
 {
   // make sure size is power of 2
   GM_ASSERT((a_size & (a_size - 1)) == 0);
   m_size = a_size;
   m_table = GM_NEW(T * [a_size]);
-  int i = m_size;
+  gmint i = m_size;
   while(i--)
   {
     m_table[i] = NULL;
@@ -207,7 +207,7 @@ QUAL::~gmHash()
 TMPL
 void QUAL::RemoveAll()
 {
-  int i = m_size;
+  gmint i = m_size;
   while(i--)
   {
     m_table[i] = NULL;
@@ -220,7 +220,7 @@ TMPL
 void QUAL::RemoveAndDeleteAll()
 {
   // iterate over table and delete all
-  int i = m_size;
+  gmint i = m_size;
   T * node, * next;
   while(i--)
   {

+ 4 - 4
gmsrc/src/gm/gmLibHooks.cpp

@@ -99,11 +99,11 @@ bool gmLibHooks::End(int a_errors)
     t = (m_debug) ? 1 : 0;
     *m_stream << t;
 
-    offsetPos = m_stream->Tell();
+    offsetPos = (gmuint32)m_stream->Tell();
     *m_stream << offsets[0] << offsets[1] << offsets[2];
 
     // write the string table
-    offsets[0] = m_stream->Tell();
+    offsets[0] = (gmuint32)m_stream->Tell();
     t = m_symbolOffset;
     *m_stream << t;
     USymbol * symbol = m_symbols.GetLast();
@@ -117,7 +117,7 @@ bool gmLibHooks::End(int a_errors)
     // write the source code
     if(m_debug && m_source)
     {
-      offsets[1] = m_stream->Tell();
+      offsets[1] = (gmuint32)m_stream->Tell();
       t = (gmuint32)strlen(m_source) + 1;
       t1 = 0;
       *m_stream << t << t1;
@@ -129,7 +129,7 @@ bool gmLibHooks::End(int a_errors)
     }
 
     // write the functions
-    offsets[2] = m_stream->Tell();
+    offsets[2] = (gmuint32)m_stream->Tell();
     t = m_functionId;
     *m_stream << t;
     m_stream->Write(m_functionStream.GetData(), m_functionStream.GetSize());

+ 10 - 14
gmsrc/src/gm/gmMachine.cpp

@@ -130,7 +130,7 @@ public:
 //
 void gmDefaultPrintCallback(gmMachine * a_machine, const char * a_string)
 {
-  GM_PRINTF("%s"GM_NL, a_string);
+  GM_PRINTF("%s" GM_NL, a_string);
 }
 
 //
@@ -172,15 +172,14 @@ void GM_CDECL gmMachine::ScanRootsCallBack(gmMachine* a_machine, gmGarbageCollec
     a_gc->GetNextObject(a_machine->m_global);
   }
   // iterate over type variables and mark
-  gmuint i;
-  for(i = 0; i < a_machine->m_types.Count(); ++i)
+  for(gmint i = 0; i < a_machine->m_types.Count(); ++i)
   {
     a_gc->GetNextObject(a_machine->m_types[i].m_variables);
   }
 
 #if !GM_GC_KEEP_PERSISTANT_SEPARATE
   //NOTE This needs to be spread over time perhaps.
-  for(i=0; i<(gmuint)a_machine->m_numPermanantStrings; ++i)
+  for(gmint i=0; i < a_machine->m_numPermanantStrings; ++i)
   {
     a_gc->GetNextObject(a_machine->m_permanantStrings[i]);
   }
@@ -272,8 +271,7 @@ void gmMachine::ResetAndFreeMemory()
   #endif //!GM_GC_KEEP_PERSISTANT_SEPARATE
 
   m_global = NULL;
-  gmuint i;
-  for(i = 0; i < m_types.Count(); ++i)
+  for(gmint i = 0; i < m_types.Count(); ++i)
   {
     m_types[i].m_variables = NULL;
     m_types[i].m_name = NULL;
@@ -292,8 +290,7 @@ void gmMachine::ResetAndFreeMemory()
   }
   m_global = NULL; //Global was freed with the rest
   // operators\types
-  gmuint i;
-  for(i = 0; i < m_types.Count(); ++i)
+  for(gmint i = 0; i < m_types.Count(); ++i)
   {
     m_types[i].m_variables = NULL;
     m_types[i].m_name = NULL;
@@ -1172,7 +1169,7 @@ int gmMachine::Execute(gmuint32 a_delta)
 
   CollectGarbage();
 
-  return m_threads.Count();
+  return (int)m_threads.Count();
 }
 
 
@@ -1399,8 +1396,7 @@ bool gmMachine::CollectGarbage(bool a_forceFullCollect)
 
     // iterate over global variables and mark
     m_global->Mark(this, m_mark);
-    gmuint i;
-    for(i = 0; i < m_types.Count(); ++i)
+    for(gmint i = 0; i < m_types.Count(); ++i)
     {
       m_types[i].m_variables->Mark(this, m_mark);
     }
@@ -1706,7 +1702,7 @@ void gmMachine::Type::Init()
 void gmMachine::ResetDefaultTypes()
 {
   // clean up old types
-  gmuint i;
+  gmint i;
   for(i = 0; i < m_types.Count(); ++i)
   {
 #if GM_USE_INCGC
@@ -1921,11 +1917,11 @@ gmTableObject * gmMachine::GetTypeTable(gmType a_type)
 
 gmType gmMachine::GetTypeId(const char * a_typename) const
 {
-  for(gmuint id = GM_NULL; id < m_types.Count(); ++id)
+  for(gmint id = GM_NULL; id < m_types.Count(); ++id)
   {
     if( strcmp((const char *)(*m_types[id].m_name), a_typename) == 0 )
     {
-      return id;
+      return (gmType)id;
     }
   }
   return GM_INVALID_TYPE;

+ 14 - 14
gmsrc/src/gm/gmMachineLib.cpp

@@ -103,7 +103,7 @@ static int GM_CDECL gmSetDesiredMemoryUsageHard(gmThread * a_thread) // mem usag
   GM_CHECK_NUM_PARAMS(1);
   GM_CHECK_INT_PARAM(mem, 0);
 
-  a_thread->GetMachine()->SetDesiredByteMemoryUsageHard(mem);
+  a_thread->GetMachine()->SetDesiredByteMemoryUsageHard((int)mem);
   return GM_OK;
 }
 
@@ -113,7 +113,7 @@ static int GM_CDECL gmSetDesiredMemoryUsageSoft(gmThread * a_thread) // mem usag
   GM_CHECK_NUM_PARAMS(1);
   GM_CHECK_INT_PARAM(mem, 0);
 
-  a_thread->GetMachine()->SetDesiredByteMemoryUsageSoft(mem);
+  a_thread->GetMachine()->SetDesiredByteMemoryUsageSoft((int)mem);
   return GM_OK;
 }
 
@@ -220,8 +220,8 @@ static int GM_CDECL gmSleep(gmThread * a_thread) // float\int param time in seco
   gmType type = a_thread->ParamType(0);
   gmuint32 ms = 0;
   
-  if(type == GM_INT) ms = a_thread->Param(0).m_value.m_int * 1000;
-  else if(type == GM_FLOAT) ms = (gmuint32) floorf(a_thread->Param(0).m_value.m_float * 1000.0f);
+  if(type == GM_INT) ms = (gmuint32)(a_thread->Param(0).m_value.m_int * 1000);
+  else if(type == GM_FLOAT) ms = (gmuint32) floor(a_thread->Param(0).m_value.m_float * 1000.0f);
 
   a_thread->Sys_SetTimeStamp(a_thread->GetMachine()->GetTime() + ms);
   return GM_SYS_SLEEP;
@@ -290,7 +290,7 @@ static int GM_CDECL gmKillThread(gmThread * a_thread) // thread id
   }
 
   // Attempt to kill other thread by Id
-  gmThread * thread = a_thread->GetMachine()->GetThread(id);
+  gmThread * thread = a_thread->GetMachine()->GetThread((int)id);
   if( thread )
   {
     thread->GetMachine()->Sys_SwitchState(thread, gmThread::KILLED); // Kill other thread
@@ -475,7 +475,7 @@ static int GM_CDECL gmSetStateOnThread(gmThread * a_thread) // (threadid, fp, pa
   GM_ASSERT(s_gmStateUserType != GM_NULL); 
 
   // get the target thread
-  gmThread * thread = a_thread->GetMachine()->GetThread(threadId);
+  gmThread * thread = a_thread->GetMachine()->GetThread((int)threadId);
   if(thread == a_thread)
   {
     a_thread->GetMachine()->GetLog().LogEntry("use setstate() on own thread");
@@ -558,7 +558,7 @@ static int GM_CDECL gmGetState(gmThread * a_thread) // return var
   if(a_thread->GetNumParams() >= 1)
   {
     GM_CHECK_INT_PARAM(testThreadId, 0);
-    testThread = a_thread->GetMachine()->GetThread(testThreadId);
+    testThread = a_thread->GetMachine()->GetThread((int)testThreadId);
     if(!testThread)
     {
       a_thread->PushNull();
@@ -587,7 +587,7 @@ static int GM_CDECL gmGetLastState(gmThread * a_thread) // return var
   if(a_thread->GetNumParams() >= 1)
   {
     GM_CHECK_INT_PARAM(testThreadId, 0);
-    testThread = a_thread->GetMachine()->GetThread(testThreadId);
+    testThread = a_thread->GetMachine()->GetThread((int)testThreadId);
     if(!testThread)
     {
       a_thread->PushNull();
@@ -633,7 +633,7 @@ static int GM_CDECL gmSignal(gmThread * a_thread) // var, dest thread id
 {
   GM_CHECK_NUM_PARAMS(1);
   GM_INT_PARAM(dstThreadId, 1, GM_INVALID_THREAD);
-  a_thread->GetMachine()->Signal(a_thread->Param(0), dstThreadId, a_thread->GetId());
+  a_thread->GetMachine()->Signal(a_thread->Param(0), (int)dstThreadId, a_thread->GetId());
   return GM_OK;  
 }
 
@@ -837,7 +837,7 @@ static int GM_CDECL gmfFormat(gmThread * a_thread) // string, params ...
 						GM_EXCEPTION_MSG("expected int as param %d",param);
 						return GM_EXCEPTION;
 					}
-					sprintf(buffer, "%c", a_thread->Param(param).GetInt());
+					sprintf(buffer, "%c", (int)a_thread->Param(param).GetInt());
 					gmConcat(a_thread->GetMachine(), str, len, size, buffer, 64);
 					++param;
 					break;
@@ -852,7 +852,7 @@ static int GM_CDECL gmfFormat(gmThread * a_thread) // string, params ...
 						GM_EXCEPTION_MSG("expected int as param %d",param);
 						return GM_EXCEPTION;
 					}
-					sprintf(buffer, "%d", a_thread->Param(param).GetInt());
+					sprintf(buffer, "%lld", (gmint64)a_thread->Param(param).GetInt());
 					gmConcat(a_thread->GetMachine(), str, len, size, buffer, 64);
 					++param;
 					break;
@@ -867,7 +867,7 @@ static int GM_CDECL gmfFormat(gmThread * a_thread) // string, params ...
 						GM_EXCEPTION_MSG("expected int as param %d",param);
 						return GM_EXCEPTION;
 					}
-					sprintf(buffer, "%u", a_thread->Param(param).GetInt());
+					sprintf(buffer, "%llu", (gmint64)a_thread->Param(param).GetInt());
 					gmConcat(a_thread->GetMachine(), str, len, size, buffer, 64);
 					++param;
 					break;
@@ -882,7 +882,7 @@ static int GM_CDECL gmfFormat(gmThread * a_thread) // string, params ...
 						GM_EXCEPTION_MSG("expected int as param %d",param);
 						return GM_EXCEPTION;
 					}
-					gmItoa(a_thread->Param(param).GetInt(), buffer, 2);
+					sprintf(buffer, "%lld", (gmint64)a_thread->Param(param).GetInt());
 					gmConcat(a_thread->GetMachine(), str, len, size, buffer, 64);
 					++param;
 					break;
@@ -897,7 +897,7 @@ static int GM_CDECL gmfFormat(gmThread * a_thread) // string, params ...
 						GM_EXCEPTION_MSG("expected int as param %d",param);
 						return GM_EXCEPTION;
 					}
-					sprintf(buffer, "%x", a_thread->Param(param).GetInt());
+					sprintf(buffer, "%llx", (gmint64)a_thread->Param(param).GetInt());
 					gmConcat(a_thread->GetMachine(), str, len, size, buffer, 64);
 					++param;
 					break;

+ 1 - 1
gmsrc/src/gm/gmMem.h

@@ -23,7 +23,7 @@
 #endif
 
 /// \brief Align pointer
-#define _gmAlignMem(PTR, ALIGN)                   (void*)(((gmuptr)(PTR) + (ALIGN) - 1) & ~((ALIGN)-1))
+#define _gmAlignMem(PTR, ALIGN)                   (void*)(((gmuptr)(PTR) + gmptr(ALIGN) - 1) & ~(gmptr(ALIGN)-1))
 
 
 /// \brief gmConstructElement will construct a single object at location

+ 5 - 5
gmsrc/src/gm/gmOperators.cpp

@@ -13,7 +13,7 @@
 #include "gmOperators.h"
 #include "gmThread.h"
 #include "gmStringObject.h"
-//#include <math.h>
+
 
 const char * gmGetOperatorName(gmOperator a_operator)
 {
@@ -220,7 +220,7 @@ void GM_CDECL gmIntOpNOT(gmThread * a_thread, gmVariable * a_operands)
 // GM_FLOAT
 //
 
-#define INTTOFLOAT(A) (((A)->m_type == GM_FLOAT) ? (A)->m_value.m_float : (float) (A)->m_value.m_int)
+#define INTTOFLOAT(A) (((A)->m_type == GM_FLOAT) ? (A)->m_value.m_float : (gmfloat) (A)->m_value.m_int)
 
 void GM_CDECL gmFloatOpAdd(gmThread * a_thread, gmVariable * a_operands)
 {
@@ -261,7 +261,7 @@ void GM_CDECL gmFloatOpRem(gmThread * a_thread, gmVariable * a_operands)
 #if GMMACHINE_GMCHECKDIVBYZERO
   if(INTTOFLOAT(a_operands + 1) != 0)
   {
-    a_operands->m_value.m_float = fmodf(INTTOFLOAT(a_operands), INTTOFLOAT(a_operands + 1));
+    a_operands->m_value.m_float = fmod(INTTOFLOAT(a_operands), INTTOFLOAT(a_operands + 1));
     a_operands->m_type = GM_FLOAT;
   }
   else
@@ -271,7 +271,7 @@ void GM_CDECL gmFloatOpRem(gmThread * a_thread, gmVariable * a_operands)
     // NOTE: No proper way to signal exception from here at present
   }
 #else // GMMACHINE_GMCHECKDIVBYZERO
-  a_operands->m_value.m_float = fmodf(INTTOFLOAT(a_operands), INTTOFLOAT(a_operands + 1));
+  a_operands->m_value.m_float = fmod(INTTOFLOAT(a_operands), INTTOFLOAT(a_operands + 1));
   a_operands->m_type = GM_FLOAT;
 #endif // GMMACHINE_GMCHECKDIVBYZERO
 }
@@ -353,7 +353,7 @@ inline const char * gmUnknownToString(gmMachine * a_machine, gmVariable * a_unkn
   }
   if(a_unknown->m_type == GM_INT)
   {
-    sprintf(a_buffer, "%d", a_unknown->m_value.m_int); // this won't be > 64 chars
+    sprintf(a_buffer, "%lld", (gmint64)a_unknown->m_value.m_int); // this won't be > 64 chars
   }
   else if(a_unknown->m_type == GM_FLOAT)
   {

+ 4 - 4
gmsrc/src/gm/gmParser.y

@@ -236,12 +236,12 @@ tablemember_expression
 var_statement
   : var_type identifier ';'
     {
-      $$ = gmCodeTreeNode::Create(CTNT_DECLARATION, CTNDT_VARIABLE, gmlineno, (int) $1);
+      $$ = gmCodeTreeNode::Create(CTNT_DECLARATION, CTNDT_VARIABLE, gmlineno, (int)(gmptr) $1);
       $$->SetChild(0, $2);
     }
   | var_type identifier '=' constant_expression ';'
     {
-      $$ = gmCodeTreeNode::Create(CTNT_DECLARATION, CTNDT_VARIABLE, gmlineno, (int) $1);
+      $$ = gmCodeTreeNode::Create(CTNT_DECLARATION, CTNDT_VARIABLE, gmlineno, (int)(gmptr) $1);
       $$->SetChild(0, $2);
       ATTACH($$, $$, CreateOperation(CTNOT_ASSIGN, $2, $4));
     }
@@ -250,7 +250,7 @@ var_statement
       gmCodeTreeNode* func = gmCodeTreeNode::Create(CTNT_EXPRESSION, CTNET_FUNCTION, gmlineno);
       func->SetChild(1, $6);
 
-      $$ = gmCodeTreeNode::Create(CTNT_DECLARATION, CTNDT_VARIABLE, gmlineno, (int) $1);
+      $$ = gmCodeTreeNode::Create(CTNT_DECLARATION, CTNDT_VARIABLE, gmlineno, (int)(gmptr) $1);
       $$->SetChild(0, $3);
       ATTACH($$, $$, CreateOperation(CTNOT_ASSIGN, $3, func));
     }
@@ -260,7 +260,7 @@ var_statement
       func->SetChild(0, $5);
       func->SetChild(1, $7);
 
-      $$ = gmCodeTreeNode::Create(CTNT_DECLARATION, CTNDT_VARIABLE, gmlineno, (int) $1);
+      $$ = gmCodeTreeNode::Create(CTNT_DECLARATION, CTNDT_VARIABLE, gmlineno, (int)(gmptr) $1);
       $$->SetChild(0, $3);
       ATTACH($$, $$, CreateOperation(CTNOT_ASSIGN, $3, func));
     }

+ 5 - 5
gmsrc/src/gm/gmStream.h

@@ -43,23 +43,23 @@ public:
 
   /// \brief Seek()
   /// \return the p_pos before the seek if seek is supported, else ILLEGAL_POS.
-  virtual unsigned int Seek(unsigned int p_pos) = 0;
+  virtual gmint Seek(gmint p_pos) = 0;
 
   /// \brief Tell()
   /// \return the p_pos if tell is supported, else ILLEGAL_POS
-  virtual unsigned int Tell() const { return (unsigned int) ILLEGAL_POS; }
+  virtual gmint Tell() const { return (gmint) ILLEGAL_POS; }
 
   /// \brief GetSize() will return the size of the stream if the stream supports this feature.
   /// \return ILLEGAL_POS if GetSize is not supported
-  virtual unsigned int GetSize() const { return (unsigned int) ILLEGAL_POS; }
+  virtual gmint GetSize() const { return (gmint) ILLEGAL_POS; }
 
   /// \brief Read() will read p_n bytes from the stream into p_buffer.
   /// \return the number of bytes successfully read.
-  virtual unsigned int Read(void * p_buffer, unsigned int p_n) = 0;
+  virtual gmint Read(void * p_buffer, gmint p_n) = 0;
 
   /// \brief Write() will write p_n bytes from p_buffer to the stream.
   /// \return the number of bytes successfully written
-  virtual unsigned int Write(const void * p_buffer, unsigned int p_n) = 0;
+  virtual gmint Write(const void * p_buffer, gmint p_n) = 0;
 
   /// \brief GetFlags() will return the current stream flags
   inline Flags GetFlags() const { return (Flags) m_flags; }

+ 24 - 24
gmsrc/src/gm/gmStreamBuffer.cpp

@@ -21,7 +21,7 @@ gmStreamBufferStatic::gmStreamBufferStatic()
 }
 
 
-gmStreamBufferStatic::gmStreamBufferStatic(const void * p_buffer, unsigned int a_size)
+gmStreamBufferStatic::gmStreamBufferStatic(const void * p_buffer, gmint a_size)
 {
   Open(p_buffer, a_size);
 }
@@ -32,32 +32,32 @@ gmStreamBufferStatic::~gmStreamBufferStatic()
 }
 
 
-unsigned int gmStreamBufferStatic::Seek(unsigned int p_pos)
+gmint gmStreamBufferStatic::Seek(gmint p_pos)
 {
-  int oldCursor = m_cursor;
-  int cursor = p_pos;
-  if(cursor < 0) return (unsigned int)ILLEGAL_POS;
-  if((unsigned int) cursor > m_size) return (unsigned int)ILLEGAL_POS;
+  gmint oldCursor = m_cursor;
+  gmint cursor = p_pos;
+  if(cursor < 0) return (gmint)ILLEGAL_POS;
+  if((gmint) cursor > m_size) return (gmint)ILLEGAL_POS;
   m_cursor = cursor;
   return oldCursor;  
 }
 
 
-unsigned int gmStreamBufferStatic::Tell() const
+gmint gmStreamBufferStatic::Tell() const
 {
   return m_cursor;
 }
 
 
-unsigned int gmStreamBufferStatic::GetSize() const
+gmint gmStreamBufferStatic::GetSize() const
 {
   return m_size;
 }
 
 
-unsigned int gmStreamBufferStatic::Read(void * p_buffer, unsigned int p_n)
+gmint gmStreamBufferStatic::Read(void * p_buffer, gmint p_n)
 {
-  unsigned int remain = m_size - m_cursor;
+  gmint remain = m_size - m_cursor;
   if(p_n > remain)
   {
     m_flags |= F_EOS;
@@ -69,14 +69,14 @@ unsigned int gmStreamBufferStatic::Read(void * p_buffer, unsigned int p_n)
 }
 
 
-unsigned int gmStreamBufferStatic::Write(const void * p_buffer, unsigned int p_n)
+gmint gmStreamBufferStatic::Write(const void * p_buffer, gmint p_n)
 {
   m_flags |= F_ERROR;
   return 0;
 }
 
 
-void gmStreamBufferStatic::Open(const void * p_buffer, unsigned int a_size)
+void gmStreamBufferStatic::Open(const void * p_buffer, gmint a_size)
 {
   m_cursor = 0;
   m_size = a_size;
@@ -102,34 +102,34 @@ gmStreamBufferDynamic::~gmStreamBufferDynamic()
 }
 
 
-unsigned int gmStreamBufferDynamic::Seek(unsigned int p_pos)
+gmint gmStreamBufferDynamic::Seek(gmint p_pos)
 {
-  int oldCursor = m_cursor;
-  int cursor = p_pos;
+  gmint oldCursor = m_cursor;
+  gmint cursor = p_pos;
   if(cursor < 0) 
-    return (unsigned int)ILLEGAL_POS;
-  if((unsigned int) cursor > m_stream.Count()) 
-    return (unsigned int)ILLEGAL_POS;
+    return (gmint)ILLEGAL_POS;
+  if(cursor > m_stream.Count()) 
+    return (gmint)ILLEGAL_POS;
   m_cursor = cursor;
   return oldCursor;
 }
 
 
-unsigned int gmStreamBufferDynamic::Tell() const
+gmint gmStreamBufferDynamic::Tell() const
 {
   return m_cursor;
 }
 
 
-unsigned int gmStreamBufferDynamic::GetSize() const
+gmint gmStreamBufferDynamic::GetSize() const
 {
   return m_stream.Count();
 }
 
 
-unsigned int gmStreamBufferDynamic::Read(void * p_buffer, unsigned int p_n)
+gmint gmStreamBufferDynamic::Read(void * p_buffer, gmint p_n)
 {
-  unsigned int remain = m_stream.Count() - m_cursor;
+  gmint remain = m_stream.Count() - m_cursor;
   if(p_n > remain)
   {
     // set eof
@@ -142,9 +142,9 @@ unsigned int gmStreamBufferDynamic::Read(void * p_buffer, unsigned int p_n)
 }
 
 
-unsigned int gmStreamBufferDynamic::Write(const void * p_buffer, unsigned int p_n)
+gmint gmStreamBufferDynamic::Write(const void * p_buffer, gmint p_n)
 {
-  unsigned int remain = m_stream.Count() - m_cursor;
+  gmint remain = m_stream.Count() - m_cursor;
   if(p_n > remain)
   {
     // grow the stream

+ 18 - 18
gmsrc/src/gm/gmStreamBuffer.h

@@ -23,22 +23,22 @@ class gmStreamBufferStatic : public gmStream
 public:
   
   gmStreamBufferStatic();
-  gmStreamBufferStatic(const void * a_buffer, unsigned int a_size);
+  gmStreamBufferStatic(const void * a_buffer, gmint a_size);
   virtual ~gmStreamBufferStatic();
 
-  virtual unsigned int Seek(unsigned int p_pos);
-  virtual unsigned int Tell() const;
-  virtual unsigned int GetSize() const;
-  virtual unsigned int Read(void * p_buffer, unsigned int p_n);
-  virtual unsigned int Write(const void * p_buffer, unsigned int p_n);
+  virtual gmint Seek(gmint p_pos);
+  virtual gmint Tell() const;
+  virtual gmint GetSize() const;
+  virtual gmint Read(void * p_buffer, gmint p_n);
+  virtual gmint Write(const void * p_buffer, gmint p_n);
 
-  void Open(const void * a_buffer, unsigned int a_size);
+  void Open(const void * a_buffer, gmint a_size);
   inline const char* GetData() const { return m_stream; }
 
 private:
 
-  unsigned int m_cursor;
-  unsigned int m_size;
+  gmint m_cursor;
+  gmint m_size;
   const char * m_stream;
 };
 
@@ -52,23 +52,23 @@ public:
   gmStreamBufferDynamic();
   virtual ~gmStreamBufferDynamic();
 
-  virtual unsigned int Seek(unsigned int p_pos);
-  virtual unsigned int Tell() const;
-  virtual unsigned int GetSize() const;
-  virtual unsigned int Read(void * p_buffer, unsigned int p_n);
-  virtual unsigned int Write(const void * p_buffer, unsigned int p_n);
+  virtual gmint Seek(gmint p_pos);
+  virtual gmint Tell() const;
+  virtual gmint GetSize() const;
+  virtual gmint Read(void * p_buffer, gmint p_n);
+  virtual gmint Write(const void * p_buffer, gmint p_n);
 
   void Reset() ;
   void ResetAndFreeMemory();
-  inline void SetBlockSize(unsigned int a_blockSize) { m_stream.SetBlockSize(a_blockSize); }
+  inline void SetBlockSize(gmint a_blockSize) { m_stream.SetBlockSize(a_blockSize); }
   inline const char* GetData() const { return m_stream.GetData(); }
   inline char* GetUnsafeData() { return m_stream.GetData(); }
-  void SetSize(unsigned int a_size) { m_stream.SetCount(a_size); }
-  void SetCursor(unsigned int a_cursor) { m_cursor = a_cursor; }
+  void SetSize(gmint a_size) { m_stream.SetCount(a_size); }
+  void SetCursor(gmint a_cursor) { m_cursor = a_cursor; }
 
 private:
 
-  unsigned int m_cursor;
+  gmint m_cursor;
   gmArraySimple<char> m_stream;
 };
 

+ 1 - 1
gmsrc/src/gm/gmTableObject.h

@@ -57,7 +57,7 @@ public:
   // Get by c string (uses table search)
   gmVariable Get(gmMachine * a_machine, const char * a_key) const;
   // Get by array index (uses table search)
-  gmVariable Get(int a_indexKey) const { return Get(gmVariable(a_indexKey)); }
+  gmVariable Get(gmint a_indexKey) const { return Get(gmVariable(a_indexKey)); }
   // Get by c string (uses linear search)
   gmVariable GetLinearSearch(const char * a_key) const;
 

+ 10 - 9
gmsrc/src/gm/gmThread.cpp

@@ -19,10 +19,11 @@
 
 // helper macros
 
-#define OPCODE_INT(I)  *((gmint *) (I)); (I) += sizeof(gmint);
-#define OPCODE_PTR(I)  *((gmptr *) (I)); (I) += sizeof(gmptr);
-#define OPCODE_PTR_NI(I)  *((gmptr *) I);
-#define OPCODE_FLOAT(I)  *((gmfloat *) I); I += sizeof(gmfloat);
+#define OPCODE_INT32(I)  *((gmint32 *) (I)); (I) += sizeof(gmint32); // Int32 size instruction related
+#define OPCODE_INT(I)  *((gmint *) (I)); (I) += sizeof(gmint); // Specifically used for gmint literals
+#define OPCODE_FLOAT(I)  *((gmfloat *) I); I += sizeof(gmfloat); // Specifically used for gmfloat literals
+#define OPCODE_PTR(I)  *((gmptr *) (I)); (I) += sizeof(gmptr); // Ptr size instruction related
+#define OPCODE_PTR_NI(I)  *((gmptr *) I); // Ptr size with no increment
 #define OPERATOR(TYPE, OPERATOR) (m_machine->GetTypeNativeOperator((TYPE), (OPERATOR)))
 #define CALLOPERATOR(TYPE, OPERATOR) (m_machine->GetTypeOperator((TYPE), (OPERATOR)))
 #define GMTHREAD_LOG m_machine->GetLog().LogEntry
@@ -647,7 +648,7 @@ gmThread::State gmThread::Sys_Execute(gmVariable * a_return)
       {
         SetTop(top);
         
-        int numParams = (int) OPCODE_INT(instruction);
+        int numParams = (int) OPCODE_INT32(instruction);
 
         State res = PushStackFrame(numParams, &instruction, &code);
         top = GetTop(); 
@@ -746,8 +747,8 @@ gmThread::State gmThread::Sys_Execute(gmVariable * a_return)
 #endif //GM_USE_FORK
       case BC_FOREACH :
       {
-        gmuint32 localvalue = OPCODE_INT(instruction);
-        gmuint32 localkey = localvalue >> 16;
+        gmuint localvalue = OPCODE_INT32(instruction);
+        gmuint localkey = localvalue >> 16;
         localvalue &= 0xffff;
 
         // iterator is at tos-1, table is at tos -2, push int 1 if continuing loop. write key and value into localkey and localvalue
@@ -898,13 +899,13 @@ gmThread::State gmThread::Sys_Execute(gmVariable * a_return)
       }
       case BC_GETLOCAL :
       {
-        gmuint32 offset = OPCODE_INT(instruction);
+        gmuint32 offset = OPCODE_INT32(instruction);
         *(top++) = base[offset];
         break;
       }
       case BC_SETLOCAL :
       {
-        gmuint32 offset = OPCODE_INT(instruction);
+        gmuint32 offset = OPCODE_INT32(instruction);
 
         // Write barrier old local objects
         {

+ 10 - 10
gmsrc/src/gm/gmThread.h

@@ -145,7 +145,7 @@ public:
   // Versions that return bool return false if type was invalid, otherwise true, even if param was out of range. NOTE: Could switch to more complex return code, but user could simply check num params for range check if needed.
   // 
 
-  inline int ParamInt(int a_param, gmint a_default = 0) const;
+  inline gmint ParamInt(int a_param, gmint a_default = 0) const;
   inline bool ParamInt(int a_param, gmint& a_value, gmint a_default = 0) const;
   inline gmfloat ParamFloat(int a_param, gmfloat a_default = 0.0f) const;
   inline bool ParamFloat(int a_param, gmfloat& a_value, gmfloat a_default = 0.0f) const;
@@ -342,7 +342,7 @@ gmUserObject * gmThread::PushNewUser(void * a_user, int a_userType)
 // Parameter methods. (do not cause an error if the desired parameter is incorrect type)
 //
 
-inline int gmThread::ParamInt(int a_param, gmint a_default) const
+inline gmint gmThread::ParamInt(int a_param, gmint a_default) const
 {
   if(a_param >= m_numParameters) return a_default;
   gmVariable * var = m_stack + m_base + a_param;
@@ -815,21 +815,21 @@ inline gmUserObject * gmThread::ThisUserObject()
 
 #define GM_NUM_PARAMS GM_THREAD_ARG->GetNumParams()
 #if 1 // These macros only exception if param is present but type does not match
-  #define GM_INT_PARAM(VAR, PARAM, DEFAULT) int VAR; if( !GM_THREAD_ARG->ParamInt((PARAM), (VAR), (DEFAULT)) ) { return GM_EXCEPTION; }
-  #define GM_FLOAT_PARAM(VAR, PARAM, DEFAULT) float VAR; if( !GM_THREAD_ARG->ParamFloat((PARAM), (VAR), (DEFAULT)) )  { return GM_EXCEPTION; }
+  #define GM_INT_PARAM(VAR, PARAM, DEFAULT) gmint VAR; if( !GM_THREAD_ARG->ParamInt((PARAM), (VAR), (DEFAULT)) ) { return GM_EXCEPTION; }
+  #define GM_FLOAT_PARAM(VAR, PARAM, DEFAULT) gmfloat VAR; if( !GM_THREAD_ARG->ParamFloat((PARAM), (VAR), (DEFAULT)) )  { return GM_EXCEPTION; }
   #define GM_STRING_PARAM(VAR, PARAM, DEFAULT) const char * VAR; if( !GM_THREAD_ARG->ParamString((PARAM), (VAR), (DEFAULT)) )  { return GM_EXCEPTION; }
   #define GM_FUNCTION_PARAM(VAR, PARAM) gmFunctionObject * VAR; if( !GM_THREAD_ARG->ParamFunction((PARAM), (VAR)) )  { return GM_EXCEPTION; }
   #define GM_TABLE_PARAM(VAR, PARAM) gmTableObject * VAR; if( !GM_THREAD_ARG->ParamTable((PARAM), (VAR))  )  { return GM_EXCEPTION; }
   #define GM_USER_PARAM(OBJECT, VAR, PARAM) OBJECT VAR; if( !GM_THREAD_ARG->ParamUser((PARAM), (void*&)(VAR)) )  { return GM_EXCEPTION; }
-  #define GM_FLOAT_OR_INT_PARAM(VAR, PARAM, DEFAULT) float VAR; if( !GM_THREAD_ARG->ParamFloatOrInt((PARAM), (VAR), (DEFAULT)) ) { return GM_EXCEPTION; }
+  #define GM_FLOAT_OR_INT_PARAM(VAR, PARAM, DEFAULT) gmfloat VAR; if( !GM_THREAD_ARG->ParamFloatOrInt((PARAM), (VAR), (DEFAULT)) ) { return GM_EXCEPTION; }
 #else // Old versions
-  #define GM_INT_PARAM(VAR, PARAM, DEFAULT) int VAR = GM_THREAD_ARG->ParamInt((PARAM), (DEFAULT))
-  #define GM_FLOAT_PARAM(VAR, PARAM, DEFAULT) float VAR = GM_THREAD_ARG->ParamFloat((PARAM), (DEFAULT))
+  #define GM_INT_PARAM(VAR, PARAM, DEFAULT) gmint VAR = GM_THREAD_ARG->ParamInt((PARAM), (DEFAULT))
+  #define GM_FLOAT_PARAM(VAR, PARAM, DEFAULT) gmfloat VAR = GM_THREAD_ARG->ParamFloat((PARAM), (DEFAULT))
   #define GM_STRING_PARAM(VAR, PARAM, DEFAULT) const char * VAR = GM_THREAD_ARG->ParamString((PARAM), (DEFAULT))
   #define GM_FUNCTION_PARAM(VAR, PARAM) gmFunctionObject * VAR = GM_THREAD_ARG->ParamFunction((PARAM))
   #define GM_TABLE_PARAM(VAR, PARAM) gmTableObject * VAR = GM_THREAD_ARG->ParamTable((PARAM))
   #define GM_USER_PARAM(OBJECT, VAR, PARAM) OBJECT VAR = (OBJECT) GM_THREAD_ARG->ParamUser((PARAM));
-  #define GM_FLOAT_OR_INT_PARAM(VAR, PARAM, DEFAULT) float VAR = GM_THREAD_ARG->ParamFloatOrInt((PARAM), (DEFAULT))
+  #define GM_FLOAT_OR_INT_PARAM(VAR, PARAM, DEFAULT) gmfloat VAR = GM_THREAD_ARG->ParamFloatOrInt((PARAM), (DEFAULT))
 #endif
 
 //
@@ -843,12 +843,12 @@ inline gmUserObject * gmThread::ThisUserObject()
 
 #define GM_CHECK_INT_PARAM(VAR, PARAM) \
   if(GM_THREAD_ARG->ParamType((PARAM)) != GM_INT) { GM_EXCEPTION_MSG("expecting param %d as int", (PARAM)); return GM_EXCEPTION; } \
-  int VAR = GM_THREAD_ARG->Param((PARAM)).m_value.m_int;
+  gmint VAR = GM_THREAD_ARG->Param((PARAM)).m_value.m_int;
 
 #define GM_CHECK_FLOAT_PARAM(VAR, PARAM) \
   if(GM_THREAD_ARG->ParamType((PARAM)) != GM_FLOAT) \
   { GM_EXCEPTION_MSG("expecting param %d as float", (PARAM)); return GM_EXCEPTION; } \
-  float VAR = GM_THREAD_ARG->Param((PARAM)).m_value.m_float;
+  gmfloat VAR = GM_THREAD_ARG->Param((PARAM)).m_value.m_float;
 
 #define GM_CHECK_STRING_PARAM(VAR, PARAM) \
   if(GM_THREAD_ARG->ParamType((PARAM)) != GM_STRING) { GM_EXCEPTION_MSG("expecting param %d as string", (PARAM)); return GM_EXCEPTION; } \

+ 15 - 0
gmsrc/src/gm/gmUtil.h

@@ -44,6 +44,21 @@ inline unsigned int gmLog2ge(unsigned int n)
   return n + 1;
 }
 
+/// \brief gmLog2ge() returns the next power of 2, greater than or equal to the given number.
+inline unsigned __int64 gmLog2ge(unsigned __int64 n)
+{
+  --n;
+
+  n |= n >> 32;
+  n |= n >> 16;
+  n |= n >> 8;
+  n |= n >> 4;
+  n |= n >> 2;
+  n |= n >> 1;
+
+  return n + 1;
+}
+
 /// \brief gmItoa()
 char * gmItoa(int a_val, char * a_dst, int a_radix);
 

+ 2 - 2
gmsrc/src/gm/gmVariable.cpp

@@ -27,7 +27,7 @@ const char * gmVariable::AsString(gmMachine * a_machine, char * a_buffer, int a_
       _gmsnprintf(a_buffer, a_len, "null");
       break;
     case GM_INT :
-      _gmsnprintf(a_buffer, a_len, "%d", m_value.m_int);
+      _gmsnprintf(a_buffer, a_len, "%lld", (gmint64)m_value.m_int);
       break;
     case GM_FLOAT :
       _gmsnprintf(a_buffer, a_len, "%g", m_value.m_float);
@@ -42,7 +42,7 @@ const char * gmVariable::AsString(gmMachine * a_machine, char * a_buffer, int a_
       }
       else
       {
-        _gmsnprintf(a_buffer, a_len, "%s:0x%x", a_machine->GetTypeName(m_type), m_value.m_ref);
+        _gmsnprintf(a_buffer, a_len, "%s:0x%zx", a_machine->GetTypeName(m_type), m_value.m_ref);
       }
       break;
   }

+ 11 - 12
gmsrc/src/gm/gmVariable.h

@@ -73,15 +73,15 @@ struct gmVariable
   }
   inline gmVariable(gmType a_type, gmptr a_ref) : m_type(a_type) { m_value.m_ref = a_ref; }
 
-  explicit inline gmVariable(int a_val) : m_type(GM_INT) { m_value.m_int = a_val; }
-  explicit inline gmVariable(float a_val) : m_type(GM_FLOAT) { m_value.m_float = a_val; }
+  explicit inline gmVariable(gmint a_val) : m_type(GM_INT) { m_value.m_int = a_val; }
+  explicit inline gmVariable(gmfloat a_val) : m_type(GM_FLOAT) { m_value.m_float = a_val; }
   explicit inline gmVariable(gmStringObject * a_string) { SetString(a_string); }
   explicit inline gmVariable(gmTableObject * a_table) { SetTable(a_table); }
   explicit inline gmVariable(gmFunctionObject * a_func) { SetFunction(a_func); }
   explicit inline gmVariable(gmUserObject * a_user) { SetUser(a_user); }
 
-  inline void SetInt(int a_value) { m_type = GM_INT; m_value.m_int = a_value; }
-  inline void SetFloat(float a_value) { m_type = GM_FLOAT; m_value.m_float = a_value; }
+  inline void SetInt(gmint a_value) { m_type = GM_INT; m_value.m_int = a_value; }
+  inline void SetFloat(gmfloat a_value) { m_type = GM_FLOAT; m_value.m_float = a_value; }
   inline void SetString(gmStringObject * a_string);
   void SetString(gmMachine * a_machine, const char * a_cString);
   inline void SetTable(gmTableObject * a_table);
@@ -98,8 +98,8 @@ struct gmVariable
   inline bool IsNumber() const { return IsInt() || IsFloat(); }
 
   // GetInt and GetFloat are not protected. User should verify the type before calling this.
-  inline int GetInt() const  { return m_value.m_int; }
-  inline float GetFloat() const { return m_value.m_float; }
+  inline gmint GetInt() const  { return m_value.m_int; }
+  inline gmfloat GetFloat() const { return m_value.m_float; }
 
 
   /// \brief AsString will get this gm variable as a string if possible.  AsString is used for the gm "print" and system.Exec function bindings.
@@ -116,9 +116,9 @@ struct gmVariable
   const char * AsStringWithType(gmMachine * a_machine, char * a_buffer, int a_len) const;
 
   /// Return int/float or zero
-  inline int GetIntSafe() const;
+  inline gmint GetIntSafe() const;
   /// Return float/int or zero
-  inline float GetFloatSafe() const;
+  inline gmfloat GetFloatSafe() const;
   /// Return string object or null
   inline gmStringObject* GetStringObjectSafe() const;
   /// Return table object or null
@@ -215,7 +215,7 @@ inline void gmVariable::SetFunction(gmFunctionObject * a_function)
   m_value.m_ref = ((gmObject *) a_function)->GetRef();
 }
 
-int gmVariable::GetIntSafe() const
+gmint gmVariable::GetIntSafe() const
 {
   if( GM_INT == m_type )
   {
@@ -228,7 +228,7 @@ int gmVariable::GetIntSafe() const
   return 0;
 }
 
-float gmVariable::GetFloatSafe() const
+gmfloat gmVariable::GetFloatSafe() const
 {
   if( GM_FLOAT == m_type )
   {
@@ -238,8 +238,7 @@ float gmVariable::GetFloatSafe() const
   {
     return (float)m_value.m_int;
   }
-  return 0.0f;
- 
+  return gmfloat(0);
 }
 
 gmStringObject * gmVariable::GetStringObjectSafe() const

+ 8 - 8
gmsrc/src/gme/gme.cpp

@@ -144,8 +144,8 @@ static int GM_CDECL gmfCURSOR(gmThread * a_thread)
   GM_CHECK_INT_PARAM(size, 1);
   CONSOLE_CURSOR_INFO info;
   if(size < 1) size = 1; if(size > 100) size = 100;
-  info.bVisible = state;
-  info.dwSize = size;
+  info.bVisible = (BOOL)state;
+  info.dwSize = (DWORD)size;
   SetConsoleCursorInfo(s_hConsole, &info);
   return GM_OK;
 }
@@ -168,7 +168,7 @@ int GM_CDECL gmfIsPressed(gmThread * a_thread)
 {
   GM_CHECK_NUM_PARAMS(1);
   GM_CHECK_INT_PARAM(key, 0);
-  a_thread->PushInt(GetAsyncKeyState(key));
+  a_thread->PushInt( (gmint)GetAsyncKeyState( (int)key ));
   return GM_OK;
 }
 
@@ -259,9 +259,9 @@ void main(int argc, char * argv[], char * envp[])
   if(argc <= 1)
   {
 #if GMDEBUG_SUPPORT
-    fprintf(stderr, "args: filename [-d<ip> for debug] [-e for env vars] [-ke for keypress on error] [-k for keypress on exit]"GM_NL);
+    fprintf(stderr, "args: filename [-d<ip> for debug] [-e for env vars] [-ke for keypress on error] [-k for keypress on exit]" GM_NL);
 #else //GMDEBUG_SUPPORT
-    fprintf(stderr, "args: filename [-e for env vars] [-ke for keypress on error] [-k for keypress on exit]"GM_NL);
+    fprintf(stderr, "args: filename [-e for env vars] [-ke for keypress on error] [-k for keypress on exit]" GM_NL);
 #endif //GMDEBUG_SUPPORT
 
     return;
@@ -317,7 +317,7 @@ void main(int argc, char * argv[], char * envp[])
   }
   if(script == NULL)
   {
-    fprintf(stderr, "could not open file %s"GM_NL, filename);
+    fprintf(stderr, "could not open file %s" GM_NL, filename);
     if(keypress || keypressOnError)
     {
       getchar();
@@ -392,7 +392,7 @@ void main(int argc, char * argv[], char * envp[])
     const char * message;
     while((message = g_machine->GetLog().GetEntry(first)))
     {
-      fprintf(stderr, "%s"GM_NL, message);
+      fprintf(stderr, "%s" GM_NL, message);
     }
     g_machine->GetLog().Reset();
 
@@ -416,7 +416,7 @@ void main(int argc, char * argv[], char * envp[])
     if(client.Connect(ip, ((short) port)))
     {
       session.Open(g_machine);
-      fprintf(stderr, "debug session opened"GM_NL);
+      fprintf(stderr, "debug session opened" GM_NL);
     }
 #endif
   }

+ 0 - 438
gmsrc/src/gme/gme.dsp

@@ -1,438 +0,0 @@
-# Microsoft Developer Studio Project File - Name="gme" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=gme - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE 
-!MESSAGE NMAKE /f "gme.mak".
-!MESSAGE 
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
-!MESSAGE NMAKE /f "gme.mak" CFG="gme - Win32 Debug"
-!MESSAGE 
-!MESSAGE Possible choices for configuration are:
-!MESSAGE 
-!MESSAGE "gme - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "gme - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE 
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName "Perforce Project"
-# PROP Scc_LocalPath ".."
-CPP=cl.exe
-RSC=rc.exe
-
-!IF  "$(CFG)" == "gme - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\gm" /I "..\binds" /I "..\platform\win32msvc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0xc09 /d "NDEBUG"
-# ADD RSC /l 0xc09 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\..\bin\gme.exe"
-
-!ELSEIF  "$(CFG)" == "gme - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\gm" /I "..\binds" /I "..\platform\win32msvc" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0xc09 /d "_DEBUG"
-# ADD RSC /l 0xc09 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"..\..\bin\gme.debug.exe" /pdbtype:sept
-
-!ENDIF 
-
-# Begin Target
-
-# Name "gme - Win32 Release"
-# Name "gme - Win32 Debug"
-# Begin Group "gm"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\gm\gmArraySimple.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmArraySimple.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmByteCode.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmByteCode.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmByteCodeGen.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmByteCodeGen.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmCodeGen.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmCodeGen.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmCodeGenHooks.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmCodeGenHooks.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmCodeTree.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmCodeTree.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmConfig.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmCrc.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmCrc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmDebug.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmDebug.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmFunctionObject.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmFunctionObject.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmHash.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmHash.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmIncGC.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmIncGC.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmIterator.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmLibHooks.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmLibHooks.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmListDouble.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmListDouble.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmLog.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmLog.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmMachine.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmMachine.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmMachineLib.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmMachineLib.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmMem.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmMem.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmMemChain.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmMemChain.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmMemFixed.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmMemFixed.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmMemFixedSet.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmMemFixedSet.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmOperators.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmOperators.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmParser.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmParser.cpp.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmScanner.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmScanner.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmStream.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmStream.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmStreamBuffer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmStreamBuffer.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmStringObject.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmStringObject.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmTableObject.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmTableObject.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmThread.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmThread.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmUserObject.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmUserObject.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmUtil.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmUtil.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmVariable.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\gm\gmVariable.h
-# End Source File
-# End Group
-# Begin Group "binds"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\binds\gmArrayLib.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\binds\gmArrayLib.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\binds\gmCall.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\binds\gmCall.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\binds\gmHelpers.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\binds\gmHelpers.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\binds\gmMathLib.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\binds\gmMathLib.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\binds\gmStringLib.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\binds\gmStringLib.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\binds\gmSystemLib.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\binds\gmSystemLib.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\binds\gmVector3Lib.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\binds\gmVector3Lib.h
-# End Source File
-# End Group
-# Begin Group "gme"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\gme.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\NetClient.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\NetClient.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\timer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\timer.h
-# End Source File
-# End Group
-# Begin Group "win32"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\platform\win32msvc\gmConfig_p.h
-# End Source File
-# End Group
-# End Target
-# End Project

+ 0 - 33
gmsrc/src/gme/gme.dsw

@@ -1,33 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "gme"=.\gme.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-    begin source code control
-    Perforce Project
-    ..
-    end source code control
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-

+ 0 - 1314
gmsrc/src/gme/gme.vcproj

@@ -1,1314 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
-	ProjectType="Visual C++"
-	Version="8.00"
-	Name="gme"
-	ProjectGUID="{491CFDF5-B202-4FAD-B47E-810376C9DF27}"
-	>
-	<Platforms>
-		<Platform
-			Name="Win32"
-		/>
-	</Platforms>
-	<ToolFiles>
-	</ToolFiles>
-	<Configurations>
-		<Configuration
-			Name="Release|Win32"
-			OutputDirectory=".\Release"
-			IntermediateDirectory=".\Release"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Release/gme.tlb"
-				HeaderFileName=""
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="2"
-				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\gm,..\binds,..\platform\win32msvc"
-				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
-				StringPooling="true"
-				RuntimeLibrary="0"
-				EnableFunctionLevelLinking="true"
-				PrecompiledHeaderFile=".\Release/gme.pch"
-				AssemblerListingLocation=".\Release/"
-				ObjectFile=".\Release/"
-				ProgramDataBaseFileName=".\Release/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="NDEBUG"
-				Culture="3081"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="odbc32.lib odbccp32.lib Ws2_32.lib"
-				OutputFile="..\..\bin\gme.exe"
-				LinkIncremental="1"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Release/gme.pdb"
-				SubSystem="1"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-				SuppressStartupBanner="true"
-				OutputFile=".\Release/gme.bsc"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug|Win32"
-			OutputDirectory=".\Debug"
-			IntermediateDirectory=".\Debug"
-			ConfigurationType="1"
-			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
-			UseOfMFC="0"
-			ATLMinimizesCRunTimeLibraryUsage="false"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-				TypeLibraryName=".\Debug/gme.tlb"
-				HeaderFileName=""
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				AdditionalIncludeDirectories="..\gm,..\binds,..\platform\win32msvc"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="1"
-				PrecompiledHeaderFile=".\Debug/gme.pch"
-				AssemblerListingLocation=".\Debug/"
-				ObjectFile=".\Debug/"
-				ProgramDataBaseFileName=".\Debug/"
-				WarningLevel="3"
-				SuppressStartupBanner="true"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-				PreprocessorDefinitions="_DEBUG"
-				Culture="3081"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				AdditionalDependencies="odbc32.lib odbccp32.lib Ws2_32.lib"
-				OutputFile="..\..\bin\gme.debug.exe"
-				LinkIncremental="2"
-				SuppressStartupBanner="true"
-				GenerateDebugInformation="true"
-				ProgramDatabaseFile=".\Debug/gme.debug.pdb"
-				SubSystem="1"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-				SuppressStartupBanner="true"
-				OutputFile=".\Debug/gme.bsc"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-	</Configurations>
-	<References>
-	</References>
-	<Files>
-		<Filter
-			Name="gm"
-			>
-			<File
-				RelativePath="..\gm\gmArraySimple.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmArraySimple.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmByteCode.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmByteCode.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmByteCodeGen.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmByteCodeGen.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmCodeGen.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmCodeGen.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmCodeGenHooks.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmCodeGenHooks.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmCodeTree.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmCodeTree.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmConfig.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmCrc.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmCrc.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmDebug.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmDebug.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmFunctionObject.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmFunctionObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmHash.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmHash.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmIncGC.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmIncGC.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmIterator.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmLibHooks.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmLibHooks.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmListDouble.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmListDouble.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmLog.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmLog.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmMachine.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmMachine.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmMachineLib.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmMachineLib.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmMem.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmMem.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmMemChain.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmMemChain.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmMemFixed.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmMemFixed.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmMemFixedSet.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmMemFixedSet.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmOperators.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmOperators.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmParser.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmParser.cpp.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmScanner.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmScanner.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmStream.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmStream.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmStreamBuffer.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmStreamBuffer.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmStringObject.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmStringObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmTableObject.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmTableObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmThread.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmThread.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmUserObject.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmUserObject.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmUtil.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmUtil.h"
-				>
-			</File>
-			<File
-				RelativePath="..\gm\gmVariable.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\gm\gmVariable.h"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="binds"
-			>
-			<File
-				RelativePath="..\binds\gmArrayLib.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\binds\gmArrayLib.h"
-				>
-			</File>
-			<File
-				RelativePath="..\binds\gmCall.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\binds\gmCall.h"
-				>
-			</File>
-			<File
-				RelativePath="..\binds\gmGCRoot.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\binds\gmGCRoot.h"
-				>
-			</File>
-			<File
-				RelativePath="..\binds\gmGCRootUtil.cpp"
-				>
-			</File>
-			<File
-				RelativePath="..\binds\gmGCRootUtil.h"
-				>
-			</File>
-			<File
-				RelativePath="..\binds\gmHelpers.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\binds\gmHelpers.h"
-				>
-			</File>
-			<File
-				RelativePath="..\binds\gmMathLib.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\binds\gmMathLib.h"
-				>
-			</File>
-			<File
-				RelativePath="..\binds\gmStringLib.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\binds\gmStringLib.h"
-				>
-			</File>
-			<File
-				RelativePath="..\binds\gmSystemLib.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\binds\gmSystemLib.h"
-				>
-			</File>
-			<File
-				RelativePath="..\binds\gmVector3Lib.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\binds\gmVector3Lib.h"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="gme"
-			>
-			<File
-				RelativePath="gme.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="NetClient.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="NetClient.h"
-				>
-			</File>
-			<File
-				RelativePath="timer.cpp"
-				>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						PreprocessorDefinitions=""
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="timer.h"
-				>
-			</File>
-		</Filter>
-		<Filter
-			Name="win32"
-			>
-			<File
-				RelativePath="..\platform\win32msvc\gmConfig_p.h"
-				>
-			</File>
-		</Filter>
-	</Files>
-	<Globals>
-	</Globals>
-</VisualStudioProject>

+ 6 - 1
gmsrc/src/gme/gme.vcxproj

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
       <Configuration>Debug</Configuration>
@@ -20,27 +20,32 @@
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{491CFDF5-B202-4FAD-B47E-810376C9DF27}</ProjectGuid>
+    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
     <UseOfMfc>false</UseOfMfc>
     <CharacterSet>MultiByte</CharacterSet>
+    <PlatformToolset>v141</PlatformToolset>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">

+ 0 - 20
gmsrc/src/gme/gme_VC8.sln

@@ -1,20 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gme", "gme.vcproj", "{491CFDF5-B202-4FAD-B47E-810376C9DF27}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Release|Win32 = Release|Win32
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{491CFDF5-B202-4FAD-B47E-810376C9DF27}.Debug|Win32.ActiveCfg = Debug|Win32
-		{491CFDF5-B202-4FAD-B47E-810376C9DF27}.Debug|Win32.Build.0 = Debug|Win32
-		{491CFDF5-B202-4FAD-B47E-810376C9DF27}.Release|Win32.ActiveCfg = Release|Win32
-		{491CFDF5-B202-4FAD-B47E-810376C9DF27}.Release|Win32.Build.0 = Release|Win32
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

+ 17 - 4
gmsrc/src/platform/win32msvc/gmConfig_p.h

@@ -31,6 +31,9 @@
 #include <new>
 #include <cassert>
 
+//MAYBE #include <cstdint> // c++11 std types
+
+
 // system defines
 #if defined(_XBOX)
   #define GM_LITTLE_ENDIAN      0
@@ -107,23 +110,33 @@
 #define GM_MAX_CHAR_STRING    256
 #define GM_MAX_PATH           256
 
-// basic types
+// basic types (compatibility and fixed size)
 typedef const char * LPCTSTR;
-typedef unsigned int gmuint;
 typedef char gmint8;
 typedef unsigned char gmuint8;
 typedef short gmint16;
 typedef unsigned short gmuint16;
 typedef int gmint32;
 typedef unsigned int gmuint32;
+typedef __int64 gmint64;
+typedef unsigned __int64 gmuint64;
+
+#if 1 // 32bit int
 typedef int gmint;
 typedef unsigned int gmuint;
+#else // 64bit int
+typedef __int64 gmint;
+typedef unsigned __int64 gmuint;
+#endif
+#if 1 // 32bit float
 typedef float gmfloat;
+#else // 64bit float
+typedef double gmfloat;
+#endif
+
 #ifdef GM_PTR_SIZE_64
   typedef __int64 gmptr; // machine pointer size as int
   typedef unsigned __int64 gmuptr; // machine pointer size as int
-  typedef __int64 gmint64;
-  typedef unsigned __int64 gmuint64;
 #else //!GM_PTR_SIZE_64
   typedef int gmptr; // machine pointer size as int
   typedef unsigned int gmuptr; // machine pointer size as int