Commit Graph

60 Commits (4fce9c8f1eb274aa216ed550efd232c768af260e)

Author SHA1 Message Date
Jackie9527 87c309566f Fix warning related to missing-noreturn.
Signed-off-by: Jackie9527 <80555200+Jackie9527@users.noreply.github.com>
2023-04-01 18:46:12 +08:00
Turo Lamminen 5ddd18d1c7 Add more AMF unit tests 2023-03-22 12:06:30 +02:00
Krishty 36305cf987 Tidy Up Constructors and Destructors
This commit does not add or remove c’tors or d’tors, so it is *not* ABI-breaking.

If a c’tor/d’tor does nothing else than the default behavior, this commit replaces it with “= default”.

If an initializer list entry does nothing else than the default behavior, this commit removes it. First and foremost, remove default c’tor calls of base classes (always called by the compiler if no other base c’tor is explicitly called) and c’tor calls of members with complex types (e.g. “std::vector”).

In a few instances, user-defined copy c’tors / move c’tors / assignment operators / move assignment operators were replaced with “= default”, too. I only did this if I had a clear understanding of what’s going on.
2023-01-16 21:47:11 +01:00
Aaron Gokaslan ccfb175460 Apply various clang-tidy checks for smartprs and modern C++ types 2022-11-08 11:03:55 -05:00
Kim Kulling 05746acb07 Merge branch 'new-file-detection' of https://github.com/krishty/assimp into krishty-new-file-detection 2022-01-16 20:41:24 +01:00
Kim Kulling 50c7301a38 Update copyrights 2022-01-10 21:13:43 +01:00
IOhannes m zmölnig 3b8126d26a Fix spelling mistake 2021-10-08 08:48:01 +02:00
krishty 8c84afaff0
Merge branch 'master' into const-tokens 2021-09-15 23:31:00 +02:00
Kim Kulling 18531e3677 Next iteration for c++11 features. 2021-09-13 22:38:20 +02:00
Krishty 5895c0c22c more const in format detection
BaseImporter::SearchFileHeaderForToken() expected a pointer to a non-const token list. This was probably an oversight, as nobody would realistically expect the function to change the list. Furthermore, it prevented token lists from being compiled to read-only memory, in some cases even causing the compiler to generate thread-safe initialization.

The list is now const and all callers declare their token lists static const, thus compiling them to read-only memory.
2021-09-11 23:23:05 +02:00
Krishty 758116b083 removed trailing spaces and tabs from source and text
This commit ignores the “contrib” folder in order to prevent merge conflicts in dependencies, should these be updated via git.
2021-07-29 13:28:51 +02:00
Jason C 00b625a2ae [amf] Fix crash when file could not be parsed.
Fix double free of mXmlParser (deleted but not reset in ParseFile, then deleted again in ~AMFImporter).

Should probably use a smart pointer instead, though.

---

This change was previously made in 785cca1bb4, as part of PR #3890, but was lost in a merge.
2021-05-10 19:06:39 -04:00
Kim Kulling cb7d3ac598
Merge branch 'master' into jc3-spam-killa 2021-05-10 22:21:13 +02:00
Jason C f87b180147
Merge branch 'master' into jc3-importer-open-error-handling 2021-05-09 17:02:04 -04:00
Kim Kulling b30cbcf117
Merge branch 'master' into jc3-spam-killa 2021-05-09 21:47:17 +02:00
Jason C 785cca1bb4 [amf] Fix crash when file could not be parsed.
Fix double free of mXmlParser (deleted but not reset in ParseFile, then deleted again in ~AMFImporter).

Should probably use a smart pointer instead, though.

