Commit Graph

35 Commits (06bf80cc3b6e9ebd4907f192b30a54766f334b98)

Author SHA1 Message Date
Andrei Kortunov 93e50cc7aa Improve format version in content selector 1 year ago
elsid 80e6d6cbe3
Support variable size strings in ESM3 2 years ago
elsid 2e64155c0f
Use signed type for left record and files size in ESM3 reader context
Otherwise reading some of the records like ESM::CellRef without a subrecord
after could lead to underflow of ESM_Context::leftRec which makes
ESM::ESMReader::hasMoreSubs to return true and load hangs for a while trying to
read the same subrecord many times.

Fix ESM::Variant tests since it's now required to have a record for any ESM
data. Add 16 (size of record header) to all expected data sizes.
2 years ago
elsid 2bbed8cc06
Fix gcc warning: array subscript 5 is outside array bounds of ‘const char [5]’
In function ‘bool ESM::operator==(const FixedString<capacity>&, const T* const&) [with long unsigned int capacity = 5; T = char; <template-parameter-1-3> = void]’,
    inlined from ‘testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = ESM::FixedString<5>; T2 = const char*]’ at /home/elsid/dev/googletest/build/gcc/release/install/include/gtest/gtest.h:1358:11,
    inlined from ‘static testing::AssertionResult testing::internal::EqHelper::Compare(const char*, const char*, const T1&, const T2&) [with T1 = ESM::FixedString<5>; T2 = const char*; typename std::enable_if<((! std::is_integral<_Tp>::value) || (! std::is_pointer<_Dp>::value))>::type* <anonymous> = 0]’ at /home/elsid/dev/googletest/build/gcc/release/install/include/gtest/gtest.h:1377:64,
    inlined from ‘virtual void {anonymous}::EsmFixedString_equality_operator_for_not_convertible_to_uint32_with_const_char_pointer_Test::TestBody()’ at apps/openmw_test_suite/esm/test_fixed_string.cpp:165:9:
components/esm/esmcommon.hpp:134:19: warning: array subscript 5 is outside array bounds of ‘const char [5]’ [-Warray-bounds]
  134 |         return rhs[capacity] == '\0';
      |                ~~~^
apps/openmw_test_suite/esm/test_fixed_string.cpp: In member function ‘virtual void {anonymous}::EsmFixedString_equality_operator_for_not_convertible_to_uint32_with_const_char_pointer_Test::TestBody()’:
apps/openmw_test_suite/esm/test_fixed_string.cpp:164:20: note: at offset 5 into object ‘other’ of size 5
  164 |         const char other[5] = { 'a', 'b', 'c', 'd', '\0' };
      |                    ^~~~~
2 years ago
clang-format-bot ddb0522bbf
Apply clang-format to code base 2 years ago
Project579 e5c417c968 Make sure all paths are passed as std::filesystem::path instead of std::string where possible. 2 years ago
elsid da0a1ac9ba
Do compile time checks in compile time instead of tests 2 years ago
Evil Eye 61ea678a96 Implement ignored records 3 years ago
elsid 3305b400dc
Use ESM::NAME instead of const char* and std::string as argument type 3 years ago
elsid 45db56b382
Rework fixed string
* Avoid inheritance.
* Define equality operators out of the class definition.
* Replace toString with toStringView where it doesn't make sense to create a string.
3 years ago
elsid 18d3102148
Do not use union to access FIXED_STRING<4> as int
https://en.cppreference.com/w/cpp/language/union:
> It's undefined behavior to read from the member of the union that wasn't most recently written.
3 years ago
cc9cii 4b3de46bfa Use enums in place of magic numbers. Ensure Creature and NPC cell references are always saved as persistent. 4 years ago
elsid b806445a36
Use existing min implementation 4 years ago
jvoisin 8a56ba6aaa Fix compilation 4 years ago
elsid fbeccc2908 Apply 1 suggestion(s) to 1 file(s) 4 years ago
jvoisin e97e4d07dd Teensy optimisation for esmtool
- Use an unordered_set instead of a list to
  keep track of skipped records.
- Reduce the number of conditions when parsing 4-letters
  records by using a switch-case instead of cascading conditions.
- Add a const
4 years ago
Andrei Kortunov 822764d0fa Rework fixed strings handling 4 years ago
Bret Curtis 8c2f3ff007 clean up code; purge const_cast 5 years ago
Azdul 7940317e42 Make sure that proper operator function is used for char[N] argument 6 years ago
Roman Proskuryakov d5dfa89060 Rewrite NAME_T into FIXED_STRING. 9 years ago
Nikolay Kasyanov 3e45e9a48a Remove no longer required strnlen wrapper
It was used for MinGW & OS X < 10.7. Minimal OS X version was bumped to
10.7 and MinGW support was recently dropped (see
1eaa64c49c).
10 years ago
scrawl 9d3f0b2ed5 Remove some unused code, include cleanup 10 years ago
Nathan Aclander 33ce03dfc5 Should be compared against uint only 10 years ago
scrawl c883a73d30 Several warning fixes 10 years ago
Bret Curtis ab224f93c9 remove our stdint.h version that uses boost and force usage of system stdint.h 11 years ago
Marc Zinnschlag 16570ce87b moved header record struct to separate file 12 years ago
Marc Zinnschlag 731ac6a160 removed redundant copy of Header::Data 12 years ago
Marc Zinnschlag 9e68a420ae restructuring tes3 record structs 12 years ago
Marc Zinnschlag b085c4f749 removing more leftovers 12 years ago
Marc Zinnschlag 2e1a1fd11a removing some remains of the removed GMST fixing feature 12 years ago
Marc Zinnschlag 64d517dd79 removed unused file type information from esm component 12 years ago
Mark Siewert 2175f13b67 - Add tracking for dependencies between plugins.
- Add reference number mangling required for moving references around.
12 years ago
Mark Siewert 42eefaf36f - Add support for loading references from multiple esm/esp files. Full reference ID mangling coming soon (currently, moved references are simply cloned).
- Reference loader now (partially) supports MVRF tag.
12 years ago
greye 3494e17b7c wipe record superclass 12 years ago
greye 1339787863 remove underscores from filenames in esm 12 years ago