Browse Source

Merge pull request #11 from jamesu/sixtyfour

Sixtyfour
Mike Lilligreen 11 years ago
parent
commit
092ed3c2a8
44 changed files with 92 additions and 92 deletions
  1. 1 1
      engine/source/2d/core/SpriteBatchItem.h
  2. 1 1
      engine/source/2d/core/Utility.cc
  3. 1 1
      engine/source/assets/assetManager.cc
  4. 1 1
      engine/source/collection/hashTable.h
  5. 1 1
      engine/source/console/compiledEval.cc
  6. 1 1
      engine/source/console/consoleBaseType.h
  7. 4 4
      engine/source/console/consoleDoc.cc
  8. 1 1
      engine/source/console/consoleObject.h
  9. 1 1
      engine/source/console/metaScripting_ScriptBinding.cc
  10. 1 1
      engine/source/console/taggedStrings_ScriptBinding.h
  11. 4 4
      engine/source/graphics/bitmapPng.cc
  12. 1 1
      engine/source/graphics/gFont.cc
  13. 4 4
      engine/source/gui/editor/guiDebugger.cc
  14. 1 1
      engine/source/gui/guiListBoxCtrl.cc
  15. 1 1
      engine/source/gui/guiMessageVectorCtrl.cc
  16. 3 3
      engine/source/gui/guiTextListCtrl.cc
  17. 1 1
      engine/source/gui/guiTreeViewCtrl.cc
  18. 1 1
      engine/source/input/actionMap.cc
  19. 1 1
      engine/source/io/fileSystem_ScriptBinding.cc
  20. 3 3
      engine/source/io/resource/resourceManager.cc
  21. 1 1
      engine/source/persistence/tinyXML/tinyxml.cpp
  22. 2 2
      engine/source/platform/platformFileIO.cc
  23. 3 3
      engine/source/platform/platformString.h
  24. 2 2
      engine/source/platform/platformString_ScriptBinding.h
  25. 3 3
      engine/source/platformAndroid/AndroidStrings.cpp
  26. 1 1
      engine/source/platformOSX/osxCocoaUtilities.mm
  27. 2 2
      engine/source/platformOSX/osxFileDialogs.mm
  28. 6 6
      engine/source/platformOSX/osxFileIO.mm
  29. 2 2
      engine/source/platformOSX/osxMutex.mm
  30. 4 4
      engine/source/platformOSX/osxNetwork.mm
  31. 3 3
      engine/source/platformOSX/osxOpenGLDevice.mm
  32. 1 1
      engine/source/platformOSX/osxPopupMenu.mm
  33. 6 6
      engine/source/platformOSX/osxString.mm
  34. 1 1
      engine/source/platformOSX/osxTorqueView.mm
  35. 1 1
      engine/source/platformOSX/osxVideo.mm
  36. 1 1
      engine/source/platformOSX/platformOSX.mm
  37. 8 8
      engine/source/platformWin32/winStrings.cc
  38. 1 1
      engine/source/platformiOS/iOSMutex.mm
  39. 3 3
      engine/source/platformiOS/iOSStrings.mm
  40. 3 3
      engine/source/spine/Atlas.c
  41. 1 1
      engine/source/spine/SkeletonJson.c
  42. 1 1
      engine/source/spine/extension.c
  43. 2 2
      engine/source/string/stringUnit.cpp
  44. 1 1
      engine/source/string/stringUnit_ScriptBinding.h

+ 1 - 1
engine/source/2d/core/SpriteBatchItem.h

