Apply clangformat

pull/4160/head
RichardTea 2021-11-08 14:42:21 +00:00
parent 69cafe64b4
commit 9433fc526a
2 changed files with 103 additions and 105 deletions

View File

@ -39,8 +39,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------- ----------------------------------------------------------------------
*/ */
#include <assimp/StringUtils.h>
#include <assimp/MemoryIOWrapper.h> #include <assimp/MemoryIOWrapper.h>
#include <assimp/StringUtils.h>
#include <iomanip> #include <iomanip>
// Header files, Assimp // Header files, Assimp
@ -57,11 +57,10 @@ using namespace glTFCommon;
namespace glTF { namespace glTF {
#if _MSC_VER #if _MSC_VER
# pragma warning(push) #pragma warning(push)
# pragma warning(disable : 4706) #pragma warning(disable : 4706)
#endif // _MSC_VER #endif // _MSC_VER
// //
// LazyDict methods // LazyDict methods
// //
@ -215,8 +214,9 @@ inline void Buffer::Read(Value &obj, Asset &r) {
if (byteLength > 0) { if (byteLength > 0) {
std::string dir = !r.mCurrentAssetDir.empty() ? ( std::string dir = !r.mCurrentAssetDir.empty() ? (
r.mCurrentAssetDir.back() == '/' ? r.mCurrentAssetDir.back() == '/' ?
r.mCurrentAssetDir : r.mCurrentAssetDir + '/' r.mCurrentAssetDir :
) : ""; r.mCurrentAssetDir + '/') :
"";
IOStream *file = r.OpenFile(dir + uri, "rb"); IOStream *file = r.OpenFile(dir + uri, "rb");
if (file) { if (file) {
@ -771,8 +771,7 @@ inline void Mesh::Read(Value &pJSON_Object, Asset &pAsset_Root) {
Decode_O3DGC(*ext_o3dgc, pAsset_Root); Decode_O3DGC(*ext_o3dgc, pAsset_Root);
Extension.push_back(ext_o3dgc); // store info in mesh extensions list. Extension.push_back(ext_o3dgc); // store info in mesh extensions list.
} // if(it_memb->name.GetString() == "Open3DGC-compression") } // if(it_memb->name.GetString() == "Open3DGC-compression")
else else {
{
throw DeadlyImportError("GLTF: Unknown mesh extension: \"", it_memb->name.GetString(), "\"."); throw DeadlyImportError("GLTF: Unknown mesh extension: \"", it_memb->name.GetString(), "\".");
} }
} // for(Value::MemberIterator it_memb = json_extensions->MemberBegin(); it_memb != json_extensions->MemberEnd(); json_extensions++) } // for(Value::MemberIterator it_memb = json_extensions->MemberBegin(); it_memb != json_extensions->MemberEnd(); json_extensions++)
@ -1267,7 +1266,7 @@ inline void Asset::ReadExtensionsUsed(Document &doc) {
#undef CHECK_EXT #undef CHECK_EXT
} }
inline IOStream *Asset::OpenFile(const std::string& path, const char *mode, bool absolute) { inline IOStream *Asset::OpenFile(const std::string &path, const char *mode, bool absolute) {
#ifdef ASSIMP_API #ifdef ASSIMP_API
(void)absolute; (void)absolute;
return mIOSystem->Open(path, mode); return mIOSystem->Open(path, mode);
@ -1309,7 +1308,7 @@ inline std::string Asset::FindUniqueID(const std::string &str, const char *suffi
} }
#if _MSC_VER #if _MSC_VER
# pragma warning(pop) #pragma warning(pop)
#endif // _MSC_VER #endif // _MSC_VER
} // namespace glTF } // namespace glTF

View File

@ -299,7 +299,7 @@ inline LazyDict<T>::~LazyDict() {
template <class T> template <class T>
inline void LazyDict<T>::AttachToDocument(Document &doc) { inline void LazyDict<T>::AttachToDocument(Document &doc) {
Value *container = nullptr; Value *container = nullptr;
const char* context = nullptr; const char *context = nullptr;
if (mExtId) { if (mExtId) {
if (Value *exts = FindObject(doc, "extensions")) { if (Value *exts = FindObject(doc, "extensions")) {
@ -751,9 +751,8 @@ inline void Accessor::Read(Value &obj, Asset &r) {
byteOffset = MemberOrDefault(obj, "byteOffset", size_t(0)); byteOffset = MemberOrDefault(obj, "byteOffset", size_t(0));
componentType = MemberOrDefault(obj, "componentType", ComponentType_BYTE); componentType = MemberOrDefault(obj, "componentType", ComponentType_BYTE);
{ {
const Value* countValue = FindUInt(obj, "count"); const Value *countValue = FindUInt(obj, "count");
if (!countValue) if (!countValue) {
{
throw DeadlyImportError("A count value is required, when reading ", id.c_str(), name.empty() ? "" : " (" + name + ")"); throw DeadlyImportError("A count value is required, when reading ", id.c_str(), name.empty() ? "" : " (" + name + ")");
} }
count = countValue->GetUint(); count = countValue->GetUint();
@ -1983,7 +1982,7 @@ inline void Asset::ReadExtensionsUsed(Document &doc) {
#undef CHECK_EXT #undef CHECK_EXT
} }
inline IOStream *Asset::OpenFile(const std::string& path, const char *mode, bool /*absolute*/) { inline IOStream *Asset::OpenFile(const std::string &path, const char *mode, bool /*absolute*/) {
#ifdef ASSIMP_API #ifdef ASSIMP_API
return mIOSystem->Open(path, mode); return mIOSystem->Open(path, mode);
#else #else