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 {
};
#pragma warning(disable : 4315)
#ifdef _WIN32
# pragma warning(disable : 4315)
#endif
// ---------------------------------------------------------------------------
/** 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>
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
#include <zlib.h>
# include <zlib.h>
#else
#include "../contrib/zlib/zlib.h"
# include "../contrib/zlib/zlib.h"
#endif
#include <time.h>
#pragma warning(push)
#pragma warning(disable : 4706)
#ifdef _WIN32
# pragma warning(push)
# pragma warning(disable : 4706)
#endif // _WIN32
namespace Assimp {
@ -824,6 +826,8 @@ void DumpSceneToAssbin(
AssbinFileWriter fileWriter(shortened, compressed);
fileWriter.WriteBinaryDump(pFile, cmd, pIOSystem, pScene);
}
#pragma warning(pop)
#ifdef _WIN32
# pragma warning(pop)
#endif // _WIN32
} // end of namespace Assimp

View File

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

View File

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

View File

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

View File

@ -57,8 +57,10 @@ namespace glTF {
namespace {
#pragma warning(push)
#pragma warning(disable : 4706)
#ifdef _WIN32
# pragma warning(push)
# pragma warning(disable : 4706)
#endif // _WIN32
//
// JSON Value reading helpers
@ -1410,6 +1412,8 @@ inline std::string Asset::FindUniqueID(const std::string &str, const char *suffi
return id;
}
#pragma warning(pop)
#ifdef _WIN32
# pragma warning(pop)
#endif // WIN32
} // 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/prettywriter.h>
#pragma warning(push)
#pragma warning( disable : 4706)
#ifdef _WIN32
# pragma warning(push)
# pragma warning( disable : 4706)
#endif // _WIN32
namespace glTF {
@ -701,6 +703,8 @@ namespace glTF {
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];
}
#pragma warning(push)
#pragma warning(disable : 4310)
#ifdef _WIN32
# pragma warning(push)
# pragma warning(disable : 4310)
#endif // _WIN32
inline std::string getCurrentAssetDir(const std::string &pFile) {
std::string path = pFile;
int pos = std::max(int(pFile.rfind('/')), int(pFile.rfind('\\')));
@ -200,7 +203,9 @@ inline std::string getCurrentAssetDir(const std::string &pFile) {
return path;
}
#pragma warning(pop)
#ifdef _WIN32
# pragma warning(pop)
#endif // _WIN32
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;
}
#pragma warning(push)
#pragma warning(disable : 4706)
#ifdef _WIN32
# pragma warning(push)
# pragma warning(disable : 4706)
#endif // _WIN32
inline bool GetAttribVector(Mesh::Primitive &p, const char *attr, Mesh::AccessorList *&v, int &pos) {
if ((pos = Compare(attr, "POSITION"))) {
v = &(p.attributes.position);
@ -1504,8 +1507,9 @@ inline std::string Asset::FindUniqueID(const std::string &str, const char *suffi
id += suffix;
Asset::IdMap::iterator it = mUsedIds.find(id);
if (it == mUsedIds.end())
if (it == mUsedIds.end()) {
return id;
}
std::vector<char> buffer;
buffer.resize(id.size() + 16);
@ -1519,6 +1523,8 @@ inline std::string Asset::FindUniqueID(const std::string &str, const char *suffi
return id;
}
#pragma warning(pop)
#ifdef _WIN32
# pragma warning(pop)
#endif // _WIN32
} // namespace glTF2

View File

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

View File

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

View File

@ -36,8 +36,11 @@
namespace p2t {
#pragma warning(push)
#pragma warning( disable : 4702 )
#ifdef _WIN32
# pragma warning(push)
# pragma warning( disable : 4702 )
#endif // _WIN32
// Triangulate simple polygon with holes
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 "ioapi.h"
#pragma warning(push)
#pragma warning(disable : 4131 4100)
#ifdef _WIN32
# 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.... */
@ -179,4 +179,6 @@ void fill_fopen_filefunc (pzlib_filefunc_def)
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)
#pragma warning(push)
#pragma warning(disable : 4131 4244 4189 4245)
#ifdef _WIN32
# pragma warning(push)
# pragma warning(disable : 4131 4244 4189 4245)
#endif // _WIN32
const char unz_copyright[] =
" 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;
}
#pragma warning(pop)
#ifdef _WIN32
# pragma warning(pop)
#endif // _WIN32