Commit Graph

668 Commits

Author SHA1 Message Date
Phillip Stephens eb41d349dc
Fix stand alone compiling, minor code updates 2019-12-08 13:32:50 -08:00
Phillip Stephens 9771af88ed
Merge pull request #69 from lioncash/cast
IStreamWriter: Eliminate several casts
2019-10-20 18:40:40 -07:00
Phillip Stephens 182c4ff54f
Merge pull request #70 from lioncash/prototype
IStream: Remove unimplemented operator<< prototype
2019-10-20 18:40:31 -07:00
Phillip Stephens ed83cc0f5e
Merge pull request #71 from lioncash/fmt
Global: Remove compatibility formatting define for size_t
2019-10-20 18:40:23 -07:00
Phillip Stephens 9a2277091f
Merge pull request #72 from lioncash/constexpr
DNAYaml: Make use of if constexpr where applicable
2019-10-20 18:40:14 -07:00
Lioncash e7f7867f32 DNAYaml: Make use of if constexpr within NodeToVec()
Only the constexpr isDouble variable is tested within the conditional,
so we can make use of if constexpr here.
2019-10-19 07:13:51 -04:00
Lioncash 120b3d1281 DNAYaml: Collapse SFINAE functions into single function
We can leverage if constexpr here to determine which branch of code to
instantiate, eliminating the need for the use of SFINAE.
2019-10-19 07:10:50 -04:00
Lioncash 93dacd4231 Global: Remove compatibility formatting define for size_t
Given the use of fmt, we can trivially remove the remaining usages of
this define and remove it from the Global header.
2019-10-19 06:39:48 -04:00
Lioncash 7f6ac632f1 test: Directly use specifier for size_t 2019-10-19 06:30:04 -04:00
Lioncash cf91ead01b IStream: Remove unimplemented operator<< prototype
The proper prototype and implementation lies within Global.cpp/.hpp,
which takes a const reference rather than a non-const reference.
2019-10-19 05:32:23 -04:00
Lioncash 1f870c9940 IStreamWriter: Eliminate several casts
We can leverage writeBytes as opposed to writeUBytes to eliminate all
but one cast.
2019-10-19 05:23:55 -04:00
Jack Andersen 03f9314a2a Use llvm's optional 2019-10-18 15:31:35 -10:00
Jack Andersen ee012692ba Fix memory-related problems triggered by emplace_back + copy elision 2019-10-12 18:50:46 -10:00
Jack Andersen 42581c922a Merge branch 'master' of ssh://git.axiodl.com:6431/libAthena/athena 2019-09-30 21:16:11 -10:00
Jack Andersen c7b6744509 Numerous code style improvements 2019-09-30 21:10:47 -10:00
Phillip Stephens a9039e04e6
Fix AT_SPECIALIZE_* endian references 2019-09-27 20:37:48 -07:00
Phillip Stephens 2ab6a6d75d
Merge pull request #68 from lioncash/endian
General: Make Endian an enum class
2019-09-26 06:53:06 -07:00
Lioncash 776cb1d04f General: Make Endian an enum class
Makes the type strongly typed and not susceptible to implicit
conversions.
2019-09-23 18:59:28 -04:00
Phillip Stephens c28f77f75e
Merge pull request #67 from lioncash/class
Global: Make SeekOrigin an enum class
2019-09-14 08:37:58 -07:00
Lioncash 9bde23011f Global: Make SeekOrigin an enum class
Makes the enumeration strongly typed and also allows forward declaring
the enumeration type as well.
2019-09-14 10:39:15 -04:00
Phillip Stephens 2392dde366
Merge pull request #66 from lioncash/seek
General: Be explicit about SeekOrigin and Endian types
2019-09-10 04:05:41 -07:00
Lioncash 71eb499270 General: Be explicit about the Endian type 2019-09-09 22:04:02 -04:00
Lioncash d5e91ca0fe General: Be explicit about the SeekOrigin type 2019-09-09 22:03:18 -04:00
Phillip Stephens a2f4633073
Merge pull request #65 from lioncash/atdna
atdna: Be explicit about the SeekOrigin type
2019-09-09 04:19:13 -07:00
Lioncash 3ca9bcf12d atdna: Be explicit about the SeekOrigin type 2019-09-09 02:17:56 -04:00
Phillip Stephens 97ee63f0fe
Merge pull request #64 from lioncash/constexpr
Global: Make operator|= and &= for enums constexpr
2019-09-08 00:13:16 -07:00
Phillip Stephens 925fee31c8
Merge pull request #63 from lioncash/windows
CMakeLists: Define -DNOMINMAX and -DWIN32_LEAN_AND_MEAN on Windows
2019-09-08 00:12:59 -07:00
Lioncash c909e628cc Global: Make enum functions noexcept
Allows them to be used within other noexcept constructs.
2019-09-07 12:43:20 -04:00
Lioncash b629d90147 Global: Make operator|= and &= for enums constexpr
These are allowed to be constexpr since C++14
2019-09-07 12:43:00 -04:00
Lioncash b7974ffd01 CMakeLists: Define -DNOMINMAX and -DWIN32_LEAN_AND_MEAN on Windows
Avoids needing to explicitly define these in code and also allow
external targets to be unaffected by this.
2019-09-07 12:18:45 -04:00
Phillip Stephens 30158859f7
Merge pull request #61 from lioncash/size
FileWriterWin32: Handle large files within writeUBytes
2019-09-07 07:06:33 -07:00
Phillip Stephens 1e2f5d4ec0
Merge pull request #62 from lioncash/cmake
CMakeLists: Append sources to athena-core directly
2019-09-07 07:06:02 -07:00
Lioncash 4460ecedd2 CMakeLists: Append sources to athena-core directly
Avoids using an intermediary variable for the same behavior.
2019-09-07 08:53:05 -04:00
Lioncash 3b1348a26a FileWriterWin32: Handle large files within writeUBytes
Handles the case where a given size exceeds the maximum value that can
be contained within a DWORD.

