From 756cfd4f74b866e3183caede69daa8c105b73bab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 13 Nov 2015 22:33:20 +0100 Subject: [PATCH 1/3] fix compilation on BigEndian cannot pass a function by reference where an lvalue is expected (only applies to bigendian, where a macro expands to a byteswap function) Closes https://github.com/assimp/assimp/issues/613 --- code/Bitmap.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/Bitmap.cpp b/code/Bitmap.cpp index 13ec37204..829fd027b 100644 --- a/code/Bitmap.cpp +++ b/code/Bitmap.cpp @@ -84,7 +84,12 @@ namespace Assimp { template inline std::size_t Copy(uint8_t* data, T& field) { +#ifdef AI_BUILD_BIG_ENDIAN + T field_swapped=AI_BE(field); + std::memcpy(data, &field_swapped, sizeof(field)); return sizeof(field); +#else std::memcpy(data, &AI_BE(field), sizeof(field)); return sizeof(field); +#endif } void Bitmap::WriteHeader(Header& header, IOStream* file) { From 989e8af3fb573d4373baf6685543bef50ad6b20e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 13 Nov 2015 22:33:53 +0100 Subject: [PATCH 2/3] fix argument check for assimp cmdline tool `assimp cmpdump` expects two files as arguments. so we need to check for at least 2 extra arguments (rather than only check for !<1 and access both) --- tools/assimp_cmd/CompareDump.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/assimp_cmd/CompareDump.cpp b/tools/assimp_cmd/CompareDump.cpp index 8739c9364..f33d8f91c 100644 --- a/tools/assimp_cmd/CompareDump.cpp +++ b/tools/assimp_cmd/CompareDump.cpp @@ -881,7 +881,7 @@ int Assimp_CompareDump (const char* const* params, unsigned int num) } // assimp cmpdump actual expected - if (num < 1) { + if (num < 2) { std::cout << "assimp cmpdump: Invalid number of arguments. " "See \'assimp cmpdump --help\'\r\n" << std::endl; return 1; From 7806e991d98a657cca980a5dba5baf38fea7138d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Fri, 13 Nov 2015 23:01:49 +0100 Subject: [PATCH 3/3] Convert Windows-1252 charset to UTF-8 Windows-1252, seriously? (this hard-to-detect weirdo charset really makes some problems with some cmdline text-tool) --- contrib/clipper/clipper.cpp | 2 +- contrib/clipper/clipper.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/clipper/clipper.cpp b/contrib/clipper/clipper.cpp index b2316ccd5..c8c62bc2a 100644 --- a/contrib/clipper/clipper.cpp +++ b/contrib/clipper/clipper.cpp @@ -26,7 +26,7 @@ * Paper no. DETC2005-85513 pp. 565-575 * * ASME 2005 International Design Engineering Technical Conferences * * and Computers and Information in Engineering Conference (IDETC/CIE2005) * -* September 24–28, 2005 , Long Beach, California, USA * +* September 24–28, 2005 , Long Beach, California, USA * * http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf * * * *******************************************************************************/ diff --git a/contrib/clipper/clipper.hpp b/contrib/clipper/clipper.hpp index f6f196d0d..3d6510dff 100644 --- a/contrib/clipper/clipper.hpp +++ b/contrib/clipper/clipper.hpp @@ -26,7 +26,7 @@ * Paper no. DETC2005-85513 pp. 565-575 * * ASME 2005 International Design Engineering Technical Conferences * * and Computers and Information in Engineering Conference (IDETC/CIE2005) * -* September 24–28, 2005 , Long Beach, California, USA * +* September 24–28, 2005 , Long Beach, California, USA * * http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf * * * *******************************************************************************/