ix compiler warning for pragma statements.

pull/3012/head
Kim Kulling 2020-03-15 11:47:05 +01:00
parent 9e91a33d76
commit 976091a6f6
14 changed files with 91 additions and 42 deletions

View File

@ -321,7 +321,9 @@ public:
struct Face : public FaceWithSmoothingGroup { struct Face : public FaceWithSmoothingGroup {
}; };
#pragma warning(disable : 4315) #ifdef _WIN32
# pragma warning(disable : 4315)
#endif
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
/** Helper structure representing a texture */ /** Helper structure representing a texture */

View File

@ -54,15 +54,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <assimp/IOStream.hpp> #include <assimp/IOStream.hpp>
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB #ifdef ASSIMP_BUILD_NO_OWN_ZLIB
#include <zlib.h> # include <zlib.h>
#else #else
#include "../contrib/zlib/zlib.h" # include "../contrib/zlib/zlib.h"
#endif #endif
#include <time.h> #include <time.h>
#pragma warning(push) #ifdef _WIN32
#pragma warning(disable : 4706) # pragma warning(push)
# pragma warning(disable : 4706)
#endif // _WIN32
namespace Assimp { namespace Assimp {
@ -824,6 +826,8 @@ void DumpSceneToAssbin(
AssbinFileWriter fileWriter(shortened, compressed); AssbinFileWriter fileWriter(shortened, compressed);
fileWriter.WriteBinaryDump(pFile, cmd, pIOSystem, pScene); fileWriter.WriteBinaryDump(pFile, cmd, pIOSystem, pScene);
} }
#pragma warning(pop) #ifdef _WIN32
# pragma warning(pop)
#endif // _WIN32
} // end of namespace Assimp } // end of namespace Assimp

View File

@ -53,7 +53,9 @@ using namespace Assimp;
# define CHAR_BIT 8 # define CHAR_BIT 8
#endif #endif
#pragma warning(disable : 4127) #ifdef _WIN32
# pragma warning(disable : 4127)
#endif // _WIN32
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
// Constructs a spatially sorted representation from the given position array. // Constructs a spatially sorted representation from the given position array.

View File

@ -99,8 +99,10 @@ typedef uint16_t M3D_INDEX;
#define _register #define _register
#endif #endif
#pragma warning(push) #ifdef _WIN32
#pragma warning(disable : 4127 5573 4505 4244 4403 5744 4701 4703) # pragma warning(push)
# pragma warning(disable : 4127 5573 4505 4244 4403 5744 4701 4703)
#endif // _WIN32
/*** File format structures ***/ /*** File format structures ***/
@ -6134,7 +6136,9 @@ public:
#endif /* impl */ #endif /* impl */
} // namespace M3D } // namespace M3D
#pragma warning(pop <) #ifdef _WIN32
# pragma warning(pop)
#endif // _WIN32
#endif #endif

View File

