diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2014-06-01 14:59:30 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-06-02 11:10:12 +0200 |
commit | 8c6e063a19d656d4ca78239815776650fefe5e00 (patch) | |
tree | 164f4f8825a5b3b846ab327c0b471472605c4f8c /src/3rdparty/assimp | |
parent | 5b0e4531327d7b50c0b5b700d1707c5361d06f5a (diff) | |
download | qt3d-8c6e063a19d656d4ca78239815776650fefe5e00.tar.gz |
Let assimp compile on windows since MSVC only supports C90 spec
All variables must be declared at start of function before any
statements. What year is this?
Change-Id: I48a17b29c54843d99abb1dd8600ddf5a4ed41bc1
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/3rdparty/assimp')
-rw-r--r-- | src/3rdparty/assimp/code/LWOAnimation.cpp | 2 | ||||
-rw-r--r-- | src/3rdparty/assimp/code/Vertex.h | 1 | ||||
-rw-r--r-- | src/3rdparty/assimp/contrib/unzip/crypt.h | 3 | ||||
-rw-r--r-- | src/3rdparty/assimp/contrib/unzip/ioapi.c | 52 |
4 files changed, 19 insertions, 39 deletions
diff --git a/src/3rdparty/assimp/code/LWOAnimation.cpp b/src/3rdparty/assimp/code/LWOAnimation.cpp index a084b0e86..4520a87e0 100644 --- a/src/3rdparty/assimp/code/LWOAnimation.cpp +++ b/src/3rdparty/assimp/code/LWOAnimation.cpp @@ -52,6 +52,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // internal headers #include "LWOFileData.h" +#include <functional> + using namespace Assimp; using namespace Assimp::LWO; diff --git a/src/3rdparty/assimp/code/Vertex.h b/src/3rdparty/assimp/code/Vertex.h index 02c70ec0b..cc92a571b 100644 --- a/src/3rdparty/assimp/code/Vertex.h +++ b/src/3rdparty/assimp/code/Vertex.h @@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef AI_VERTEX_H_INC #define AI_VERTEX_H_INC +#include <functional> namespace Assimp { diff --git a/src/3rdparty/assimp/contrib/unzip/crypt.h b/src/3rdparty/assimp/contrib/unzip/crypt.h index b885c5a7f..210b8f8e5 100644 --- a/src/3rdparty/assimp/contrib/unzip/crypt.h +++ b/src/3rdparty/assimp/contrib/unzip/crypt.h @@ -34,11 +34,10 @@ */ static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) { - (void)pcrc_32_tab; // Unused unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an * unpredictable manner on 16-bit systems; not a problem * with any known compiler so far, though */ - + (void)pcrc_32_tab; // Unused temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); } diff --git a/src/3rdparty/assimp/contrib/unzip/ioapi.c b/src/3rdparty/assimp/contrib/unzip/ioapi.c index f775107af..907a5657c 100644 --- a/src/3rdparty/assimp/contrib/unzip/ioapi.c +++ b/src/3rdparty/assimp/contrib/unzip/ioapi.c @@ -69,14 +69,11 @@ int ZCALLBACK ferror_file_func ( voidpf stream); -voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) - voidpf opaque; - const char* filename; - int mode; +voidpf ZCALLBACK fopen_file_func(voidpf opaque, const char* filename, int mode) { - (void)opaque; // Unused FILE* file = NULL; const char* mode_fopen = NULL; + (void)opaque; // Unused if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) mode_fopen = "rb"; else @@ -92,50 +89,36 @@ voidpf ZCALLBACK fopen_file_func (opaque, filename, mode) } -uLong ZCALLBACK fread_file_func (opaque, stream, buf, size) - voidpf opaque; - voidpf stream; - void* buf; - uLong size; +uLong ZCALLBACK fread_file_func(voidpf opaque, voidpf stream, void* buf, uLong size) { - (void)opaque; // Unused uLong ret; + (void)opaque; // Unused ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); return ret; } -uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size) - voidpf opaque; - voidpf stream; - const void* buf; - uLong size; +uLong ZCALLBACK fwrite_file_func(voidpf opaque, voidpf stream, const void* buf, uLong size) { - (void)opaque; // Unused uLong ret; + (void)opaque; // Unused ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); return ret; } -long ZCALLBACK ftell_file_func (opaque, stream) - voidpf opaque; - voidpf stream; +long ZCALLBACK ftell_file_func(voidpf opaque, voidpf stream) { - (void)opaque; // Unused long ret; + (void)opaque; // Unused ret = ftell((FILE *)stream); return ret; } -long ZCALLBACK fseek_file_func (opaque, stream, offset, origin) - voidpf opaque; - voidpf stream; - uLong offset; - int origin; +long ZCALLBACK fseek_file_func(voidpf opaque, voidpf stream, uLong offset, int origin) { - (void)opaque; // Unused int fseek_origin=0; long ret; + (void)opaque; // Unused switch (origin) { case ZLIB_FILEFUNC_SEEK_CUR : @@ -154,28 +137,23 @@ long ZCALLBACK fseek_file_func (opaque, stream, offset, origin) return ret; } -int ZCALLBACK fclose_file_func (opaque, stream) - voidpf opaque; - voidpf stream; +int ZCALLBACK fclose_file_func(voidpf opaque, voidpf stream) { - (void)opaque; // Unused int ret; + (void)opaque; // Unused ret = fclose((FILE *)stream); return ret; } -int ZCALLBACK ferror_file_func (opaque, stream) - voidpf opaque; - voidpf stream; +int ZCALLBACK ferror_file_func(voidpf opaque, voidpf stream) { - (void)opaque; // Unused int ret; + (void)opaque; // Unused ret = ferror((FILE *)stream); return ret; } -void fill_fopen_filefunc (pzlib_filefunc_def) - zlib_filefunc_def* pzlib_filefunc_def; +void fill_fopen_filefunc(zlib_filefunc_def* pzlib_filefunc_def) { pzlib_filefunc_def->zopen_file = fopen_file_func; pzlib_filefunc_def->zread_file = fread_file_func; |