Ticket #1851: clean-up-fcollada-build-with-gcc-4.8.1.patch

File clean-up-fcollada-build-with-gcc-4.8.1.patch, 6.9 KB (added by Markus, 11 years ago)
  • trunk/libraries/source/fcollada/src/FCollada/FCDocument/FCDGeometryPolygonsTools.cpp

    diff -Nur a/trunk/libraries/source/fcollada/src/FCollada/FCDocument/FCDGeometryPolygonsTools.cpp b/trunk/libraries/source/fcollada/src/FCollada/FCDocument/FCDGeometryPolygonsTools.cpp
    a b  
    910910# pragma warning(disable : 4127) // conditional expression constant
    911911# pragma warning(disable : 4244) // conversion from 'const float' to 'uint8'
    912912#endif
    913    
     913
    914914#define INVALID_VTX_IDX     (uint16(~0)) // This value is the default (invalid) value in the vtx data map
    915915
    916916    template<class VAL, bool translateValue, bool isColor>
     
    10321032
    10331033    void RevertUniqueIndices(const FCDGeometryPolygonsInput& inPInput, FCDGeometryPolygonsInput& outPInput, const FCDGeometryIndexTranslationMap& translationMap)
    10341034    {
    1035         FUFail("NOT_TESTED");
     1035        FUFail() //NOT TESTED
    10361036        size_t tmSize = translationMap.size();
    10371037        uint32 largest = 0;
    10381038        for (FCDGeometryIndexTranslationMap::const_iterator it = translationMap.begin(), itEnd = translationMap.end(); it != itEnd; ++it)
  • trunk/libraries/source/fcollada/src/FCollada/FCDocument/FCDLibrary.cpp

    diff -Nur a/trunk/libraries/source/fcollada/src/FCollada/FCDocument/FCDLibrary.cpp b/trunk/libraries/source/fcollada/src/FCollada/FCDocument/FCDLibrary.cpp
    a b  
    138138    bool b = l1->IsEmpty();
    139139    if (b) { ptr = l1->FindDaeId(emptyCharString); }
    140140    ptr = l1->GetEntity(23);
    141     const T* cptr = ((const FCDLibrary<T>*)l1)->GetEntity(0);
    142     cptr = ptr;
     141    ((const FCDLibrary<T>*)l1)->GetEntity(0);
    143142    FCDAsset* asset = l1->GetAsset();
    144143    asset->SetFlag(11);
    145144}
  • trunk/libraries/source/fcollada/src/FCollada/FUtils/FUDebug.cpp

    diff -Nur a/trunk/libraries/source/fcollada/src/FCollada/FUtils/FUDebug.cpp b/trunk/libraries/source/fcollada/src/FCollada/FUtils/FUDebug.cpp
    a b  
    66    MIT License: http://www.opensource.org/licenses/mit-license.php
    77*/
    88
     9#define __STDC_FORMAT_MACROS
     10#include <inttypes.h>
     11
    912#include "StdAfx.h"
    1013#include "FUDebug.h"
    1114#include "FULogFile.h"
     
    7073void FUDebug::DebugOutV(uint8 verbosity, const char* filename, uint32 line, const char* message, va_list& vars)
    7174{
    7275    char buffer[256];
    73     snprintf(buffer, 256, "[%s@%lu] ", filename, line);
     76    snprintf(buffer, 256, "[%s@%" PRIu32 "] ", filename, line);
    7477    buffer[255] = 0;
    7578    DebugString(buffer);
    7679
  • trunk/libraries/source/fcollada/src/FCollada/FUtils/FUFileManager.cpp

    diff -Nur a/trunk/libraries/source/fcollada/src/FCollada/FUtils/FUFileManager.cpp b/trunk/libraries/source/fcollada/src/FCollada/FUtils/FUFileManager.cpp
    a b  
    9393#else
    9494    // Push on the stack the original root path
    9595    char fullPath[MAX_PATH];
    96     _getcwd(fullPath, MAX_PATH);
    97     size_t length = strlen(fullPath);
    98     if (length < MAX_PATH - 2 && fullPath[length-1] != '/' && fullPath[length-1] != '\\')
     96    if (_getcwd(fullPath, MAX_PATH))
    9997    {
    100         fullPath[length] = '/';
    101         fullPath[length + 1] = 0;
     98        size_t length = strlen(fullPath);
     99        if (length < MAX_PATH - 2 && fullPath[length-1] != '/' && fullPath[length-1] != '\\')
     100        {
     101            fullPath[length] = '/';
     102            fullPath[length + 1] = 0;
     103        }
     104        pathStack.push_back(TO_FSTRING((const char*) fullPath));
    102105    }
    103     pathStack.push_back(TO_FSTRING((const char*) fullPath));
    104106#endif // __PPU__
    105107
    106108    forceAbsolute = false;
  • trunk/libraries/source/fcollada/src/FCollada/FUtils/FUStringConversion.cpp

    diff -Nur a/trunk/libraries/source/fcollada/src/FCollada/FUtils/FUStringConversion.cpp b/trunk/libraries/source/fcollada/src/FCollada/FUtils/FUStringConversion.cpp
    a b  
    275275    FUStringBuilder fbuilder;
    276276    const char* c = emptyCharString;
    277277    const fchar* fc = emptyFCharString;
    278     float f = FUStringConversion::ToFloat(&c);
    279     f = FUStringConversion::ToFloat(&fc);
    280     bool b = FUStringConversion::ToBoolean(c);
    281     b = FUStringConversion::ToBoolean(fc);
    282     int32 i32 = FUStringConversion::ToInt32(&c);
    283     i32 = FUStringConversion::ToInt32(&fc);
    284     uint32 u32 = FUStringConversion::ToUInt32(&c);
    285     u32 = FUStringConversion::ToUInt32(&fc);
    286     u32 = FUStringConversion::HexToUInt32(&c);
    287     u32 = FUStringConversion::HexToUInt32(&fc);
     278    FUStringConversion::ToFloat(&c);
     279    FUStringConversion::ToFloat(&fc);
     280    FUStringConversion::ToBoolean(c);
     281    FUStringConversion::ToBoolean(fc);
     282    FUStringConversion::ToInt32(&c);
     283    FUStringConversion::ToInt32(&fc);
     284    FUStringConversion::ToUInt32(&c);
     285    FUStringConversion::ToUInt32(&fc);
     286    FUStringConversion::HexToUInt32(&c);
     287    FUStringConversion::HexToUInt32(&fc);
    288288    FMMatrix44 m44;
    289289    FUStringConversion::ToMatrix(&c, m44);
    290290    FUStringConversion::ToMatrix(&fc, m44);
  • trunk/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.cpp

    diff -Nur a/trunk/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.cpp b/trunk/libraries/source/fcollada/src/FColladaPlugins/FArchiveXML/FArchiveXML.cpp
    a b  
    418418    {
    419419        fcdocument->SetFileUrl(fstring(filePath));
    420420
    421         fm::string textBuffer;
    422         const xmlChar* text = (const xmlChar*) contents;
    423         if (length != 0)
    424         {
    425             textBuffer = fm::string((const char*)contents, length);
    426             text = (const xmlChar*) textBuffer.c_str();
    427         }
    428 
    429421        // Parse the document into a XML tree
    430422        FUXmlDocument daeDocument((const char*) contents, length);
    431423        xmlNode* rootNode = daeDocument.GetRootNode();
     
    523515    xmlOutputBufferPtr buf = xmlAllocOutputBuffer(NULL);
    524516    xmlNodeDumpOutput(buf, rootNode->doc, rootNode, 0, 0, NULL);
    525517
    526 #ifdef LIBXML2_NEW_BUFFER
    527     outData.resize(xmlOutputBufferGetSize(buf) * sizeof(xmlChar));
    528     memcpy(outData.begin(), xmlOutputBufferGetContent(buf), outData.size());
    529 #else
    530     outData.resize(buf->buffer->use * sizeof(xmlChar));
    531     memcpy(outData.begin(), buf->buffer->content, outData.size());
    532 #endif
     518#ifdef LIBXML2_NEW_BUFFER
     519    outData.resize(xmlOutputBufferGetSize(buf) * sizeof(xmlChar));
     520    memcpy(outData.begin(), xmlOutputBufferGetContent(buf), outData.size());
     521#else
     522    outData.resize(buf->buffer->use * sizeof(xmlChar));
     523    memcpy(outData.begin(), buf->buffer->content, outData.size());
     524#endif
    533525
    534526    xmlOutputBufferClose(buf);
    535527    daeDocument.ReleaseXmlData();