Given a DWORD is 32-bit in size and an atUint64 is 64-bits in size, this
avoids errors on valid sizes, even if they're extremely unlikely to ever
occur.
2019-09-07 08:35:05 -04:00
Lioncash 462146b644 FileWriterWin32: Prevent implicit sign conversion within position() 2019-09-07 08:35:01 -04:00
Phillip Stephens e63ea83f51
Merge pull request #60 from lioncash/crc
Checksums: Correct null check within crc16()
2019-09-06 23:22:43 -07:00
Lioncash 34ae45bbd1 Checksums: Correct null check within crc16
This should be checking if the input is null rather than not null before
early exiting, otherwise the data itself will never have the checksum
calculated.
2019-09-06 04:46:27 -04:00
Phillip Stephens 8b0a010e78
Merge pull request #59 from lioncash/cast
Compression/LZ77: Remove unnecessary pointer casts
2019-09-06 01:16:28 -07:00
Lioncash 200f8f311a Compression/LZ77: Remove unnecessary pointer casts
There's no need to cast here in a few of these areas, so we can remove
them.

This also resolves quite a few -Wcast-qual warnings,
2019-09-06 04:13:58 -04:00
Phillip Stephens 9aad64e740
Merge pull request #58 from lioncash/leak
MemoryWriter: Prevent potential leak within save()
2019-09-06 01:01:27 -07:00
Lioncash de45f0896f MemoryWriter: Use a std::unique_ptr within resize()
Same behavior, but keeps the memory managed throughout its whole
lifetime.
2019-09-06 03:32:16 -04:00
Lioncash 57ad780321 MemoryWriter: Remove unnecessary type cast within MemoryWriter constructor and setData()
The input type is already the same type as the class member, so the cast
is unnecessary.

While we're at it, we can also remove an unnecessary initializer for
m_position, since we initialize this to zero within the class
declaration already.
2019-09-06 03:31:56 -04:00
Lioncash 4e414902be MemoryWriter: Use a std::unique_ptr for FILE handle in save()
Prevents potential leaks from occurring within failure cases (e.g. with
the default exception handler).
2019-09-06 03:23:48 -04:00
Phillip Stephens 781937da88
Merge pull request #57 from lioncash/init
MemoryWriter: Initialize member variables to deterministic values
2019-09-05 01:09:14 -07:00
Lioncash 016e14c460 MemoryWriter: Initialize member variables to deterministic values
Makes the variable initialization behavior deterministic in the case of
the default constructor. This also eliminates the possibility of an
uninitialized read from occurring within the destructor entirely; even
in the face of future changes.
2019-09-05 01:12:07 -04:00
Phillip Stephens f099ee0b1b
Merge pull request #56 from lioncash/string
atdna/main: Avoid unnecessary string churn
2019-09-04 19:32:23 -07:00
Lioncash 0dcf0cec03 main: Avoid unnecessary string churn
Reduces the amount of overall allocation churn due to string
concatenation by avoiding redundant string temporaries.
2019-09-04 16:12:25 -04:00
Lioncash 607f99fa1a main: Amend variable shadowing warnings 2019-09-04 15:23:44 -04:00
Lioncash 8dc86ea991 main: Amend inclusion order 2019-09-04 15:20:55 -04:00
Jack Andersen 132c7def65 Merge branch 'master' of ssh://git.axiodl.com:6431/libAthena/athena 2019-08-31 10:36:20 -10:00