mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-15 16:05:56 +08:00
Suppress clang warnings.
This commit is contained in:
parent
ef151a4fed
commit
dc4bb86bf1
21
tiny_gltf.h
21
tiny_gltf.h
@ -4,7 +4,7 @@
|
|||||||
//
|
//
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
//
|
//
|
||||||
// Copyright (c) 2015 - 2017 Syoyo Fujita, Aurélien Chatelain and many
|
// Copyright (c) 2015 - 2018 Syoyo Fujita, Aurélien Chatelain and many
|
||||||
// contributors.
|
// contributors.
|
||||||
//
|
//
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
@ -876,6 +876,7 @@ class TinyGLTF {
|
|||||||
#pragma clang diagnostic ignored "-Wdisabled-macro-expansion"
|
#pragma clang diagnostic ignored "-Wdisabled-macro-expansion"
|
||||||
#pragma clang diagnostic ignored "-Wpadded"
|
#pragma clang diagnostic ignored "-Wpadded"
|
||||||
#pragma clang diagnostic ignored "-Wc++98-compat"
|
#pragma clang diagnostic ignored "-Wc++98-compat"
|
||||||
|
#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
|
||||||
#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
|
#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
|
||||||
#pragma clang diagnostic ignored "-Wswitch-enum"
|
#pragma clang diagnostic ignored "-Wswitch-enum"
|
||||||
#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
|
#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
|
||||||
@ -890,6 +891,18 @@ class TinyGLTF {
|
|||||||
#if __has_warning("-Wcast-qual")
|
#if __has_warning("-Wcast-qual")
|
||||||
#pragma clang diagnostic ignored "-Wcast-qual"
|
#pragma clang diagnostic ignored "-Wcast-qual"
|
||||||
#endif
|
#endif
|
||||||
|
#if __has_warning("-Wmissing-variable-declarations")
|
||||||
|
#pragma clang diagnostic ignored "-Wmissing-variable-declarations"
|
||||||
|
#endif
|
||||||
|
#if __has_warning("-Wmissing-prototypes")
|
||||||
|
#pragma clang diagnostic ignored "-Wmissing-prototypes"
|
||||||
|
#endif
|
||||||
|
#if __has_warning("-Wcast-align")
|
||||||
|
#pragma clang diagnostic ignored "-Wcast-align"
|
||||||
|
#endif
|
||||||
|
#if __has_warning("-Wnewline-eof")
|
||||||
|
#pragma clang diagnostic ignored "-Wnewline-eof"
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "./json.hpp"
|
#include "./json.hpp"
|
||||||
@ -1043,7 +1056,7 @@ static std::string FindFile(const std::vector<std::string> &paths,
|
|||||||
return std::string();
|
return std::string();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GetFilePathExtension(const std::string &FileName) {
|
static std::string GetFilePathExtension(const std::string &FileName) {
|
||||||
if (FileName.find_last_of(".") != std::string::npos)
|
if (FileName.find_last_of(".") != std::string::npos)
|
||||||
return FileName.substr(FileName.find_last_of(".") + 1);
|
return FileName.substr(FileName.find_last_of(".") + 1);
|
||||||
return "";
|
return "";
|
||||||
@ -1408,7 +1421,7 @@ static std::string MimeToExt(const std::string &mimeType) {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateImageObject(Image &image, std::string &baseDir, int index,
|
static void UpdateImageObject(Image &image, std::string &baseDir, int index,
|
||||||
bool embedImages,
|
bool embedImages,
|
||||||
WriteImageDataFunction *WriteImageData = nullptr,
|
WriteImageDataFunction *WriteImageData = nullptr,
|
||||||
void *user_data = nullptr) {
|
void *user_data = nullptr) {
|
||||||
@ -4005,7 +4018,7 @@ bool TinyGLTF::WriteGltfSceneToFile(Model *model, const std::string &filename,
|
|||||||
for (unsigned int i = 0; i < model->images.size(); ++i) {
|
for (unsigned int i = 0; i < model->images.size(); ++i) {
|
||||||
json image;
|
json image;
|
||||||
|
|
||||||
UpdateImageObject(model->images[i], baseDir, i, embedImages,
|
UpdateImageObject(model->images[i], baseDir, int(i), embedImages,
|
||||||
&this->WriteImageData, &this->write_image_user_data_);
|
&this->WriteImageData, &this->write_image_user_data_);
|
||||||
SerializeGltfImage(model->images[i], image);
|
SerializeGltfImage(model->images[i], image);
|
||||||
images.push_back(image);
|
images.push_back(image);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user