@@ -139,7 +139,7 @@ public:
         operator const U32() const
         {
 #ifdef TORQUE_64
-            return (U64)(mArgString) * (U32)2654435761;
+            return (U32)((U64)(mArgString) * (U32)2654435761);
 #else
             return (U32)(mArgString) * (U32)2654435761;
 #endif

+ 1 - 1
engine/source/2d/core/Utility.cc

@@ -213,7 +213,7 @@ const char* mGetStringElement( const char* inString, const U32 index, const bool
                 static char buffer[4096];
 
                 // Calculate word length.
-                const U32 length = inString - pWordStart - ((*inString)?1:0);
+                const U32 length = (const U32)(inString - pWordStart - ((*inString)?1:0));
 
                 // Copy Word.
                 dStrncpy( buffer, pWordStart, length);

+ 1 - 1
engine/source/assets/assetManager.cc

@@ -520,7 +520,7 @@ StringTableEntry AssetManager::getAssetPath( const char* pAssetId )
     AssertFatal( pFinalSlash != NULL, "Should always be able to find final slash in the asset file-path." );
 
     // Fetch asset path.
-    return StringTable->insertn( assetFilePath, pFinalSlash - assetFilePath );
+    return StringTable->insertn( assetFilePath, (U32)(pFinalSlash - assetFilePath) );
 }
 
 //-----------------------------------------------------------------------------

+ 1 - 1
engine/source/collection/hashTable.h

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

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

@@ -283,7 +283,7 @@ static void setUnit(const char *string, U32 index, const char *replace, const ch
          string += (sz + 1);
    }
    // copy first chunk
-   sz = string-start;
+   sz = (U32)(string-start);
    dStrncpy(val, start, sz);
    for(U32 i = 0; i < padCount; i++)
       val[sz++] = set[0];

+ 1 - 1
engine/source/console/consoleBaseType.h

@@ -75,7 +75,7 @@ public:
    ConsoleBaseType(const S32 size, S32 *idPtr, const char *aTypeName);
 
    const S32 getTypeID() const { return mTypeID; }
-   const S32 getTypeSize() const { return mTypeSize; }
+   const dsize_t getTypeSize() const { return mTypeSize; }
    const char *getTypeName() const { return mTypeName; }
 
    void setInspectorFieldType(const char *type) { mInspectorFieldType = type; }

+ 4 - 4
engine/source/console/consoleDoc.cc

@@ -254,7 +254,7 @@ void Namespace::printNamespaceEntries(Namespace * g, bool dumpScript, bool dumpE
 
             use++;
             
-            U32 len = end - use;
+            U32 len = (U32)(end - use);
             dStrncpy(buffer, use, len);
             buffer[len] = 0;
 
@@ -268,7 +268,7 @@ void Namespace::printNamespaceEntries(Namespace * g, bool dumpScript, bool dumpE
          if(dot < bgn && bgn < end)  // And they're in the order dot, bgn, end...
          {
             use++;
-            U32 len = end - bgn - 1;
+            U32 len = (U32)(end - bgn - 1);
             dStrncpy(buffer, bgn+1, len);
             buffer[len] = 0;
 
@@ -281,7 +281,7 @@ void Namespace::printNamespaceEntries(Namespace * g, bool dumpScript, bool dumpE
          char* func_pos = dStrstr(use, funcName);
          if((func_pos) && (func_pos < bgn) && (end > bgn))
          {
-            U32 len = end - bgn - 1;
+            U32 len = (U32)(end - bgn - 1);
             dStrncpy(buffer, bgn+1, len);
             buffer[len] = 0;
 
@@ -536,7 +536,7 @@ void Namespace::dumpClasses( bool dumpScript, bool dumpEngine )
             // Grab the length of the doc string.
             S32 docLen = dStrlen( field );
             if( nextKeyword )
-               docLen = nextKeyword - field;
+               docLen = (U32)(nextKeyword - field);
 
             // Make sure it will fit in the buffer.
             if( docLen > 1023 )

+ 1 - 1
engine/source/console/consoleObject.h

@@ -228,7 +228,7 @@ public:
         const char*    pFieldDocs;    ///< Documentation about this field; see consoleDoc.cc.
         bool           groupExpand;   ///< Flag to track expanded/not state of this group in the editor.
         U32            type;          ///< A type ID. @see ACRFieldTypes
-        U32            offset;        ///< Memory offset from beginning of class for this field.
+        dsize_t        offset;        ///< Memory offset from beginning of class for this field.
         S32            elementCount;  ///< Number of elements, if this is an array.
         EnumTable *    table;         ///< If this is an enum, this points to the table defining it.
         BitSet32       flag;          ///< Stores various flags

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

@@ -61,7 +61,7 @@ ConsoleFunctionWithDocs(call, ConsoleString, 2, 0, ( funcName, [args ... ]?))
 static StringTableEntry getDSOPath(const char *scriptPath)
 {
    const char *slash = dStrrchr(scriptPath, '/');
-   return StringTable->insertn(scriptPath, slash - scriptPath, true);
+   return StringTable->insertn(scriptPath, (U32)(slash - scriptPath), true);
 }
 
 /*! Returns the DSO path of the given filename

+ 1 - 1
engine/source/console/taggedStrings_ScriptBinding.h

@@ -63,7 +63,7 @@ ConsoleFunctionWithDocs(getTag, ConsoleString, 2, 2, ( taggedString ))
 
       U32 len;
       if(space)
-         len = space - argv[1];
+         len = (U32)(space - argv[1]);
       else
          len = dStrlen(argv[1]) + 1;
 

+ 4 - 4
engine/source/graphics/bitmapPng.cc

@@ -66,7 +66,7 @@ static void pngReadDataFn(png_structp  /*png_ptr*/,
    AssertFatal(sg_pStream != NULL, "No stream?");
 
    bool success;
-   success = sg_pStream->read(length, data);
+   success = sg_pStream->read((U32)length, data);
     
    AssertFatal(success, "PNG read catastrophic error!");
 }
@@ -79,7 +79,7 @@ static void pngWriteDataFn(png_structp /*png_ptr*/,
 {
    AssertFatal(sg_pStream != NULL, "No stream?");
 
-   sg_pStream->write(length, data);
+   sg_pStream->write((U32)length, data);
 }
 
 
@@ -92,7 +92,7 @@ static void pngFlushDataFn(png_structp /*png_ptr*/)
 static png_voidp pngMallocFn(png_structp /*png_ptr*/, png_size_t size)
 {
 #ifndef _WIN64
-   return FrameAllocator::alloc(size);
+   return FrameAllocator::alloc((U32)size);
 #else
    return (png_voidp)dMalloc(size);
 #endif
@@ -253,7 +253,7 @@ bool GBitmap::readPNG(Stream& io_rStream)
    png_set_interlace_handling(png_ptr);
    png_read_update_info(png_ptr, info_ptr);
 
-   png_uint_32 rowBytes = png_get_rowbytes(png_ptr, info_ptr);
+   png_uint_32 rowBytes = (png_uint_32)png_get_rowbytes(png_ptr, info_ptr);
    if (format == RGB) {
       AssertFatal(rowBytes == width * 3,
                   "Error, our rowbytes are incorrect for this transform... (3)");

+ 1 - 1
engine/source/graphics/gFont.cc

@@ -779,7 +779,7 @@ bool GFont::write(Stream& stream)
 
          // Write out.
          stream.write((U32)destLen);
-         stream.write(destLen, outBuff);
+         stream.write((U32)destLen, outBuff);
       }
 
       // Put us back to normal.

+ 4 - 4
engine/source/gui/editor/guiDebugger.cc

@@ -345,7 +345,7 @@ bool DbgFileView::openFile(const char *fileName)
    for(;;) {
       char *tempPtr = dStrchr(parsePtr, '\n');
       if(tempPtr)
-         addLine(parsePtr, tempPtr - parsePtr);
+         addLine(parsePtr, (U32)(tempPtr - parsePtr));
       else if(parsePtr[0])
          addLine(parsePtr, dStrlen(parsePtr));
       if(!tempPtr)
@@ -431,7 +431,7 @@ S32 DbgFileView::findMouseOverChar(const char *text, S32 stringPosition)
    // Did we find a character under the mouse?
    if (found) {
       // If so, return its position.
-      return bufPtr - tempBuf;
+      return (S32)(bufPtr - tempBuf);
    }
    // If not, return -1.
    else return -1;
@@ -495,7 +495,7 @@ bool DbgFileView::findMouseOverVariable()
       }
 
       //set the var char start positions
-      mMouseVarStart = varNamePtr - tempBuf;
+      mMouseVarStart = (S32)(varNamePtr - tempBuf);
 
       //now copy the (possible) var name into the buf
       char *tempPtr = &mMouseOverVariable[0];
@@ -512,7 +512,7 @@ bool DbgFileView::findMouseOverVariable()
       *tempPtr = '\0';
 
       //set the var char end positions
-      mMouseVarEnd = varNamePtr - tempBuf;
+      mMouseVarEnd = (S32)(varNamePtr - tempBuf);
 
       return true;
    }

+ 1 - 1
engine/source/gui/guiListBoxCtrl.cc

@@ -1028,7 +1028,7 @@ const char* GuiListBoxCtrl::getStringElement( const char* inString, const U32 in
                 static char buffer[4096];
 
                 // Calculate word length.
-                const U32 length = inString - pWordStart - ((*inString)?1:0);
+                const U32 length = (const U32)(inString - pWordStart - ((*inString)?1:0));
 
                 // Copy Word.
                 dStrncpy( buffer, pWordStart, length);

+ 1 - 1
engine/source/gui/guiMessageVectorCtrl.cc

@@ -312,7 +312,7 @@ void GuiMessageVectorCtrl::createSpecialMarkers(SpecialMarkers& rSpecial, const
       if (pMinMatch[0] != '\0') {
          AssertFatal(minMatchType != 0xFFFFFFFF, "Hm, that's bad");
          // Found a match...
-         U32 start = pMinMatch - pLCCopy;
+         U32 start = (U32)(pMinMatch - pLCCopy);
          U32 j;
          for (j = 0; pLCCopy[start + j] != '\0'; j++) {
             if (pLCCopy[start + j] == '\n' ||

+ 3 - 3
engine/source/gui/guiTextListCtrl.cc

@@ -350,9 +350,9 @@ void GuiTextListCtrl::onRenderCell(Point2I offset, Point2I cell, bool selected,
       const char *nextCol = dStrchr(text, '\t');
       if(mColumnOffsets[index] >= 0)
       {
-         dsize_t slen;
+         U32 slen;
          if(nextCol)
-            slen = nextCol - text;
+            slen = (U32)(nextCol - text);
          else
             slen = dStrlen(text);
 
@@ -393,7 +393,7 @@ U32 GuiTextListCtrl::getRowWidth(Entry *row)
       const char *nextCol = dStrchr(text, '\t');
       U32 textWidth;
       if(nextCol)
-         textWidth = mFont->getStrNWidth((const UTF8*)text, nextCol - text);
+         textWidth = mFont->getStrNWidth((const UTF8*)text, (U32)(nextCol - text));
       else
          textWidth = mFont->getStrWidth((const UTF8*)text);
       if(mColumnOffsets[index] >= 0)

+ 1 - 1
engine/source/gui/guiTreeViewCtrl.cc

@@ -1142,7 +1142,7 @@ bool GuiTreeViewCtrl::buildIconTable(const char * icons)
 
    // Figure the size of the buffer we need...
    const char* temp = dStrchr( icons, '\t' );
-   U32 textLen = temp ? ( temp - icons ) : dStrlen( icons );
+   U32 textLen = temp ? (U32)( temp - icons ) : dStrlen( icons );
 
    // Allocate temporary space.
    FrameAllocatorMarker txtBuff;

+ 1 - 1
engine/source/input/actionMap.cc

@@ -1653,7 +1653,7 @@ bool ActionMap::processMove(const InputEvent* pEvent)
         argv[1] = Con::getFloatArg( value );
             
         if (pNode->object)
-            Con::executef(pNode->object, S64(argv[0]), argv[1]);
+            Con::executef(pNode->object, 2, argv[0], argv[1]);
         else
             Con::execute(2, argv);
 

+ 1 - 1
engine/source/io/fileSystem_ScriptBinding.cc

@@ -520,7 +520,7 @@ ConsoleFunctionWithDocs(filePath, ConsoleString, 2, 2, (fileName))
    const char *path = dStrrchr(szPathCopy, '/');
    if(!path)
       return "";
-   U32 len = path - (char*)szPathCopy;
+   U32 len = (U32)(path - (char*)szPathCopy);
    char *ret = Con::getReturnBuffer(len + 1);
    dStrncpy(ret, szPathCopy, len);
    ret[len] = 0;

+ 3 - 3
engine/source/io/resource/resourceManager.cc

@@ -314,7 +314,7 @@ static void getPaths (const char *fullPath, StringTableEntry & path,
    }
    else
    {
-      S32 len = ptr - fullPath;
+      S32 len = (S32)(ptr - fullPath);
       dStrncpy (buf, fullPath, len);
       buf[len] = 0;
       fileName = StringTable->insert (ptr + 1);
@@ -1097,9 +1097,9 @@ struct ResourceObjectIndex
       const ResourceObjectIndex *r2 = (ResourceObjectIndex *) s2;
 
       if (r1->ro->path != r2->ro->path)
-         return r1->ro->path - r2->ro->path;
+         return (S32)(r1->ro->path - r2->ro->path);
       if (r1->ro->name != r2->ro->name)
-         return r1->ro->name - r2->ro->name;
+         return (S32)(r1->ro->name - r2->ro->name);
       return r1->ro->fileOffset - r2->ro->fileOffset;
    }
 };

+ 1 - 1
engine/source/persistence/tinyXML/tinyxml.cpp

@@ -1005,7 +1005,7 @@ bool TiXmlDocument::LoadFile( FileStream &stream, TiXmlEncoding encoding )
     char* buf = new char[ length+1 ];
     buf[0] = 0;
 
-    if ( !stream.read( length, buf ) ) {
+    if ( !stream.read( (U32)length, buf ) ) {
         delete [] buf;
         SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
         return false;

+ 2 - 2
engine/source/platform/platformFileIO.cc

@@ -273,7 +273,7 @@ char * Platform::makeFullPathName(const char *path, char *buffer, U32 size, cons
          }
          else if(endptr)
          {
-            catPath(endptr, ptr, size - (endptr - buffer));
+            catPath(endptr, ptr, (U32)(size - (endptr - buffer)));
             endptr += dStrlen(endptr) - 1;
          }
          
@@ -283,7 +283,7 @@ char * Platform::makeFullPathName(const char *path, char *buffer, U32 size, cons
       {
          // File
 
-         catPath(endptr, ptr, size - (endptr - buffer));
+         catPath(endptr, ptr, (U32)(size - (endptr - buffer)));
          endptr += dStrlen(endptr) - 1;
       }
 

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

@@ -31,7 +31,7 @@
 
 //------------------------------------------------------------------------------
 
-extern dsize_t dStrlen(const char *str);
+extern U32 dStrlen(const char *str);
 
 extern char* dStrcat(char *dst, const char *src);
 extern UTF8* dStrcat(UTF8 *dst, const UTF8 *src);
@@ -61,8 +61,8 @@ extern char* dStrchr(char *str, int c);
 extern const char* dStrchr(const char *str, int c);
 extern char* dStrrchr(char *str, int c);
 extern const char* dStrrchr(const char *str, int c);
-extern dsize_t dStrspn(const char *str, const char *set);
-extern dsize_t dStrcspn(const char *str, const char *set);
+extern U32 dStrspn(const char *str, const char *set);
+extern U32 dStrcspn(const char *str, const char *set);
 extern char* dStrstr(char *str1, char *str2);
 extern char* dStrstr(const char *str1, const char *str2);
 

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

@@ -75,7 +75,7 @@ ConsoleFunctionWithDocs(strstr, ConsoleInt, 3, 3, ( sourceString , searchString
    const char *retpos = dStrstr(argv[1], argv[2]);
    if(!retpos)
       return -1;
-   return retpos - argv[1];
+   return (S32)(retpos - argv[1]);
 }
 
 /*! Use the strPos function to locate the first instance of searchString in sourceString, starting at character 0, or at an optional offset.
@@ -288,7 +288,7 @@ ConsoleFunctionWithDocs(strreplace, ConsoleString, 4, 4, ( sourceString , from ,
          dStrcpy(ret + dstp, argv[1] + scanp);
          return ret;
       }
-      U32 len = scan - (argv[1] + scanp);
+      U32 len = (U32)(scan - (argv[1] + scanp));
       dStrncpy(ret + dstp, argv[1] + scanp, len);
       dstp += len;
       dStrcpy(ret + dstp, argv[3]);

+ 3 - 3
engine/source/platformAndroid/AndroidStrings.cpp

@@ -195,7 +195,7 @@ char* dStrncpy(char *dst, const char *src, dsize_t len)
    return strncpy(dst,src,len);
 }   
 
-dsize_t dStrlen(const char *str)
+U32 dStrlen(const char *str)
 {
    return str ? strlen(str) : 0;
 }   
@@ -247,12 +247,12 @@ char* dStrrchr(char *str, int c)
    return strrchr(str,c);
 }   
 
-dsize_t dStrspn(const char *str, const char *set)
+U32 dStrspn(const char *str, const char *set)
 {
    return(strspn(str, set));
 }
 
-dsize_t dStrcspn(const char *str, const char *set)
+U32 dStrcspn(const char *str, const char *set)
 {
    return strcspn(str, set);
 }   

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

@@ -281,7 +281,7 @@
     // Get the index
     NSMenu* menu = [sender menu];
 
-    S32 index = [menu indexOfItemWithTitle:itemTitle];
+    S32 index = (S32)[menu indexOfItemWithTitle:itemTitle];
 
     _owner->handleSelect(index, [[_menu title] UTF8String]);
 }

+ 2 - 2
engine/source/platformOSX/osxFileDialogs.mm

@@ -59,7 +59,7 @@ bool FileDialog::Execute()
             setDataField(StringTable->insert("files"), Con::getIntArg(i), StringTable->insert(file));
         }
 
-        setDataField(StringTable->insert("fileCount"), NULL, Con::getIntArg([nsFileArray count]));
+        setDataField(StringTable->insert("fileCount"), NULL, Con::getIntArg((S32)[nsFileArray count]));
     }
     else
     {
@@ -209,7 +209,7 @@ S32 Platform::messageBox(const UTF8 *title, const UTF8 *message, MBButtons butto
     [alert setMessageText:nsTitle];
     [alert setInformativeText:nsMessage];
 
-    S32 result = [alert runModal];
+    S32 result = (S32)[alert runModal];
 
     return result;
 }

+ 6 - 6
engine/source/platformOSX/osxFileIO.mm

@@ -322,7 +322,7 @@ U32 File::getPosition() const
     AssertFatal(handle != NULL, "File::getPosition: invalid file handle");
         
     // Return the position (aka, offset)
-    return ftell((FILE*)handle);
+    return (U32)ftell((FILE*)handle);
 }
 
 //-----------------------------------------------------------------------------
@@ -348,7 +348,7 @@ File::Status File::setPosition( S32 position, bool absolutePos )
         
         // Position beyond EOS is OK
         fseek((FILE*)handle, position, SEEK_SET);
-        finalPos = ftell((FILE*)handle);
+        finalPos = (U32)ftell((FILE*)handle);
     }
     else
     {
@@ -357,7 +357,7 @@ File::Status File::setPosition( S32 position, bool absolutePos )
         
         // Position beyond EOS is OK
         fseek((FILE*)handle, position, SEEK_CUR);
-        finalPos = ftell((FILE*)handle);
+        finalPos = (U32)ftell((FILE*)handle);
     }
     
     // ftell returns -1 on error. set error status
@@ -487,7 +487,7 @@ File::Status File::read(U32 size, char *dst, U32 *bytesRead)
         return currentStatus;
     
     // read from stream
-    U32 nBytes = fread(dst, 1, size, (FILE*)handle);
+    U32 nBytes = (U32)fread(dst, 1, size, (FILE*)handle);
     
     // did we hit the end of the stream?
     if( nBytes != size)
@@ -518,7 +518,7 @@ File::Status File::write(U32 size, const char *src, U32 *bytesWritten)
         return currentStatus;
     
     // write bytes to the stream
-    U32 nBytes = fwrite(src, 1, size,(FILE*)handle);
+    U32 nBytes = (U32)fwrite(src, 1, size,(FILE*)handle);
     
     // if we couldn't write everything, we've got a problem. set error status.
     if(nBytes != size)
@@ -969,7 +969,7 @@ S32 Platform::getFileSize(const char* pFilePath)
     }
     
     // Get the file size
-    U32 fileLength = [[attributes objectForKey:NSFileSize] integerValue];
+    U32 fileLength = (U32)[[attributes objectForKey:NSFileSize] integerValue];
     
     // Clean up temp string
     [pool drain];

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

@@ -83,7 +83,7 @@ bool Mutex::lock( bool block )
     if( block )
     {
         // Yes, so block until mutex can be locked.
-        const bool ok = pthread_mutex_lock( &(mData->mMutex) );
+        const int ok = pthread_mutex_lock( &(mData->mMutex) );
         
         // Sanity!
         AssertFatal( ok != EINVAL, "Mutex::lockMutex() failed: invalid mutex.");
@@ -93,7 +93,7 @@ bool Mutex::lock( bool block )
     else
     {
         // No, so attempt to lock the thread without blocking.
-        const bool ok = pthread_mutex_trylock( &(mData->mMutex) );
+        const int ok = pthread_mutex_trylock( &(mData->mMutex) );
         // returns EBUSY if mutex was locked by another thread,
         // returns EINVAL if mutex was not a valid mutex pointer,
         // returns 0 if lock succeeded.

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

@@ -450,11 +450,11 @@ void Net::process()
         U32 addrLen = sizeof(sa);
         S32 bytesRead = -1;
         if(udpSocket != InvalidSocket)
-            bytesRead = recvfrom(udpSocket, (char *) receiveEvent.data,  MaxPacketDataSize, 0, &sa, &addrLen);
+            bytesRead = (S32)recvfrom(udpSocket, (char *) receiveEvent.data,  MaxPacketDataSize, 0, &sa, &addrLen);
         if(bytesRead == -1 && ipxSocket != InvalidSocket)
         {
             addrLen = sizeof(sa);
-            bytesRead = recvfrom(ipxSocket, (char *) receiveEvent.data,  MaxPacketDataSize, 0, &sa, &addrLen);
+            bytesRead = (S32)recvfrom(ipxSocket, (char *) receiveEvent.data,  MaxPacketDataSize, 0, &sa, &addrLen);
         }
         
         if(bytesRead == -1)
@@ -789,7 +789,7 @@ Net::Error Net::setBlocking(NetSocket socket, bool blockingIO)
 Net::Error Net::send(NetSocket socket, const U8 *buffer, S32 bufferSize)
 {
     errno = 0;
-    S32 bytesWritten = ::send(socket, (const char*)buffer, bufferSize, 0);
+    S32 bytesWritten = (S32)::send(socket, (const char*)buffer, bufferSize, 0);
     if(bytesWritten == -1)
         Con::errorf("Could not write to socket. Error: %s",strerror(errno));
     
@@ -798,7 +798,7 @@ Net::Error Net::send(NetSocket socket, const U8 *buffer, S32 bufferSize)
 
 Net::Error Net::recv(NetSocket socket, U8 *buffer, S32 bufferSize, S32  *bytesRead)
 {
-    *bytesRead = ::recv(socket, (char*)buffer, bufferSize, 0);
+    *bytesRead = (S32)::recv(socket, (char*)buffer, bufferSize, 0);
     if(*bytesRead == -1)
         return getLastError();
     return NoError;

+ 3 - 3
engine/source/platformOSX/osxOpenGLDevice.mm

@@ -56,7 +56,7 @@ bool osxOpenGLDevice::enumDisplayModes( CGDirectDisplayID display )
     CFArrayRef modeArray = CGDisplayCopyAllDisplayModes(display, NULL);
     
     // Fetch the mode count.
-    const S32 modeCount = CFArrayGetCount(modeArray);
+    const S32 modeCount = (const S32)CFArrayGetCount(modeArray);
     
     // Iterate the modes.
     for( S32 modeIndex = 0; modeIndex < modeCount; modeIndex++ )
@@ -65,10 +65,10 @@ bool osxOpenGLDevice::enumDisplayModes( CGDirectDisplayID display )
         CGDisplayModeRef mode = (CGDisplayModeRef)CFArrayGetValueAtIndex(modeArray, modeIndex);
         
         // Get the mode width.
-        const S32 width = CGDisplayModeGetWidth(mode);
+        const S32 width = (const S32)CGDisplayModeGetWidth(mode);
         
         // Get the mode height.
-        const S32 height = CGDisplayModeGetHeight(mode);
+        const S32 height = (const S32)CGDisplayModeGetHeight(mode);
         
         // Get the pixel encoding.
         CFStringRef pixelEncoding = CGDisplayModeCopyPixelEncoding(mode);

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

@@ -158,7 +158,7 @@ void PopupMenu::checkRadioItem(S32 firstPos, S32 lastPos, S32 checkPos)
 //-----------------------------------------------------------------------------
 bool PopupMenu::isItemChecked(S32 pos)
 {
-    S32 state = [[[mData->mController menu] itemAtIndex:pos] state];
+    S32 state = (S32)[[[mData->mController menu] itemAtIndex:pos] state];
 
     return (state == NSOnState);
 }

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

@@ -240,9 +240,9 @@ char* dStrncpy(char *dst, const char *src, dsize_t len)
 
 //-----------------------------------------------------------------------------
 
-dsize_t dStrlen(const char *str)
+U32 dStrlen(const char *str)
 {
-    return str ? strlen(str) : 0;
+    return str ? (U32)strlen(str) : 0;
 }
 
 //-----------------------------------------------------------------------------
@@ -305,16 +305,16 @@ char* dStrrchr(char *str, int c)
 
 //-----------------------------------------------------------------------------
 
-dsize_t dStrspn(const char *str, const char *set)
+U32 dStrspn(const char *str, const char *set)
 {
-    return(strspn(str, set));
+    return((U32)strspn(str, set));
 }
 
 //-----------------------------------------------------------------------------
 
-dsize_t dStrcspn(const char *str, const char *set)
+U32 dStrcspn(const char *str, const char *set)
 {
-    return strcspn(str, set);
+    return (U32)strcspn(str, set);
 }
 
 //-----------------------------------------------------------------------------

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

@@ -193,7 +193,7 @@
      NSDeviceIndependentModifierFlagsMask = 0xffff0000U
      */
     
-    U32 keyMods = [event modifierFlags];
+    U32 keyMods = (U32)[event modifierFlags];
     
     if (keyMods & NSShiftKeyMask)
         modifiers |= SI_SHIFT;

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

@@ -32,7 +32,7 @@ Resolution Video::getDesktopResolution()
 
     // Get the screen depth. You cannot access depth directly. It must be passed
     // into a function that will return the bpp
-    int bpp = NSBitsPerPixelFromDepth([mainScreen depth]);
+    int bpp = (int)NSBitsPerPixelFromDepth([mainScreen depth]);
     
     // Build the return resolution
     Resolution resolution;

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

@@ -247,7 +247,7 @@ static osxPlatState * tempSharedPlatState = nil;
 
 //-----------------------------------------------------------------------------
 
-- (unsigned)retainCount
+- (NSUInteger)retainCount
 {
     // Denotes an object that cannot be released
     return UINT_MAX;

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

@@ -176,9 +176,9 @@ char* dStrncpy(char *dst, const char *src, dsize_t len)
    return strncpy((char*)dst,(char*)src,len);
 } */  
 
-dsize_t dStrlen(const char *str)
+U32 dStrlen(const char *str)
 {
-   return (dsize_t)strlen(str);
+   return (U32)strlen(str);
 }   
 
 /*dsize_t dStrlen(const UTF8 *str)
@@ -191,9 +191,9 @@ dsize_t dStrlen(const char *str)
     return c;
 }*/
 
-dsize_t dStrlen(const UTF16 *str)
+U32 dStrlen(const UTF16 *str)
 {
-    return (dsize_t)wcslen(str);
+    return (U32)wcslen(str);
 }
 
 char* dStrupr(char *str)
@@ -236,14 +236,14 @@ char* dStrrchr(char *str, S32 c)
    return strrchr(str,c);
 }
 
-dsize_t dStrspn(const char *str, const char *set)
+U32 dStrspn(const char *str, const char *set)
 {
-   return (dsize_t)strspn(str, set);
+   return (U32)strspn(str, set);
 }
 
-dsize_t dStrcspn(const char *str, const char *set)
+U32 dStrcspn(const char *str, const char *set)
 {
-   return (dsize_t)strcspn(str, set);
+   return (U32)strcspn(str, set);
 }
 
 

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

@@ -62,7 +62,7 @@ Mutex::~Mutex()
  
 bool Mutex::lock( bool block)
 {
-   bool ok;
+   int ok;
 
    if(block)
    {

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

@@ -196,7 +196,7 @@ char* dStrncpy(char *dst, const char *src, dsize_t len)
    return strncpy(dst,src,len);
 }   
 
-dsize_t dStrlen(const char *str)
+U32 dStrlen(const char *str)
 {
    return str ? strlen(str) : 0;
 }   
@@ -248,12 +248,12 @@ char* dStrrchr(char *str, int c)
    return strrchr(str,c);
 }   
 
-dsize_t dStrspn(const char *str, const char *set)
+U32 dStrspn(const char *str, const char *set)
 {
    return(strspn(str, set));
 }
 
-dsize_t dStrcspn(const char *str, const char *set)
+U32 dStrcspn(const char *str, const char *set)
 {
    return strcspn(str, set);
 }   

+ 3 - 3
engine/source/spine/Atlas.c

@@ -137,7 +137,7 @@ static int readTuple (const char* end, Str tuple[]) {
 }
 
 static char* mallocString (Str* str) {
-	int length = str->end - str->begin;
+	int length = (int)(str->end - str->begin);
 	char* string = MALLOC(char, length + 1);
 	memcpy(string, str->begin, length);
 	string[length] = '\0';
@@ -145,7 +145,7 @@ static char* mallocString (Str* str) {
 }
 
 static int indexOf (const char** array, int count, Str* str) {
-	int length = str->end - str->begin;
+	int length = (int)(str->end - str->begin);
 	int i;
 	for (i = count - 1; i >= 0; i--)
 		if (strncmp(array[i], str->begin, length) == 0) return i;
@@ -172,7 +172,7 @@ static const char* textureFilterNames[] = {"Nearest", "Linear", "MipMap", "MipMa
 spAtlas* spAtlas_readAtlas (const char* begin, int length, const char* dir) {
 	int count;
 	const char* end = begin + length;
-	int dirLength = strlen(dir);
+	int dirLength = (int)strlen(dir);
 	int needsSlash = dirLength > 0 && dir[dirLength - 1] != '/' && dir[dirLength - 1] != '\\';
 
 	spAtlas* self = NEW(spAtlas);

+ 1 - 1
engine/source/spine/SkeletonJson.c

@@ -63,7 +63,7 @@ void _spSkeletonJson_setError (spSkeletonJson* self, Json* root, const char* val
 	int length;
 	FREE(self->error);
 	strcpy(message, value1);
-	length = strlen(value1);
+	length = (int)strlen(value1);
 	if (value2) strncat(message + length, value2, 256 - length);
 	MALLOC_STR(self->error, message);
 	if (root) Json_dispose(root);

+ 1 - 1
engine/source/spine/extension.c

@@ -57,7 +57,7 @@ char* _readFile (const char* path, int* length) {
 	if (!file) return 0;
 
 	fseek(file, 0, SEEK_END);
-	*length = ftell(file);
+	*length = (int)ftell(file);
 	fseek(file, 0, SEEK_SET);
 
 	data = MALLOC(char, *length);

+ 2 - 2
engine/source/string/stringUnit.cpp

@@ -157,7 +157,7 @@ namespace StringUnit
             string += (sz + 1);
       }
       // copy first chunk
-      sz = string-start;
+      sz = (U32)(string-start);
       dStrncpy(ret, start, sz);
       for(U32 i = 0; i < padCount; i++)
          ret[sz++] = set[0];
@@ -196,7 +196,7 @@ namespace StringUnit
             string += (sz + 1);
       }
       // copy first chunk
-      sz = string-start;
+      sz = (U32)(string-start);
       dStrncpy(ret, start, sz);
       ret[sz] = 0;
 

+ 1 - 1
engine/source/string/stringUnit_ScriptBinding.h

@@ -266,7 +266,7 @@ ConsoleFunctionWithDocs(firstWord, ConsoleString, 2, 2, ( sourceString ))
    if(word == NULL)
       len = dStrlen(argv[1]);
    else
-      len = word - argv[1];
+      len = (U32)(word - argv[1]);
    char *ret = Con::getReturnBuffer(len + 1);
    dStrncpy(ret, argv[1], len);
    ret[len - 1] = 0;