Partially addresses https://github.com/assimp/assimp/issues/3888.
2021-05-05 17:13:10 -04:00
Jason C a03dc4edaa [amf] Fix minor typo in error message.
Added missing space to detail string on parse failure.
2021-05-04 21:56:49 -04:00
Krishty b79b84d34e Merge branch 'master' into new-file-detection 2021-05-05 00:09:42 +02:00
Krishty 0f3e6e2941 replaced std::size() with AI_COUNT_OF for pre-C++20 compilers 2021-05-05 00:08:54 +02:00
Jason C 2925592c64 [assimp] Make sure ctype calls use unsigned char.
Cast to unsigned char as required by C++ (see C++ **[cctype.cyn]** -> ISO C99 section 7.4, [see also](https://en.cppreference.com/w/cpp/string/byte/isspace)).

Addresses https://github.com/assimp/assimp/issues/3867 and then some.
2021-05-04 17:31:13 -04:00
kkulling 55fd820ed7 use const chars 2021-05-04 10:57:30 +02:00
Krishty b00de10eb3 Simplified importer search and fixed a few bugs
The search for a matching importer had a few issues, see #3791. There were two different mechanisms to determine whether an importer accepts a specific file extension:
1. `aiImporterDesc::mFileExtensions`, which was forwarded to the UI via `BaseImporter::GetExtensionList()`.
2. `BaseImporter::CanRead()` when called with `checkSig == false`, which determines whether to actually use that importer.
Both were redundant and got out of sync repeatedly. I removed 2. completely and replaced it with 1., thereby syncing UI/import and shortening all `BaseImporter::CanRead()` implementations.

Further bugfixes:
- fixed glTF2 importer throwing exceptions when checking whether it can load a file
- removed `BaseImporter::SimpleExtensionCheck()` because it is no longer used and had a bug with case sensitivity

Since the `checkSig` parameter in `BaseImporter::CanRead()` is now useless, it can be removed completely. I’m not sure if this would break ABI compatiblity, so I’ll submit it with a later pull request.
2021-04-24 00:17:50 +02:00
Krishty 9dc66b0003 removed dead code
BaseImporter::GetExtensionList() is not a virtual function; overriding it is useless. This probably stemmed from a misunderstanding.
2021-04-23 15:15:21 +02:00
Kim Kulling 80fc8538be
Update AMFImporter_Material.cpp 2021-04-03 10:29:16 +02:00
Kim Kulling d62c89557b
Remove dead code 2021-04-03 10:28:19 +02:00
Kim Kulling 46e49d0b83
Update AMFImporter_Geometry.cpp 2021-04-03 10:27:54 +02:00
Kim Kulling da0543972b Fix parsing for AMF-Files. 2021-04-03 10:25:03 +02:00
Kim Kulling 89a8f87dae AMF: Remove unused macros 2021-04-02 13:10:24 +02:00
Kim Kulling 6c89631581 closes https://github.com/assimp/assimp/issues/3678: ensure lowercase 2021-03-09 21:08:28 +01:00
Kim Kulling c669c8f1eb
Merge branch 'master' into update_copyrights 2021-02-28 12:18:41 +01:00
Kim Kulling 9e8dbd0ca5 Update copyrights to 2021. 2021-02-28 12:17:54 +01:00
Guangmo Lin ba7f945f99 Eliminate MSVC warning C4819 caused by source files encoded in UTF-8 without BOM 2021-02-14 10:28:14 +08:00
Ville Voutilainen 6ebae5e67c GCC 11 build fixes 2021-01-24 11:04:46 +02:00
ihsinme 070072370d
Update AMFImporter_Material.cpp 2021-01-12 15:43:40 +03:00
ihsinme 2e96366d04
Update AMFImporter_Geometry.cpp 2021-01-12 15:40:19 +03:00
Kim Kulling 177426185e
Fix invalid cast 2020-09-30 16:38:13 +02:00
Kim Kulling c591f7de2f make xml parsing more verbose. 2020-09-29 21:01:10 +02:00
Kim Kulling 5877f81419 amf: fix warning: unused variable. 2020-09-27 21:03:59 +02:00
Kim Kulling 5230b91611 amf: fix warning: unused variable. 2020-09-27 21:01:48 +02:00
Kim Kulling 8143ea5aec amf: fix warning: unused variable. 2020-09-27 20:58:08 +02:00
Kim Kulling 9a19a4723b amf: fix warning: unused variable. 2020-09-27 20:54:21 +02:00
Kim Kulling d6892b3f58 Merge branch 'master' into pugi_xml 2020-09-25 21:00:09 +02:00
kimkulling 6ec07e4dc7 XGL: next steps. 2020-09-10 17:31:30 +02:00
kimkulling cca9eddb1c Fix material-base AMF-unittest. 2020-09-10 13:56:04 +02:00
Kim Kulling d854f3b842 AMF: fix adding for child-nodes. 2020-09-10 00:05:53 +02:00
Kim Kulling 0618db1f99 AMF: some smaller refactorings to improve readability. 2020-09-07 20:52:46 +02:00
Kim Kulling 689406fbda Fix Colladat import. 2020-09-04 07:33:10 +02:00
Kim Kulling 075540e15a AMF: fixes. 2020-09-02 22:37:57 +02:00
Kim Kulling 6d5c388780 Introduce node iterator. 2020-08-30 21:10:04 +02:00
Malcolm Tyrrell 0f6127e90e No need to build strings. 2020-08-18 18:21:20 +01:00