@ -164,7 +164,7 @@ void ArmaturePopulate::BuildNodeList(const aiNode *current_node,
// duplicate names :) // duplicate names :)
void ArmaturePopulate::BuildBoneStack(aiNode *, void ArmaturePopulate::BuildBoneStack(aiNode *,
const aiNode *root_node, const aiNode *root_node,
const aiScene *scene, const aiScene*,
const std::vector<aiBone *> &bones, const std::vector<aiBone *> &bones,
std::map<aiBone *, aiNode *> &bone_stack, std::map<aiBone *, aiNode *> &bone_stack,
std::vector<aiNode *> &node_stack) { std::vector<aiNode *> &node_stack) {

View File

@ -57,8 +57,10 @@ namespace glTF {
namespace { namespace {
#pragma warning(push) #ifdef _WIN32
#pragma warning(disable : 4706) # pragma warning(push)
# pragma warning(disable : 4706)
#endif // _WIN32
// //
// JSON Value reading helpers // JSON Value reading helpers
@ -1410,6 +1412,8 @@ inline std::string Asset::FindUniqueID(const std::string &str, const char *suffi
return id; return id;
} }
#pragma warning(pop) #ifdef _WIN32
# pragma warning(pop)
#endif // WIN32
} // namespace glTF } // namespace glTF

View File

@ -43,8 +43,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <rapidjson/writer.h> #include <rapidjson/writer.h>
#include <rapidjson/prettywriter.h> #include <rapidjson/prettywriter.h>
#pragma warning(push) #ifdef _WIN32
#pragma warning( disable : 4706) # pragma warning(push)
# pragma warning( disable : 4706)
#endif // _WIN32
namespace glTF { namespace glTF {
@ -701,6 +703,8 @@ namespace glTF {
w.WriteObjects(d); w.WriteObjects(d);
} }
#pragma warning(pop) #ifdef _WIN32
# pragma warning(pop)
#endif // _WIN32
} }

View File

@ -189,8 +189,11 @@ inline void CopyValue(const glTFCommon::mat4 &v, aiMatrix4x4 &o) {
o.d4 = v[15]; o.d4 = v[15];
} }
#pragma warning(push) #ifdef _WIN32
#pragma warning(disable : 4310) # pragma warning(push)
# pragma warning(disable : 4310)
#endif // _WIN32
inline std::string getCurrentAssetDir(const std::string &pFile) { inline std::string getCurrentAssetDir(const std::string &pFile) {
std::string path = pFile; std::string path = pFile;
int pos = std::max(int(pFile.rfind('/')), int(pFile.rfind('\\'))); int pos = std::max(int(pFile.rfind('/')), int(pFile.rfind('\\')));
@ -200,7 +203,9 @@ inline std::string getCurrentAssetDir(const std::string &pFile) {
return path; return path;
} }
#pragma warning(pop) #ifdef _WIN32
# pragma warning(pop)
#endif // _WIN32
namespace Util { namespace Util {

View File

@ -901,8 +901,11 @@ inline int Compare(const char *attr, const char (&str)[N]) {
return (strncmp(attr, str, N - 1) == 0) ? N - 1 : 0; return (strncmp(attr, str, N - 1) == 0) ? N - 1 : 0;
} }
#pragma warning(push) #ifdef _WIN32
#pragma warning(disable : 4706) # pragma warning(push)
# pragma warning(disable : 4706)
#endif // _WIN32
inline bool GetAttribVector(Mesh::Primitive &p, const char *attr, Mesh::AccessorList *&v, int &pos) { inline bool GetAttribVector(Mesh::Primitive &p, const char *attr, Mesh::AccessorList *&v, int &pos) {
if ((pos = Compare(attr, "POSITION"))) { if ((pos = Compare(attr, "POSITION"))) {
v = &(p.attributes.position); v = &(p.attributes.position);
@ -1504,8 +1507,9 @@ inline std::string Asset::FindUniqueID(const std::string &str, const char *suffi
id += suffix; id += suffix;
Asset::IdMap::iterator it = mUsedIds.find(id); Asset::IdMap::iterator it = mUsedIds.find(id);
if (it == mUsedIds.end()) if (it == mUsedIds.end()) {
return id; return id;
}
std::vector<char> buffer; std::vector<char> buffer;
buffer.resize(id.size() + 16); buffer.resize(id.size() + 16);
@ -1519,6 +1523,8 @@ inline std::string Asset::FindUniqueID(const std::string &str, const char *suffi
return id; return id;
} }
#pragma warning(pop) #ifdef _WIN32
# pragma warning(pop)
#endif // _WIN32
} // namespace glTF2 } // namespace glTF2

View File

@ -27,8 +27,10 @@ THE SOFTWARE.
#include "o3dgcArithmeticCodec.h" #include "o3dgcArithmeticCodec.h"
#include "o3dgcTimer.h" #include "o3dgcTimer.h"
#pragma warning(push) #ifdef _WIN32
#pragma warning( disable : 4456) # pragma warning(push)
# pragma warning( disable : 4456)
#endif // _WIN32
//#define DEBUG_VERBOSE //#define DEBUG_VERBOSE
@ -847,7 +849,9 @@ namespace o3dgc
} }
} // namespace o3dgc } // namespace o3dgc
#pragma warning( pop ) #ifdef _WIN32
# pragma warning( pop )
#endif // _WIN32
#endif // O3DGC_SC3DMC_DECODER_INL #endif // O3DGC_SC3DMC_DECODER_INL

View File

@ -32,8 +32,10 @@ THE SOFTWARE.
//#define DEBUG_VERBOSE //#define DEBUG_VERBOSE
#pragma warning(push) #ifdef _WIN32
#pragma warning(disable : 4456) # pragma warning(push)
# pragma warning(disable : 4456)
#endif // _WIN32
namespace o3dgc namespace o3dgc
{ {
@ -925,7 +927,9 @@ namespace o3dgc
} }
} // namespace o3dgc } // namespace o3dgc
#pragma warning(pop) #ifdef _WIN32
# pragma warning(pop)
#endif // _WIN32
#endif // O3DGC_SC3DMC_ENCODER_INL #endif // O3DGC_SC3DMC_ENCODER_INL

View File

@ -36,8 +36,11 @@
namespace p2t { namespace p2t {
#pragma warning(push) #ifdef _WIN32
#pragma warning( disable : 4702 ) # pragma warning(push)
# pragma warning( disable : 4702 )
#endif // _WIN32
// Triangulate simple polygon with holes // Triangulate simple polygon with holes
void Sweep::Triangulate(SweepContext& tcx) void Sweep::Triangulate(SweepContext& tcx)
{ {
@ -797,6 +800,8 @@ Sweep::~Sweep() {
} }
#pragma warning( pop ) #ifdef _WIN32
# pragma warning( pop )
#endif // _WIN32
} }

View File

@ -13,10 +13,10 @@
#include "zlib.h" #include "zlib.h"
#include "ioapi.h" #include "ioapi.h"
#pragma warning(push) #ifdef _WIN32
#pragma warning(disable : 4131 4100) # pragma warning(push)
# pragma warning(disable : 4131 4100)
#endif // _WIN32
/* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */ /* I've found an old Unix (a SunOS 4.1.3_U1) without all SEEK_* defined.... */
@ -179,4 +179,6 @@ void fill_fopen_filefunc (pzlib_filefunc_def)
pzlib_filefunc_def->opaque = NULL; pzlib_filefunc_def->opaque = NULL;
} }
#pragma warning(pop) #ifdef _WIN32
# pragma warning(pop)
#endif // _WIN32

View File

@ -89,9 +89,10 @@ typedef unsigned long z_crc_t;
#define SIZEZIPLOCALHEADER (0x1e) #define SIZEZIPLOCALHEADER (0x1e)
#pragma warning(push) #ifdef _WIN32
#pragma warning(disable : 4131 4244 4189 4245) # pragma warning(push)
# pragma warning(disable : 4131 4244 4189 4245)
#endif // _WIN32
const char unz_copyright[] = const char unz_copyright[] =
" unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll";
@ -1616,4 +1617,6 @@ extern int ZEXPORT unzSetOffset (file, pos)
return err; return err;
} }
#pragma warning(pop) #ifdef _WIN32
# pragma warning(pop)
#endif // _WIN32