Stephen Booth 648f5e5882
Add Shorten (SHN) support (#1257)
* Add Shorten (SHN) support

* Add `<cmath>` include and use `std::log2`

* Use `uintptr_t` for buffer size calculations

* Work around `byteSwap` not using fixed width types

* Remove four-character codes

* Attempt to fix `static_assert`

* Revert previous commit

* Update `read_uint`* functions

* Use ByteVector for byte swaps

* Use different ByteVector ctor

* Rework variable-length input to use ByteVector

* Rename some variables

* Naming and formatting cleanup

* Add basic Shorten tests

* Rename a constant

* Rename `internalFileType` to `fileType`

* Add documentation on `fileType` meaning

* Add DO_NOT_DOCUMENT guard

* Fix shadowVariable issues reported by cppcheck

cppcheck --enable=all --inline-suppr \
  --suppress=noExplicitConstructor --suppress=unusedFunction \
  --suppress=missingIncludeSystem --project=compile_commands.json

* Formatting cleanup

* More explicit types

Reason for these changes: getRiceGolombCode(k, uInt32CodeSize) was
called with int k for uint32_t& argument.
There was also a warning from MSVC for line 299:
warning C4267: 'argument': conversion from 'size_t' to 'int'

* Additional explicit types

* Rename `SHN` namespace to `Shorten`

Also rename files to match

---------

Co-authored-by: Urs Fleisch <ufleisch@users.sourceforge.net>
2024-12-30 07:23:11 -06:00
..
2009-07-24 13:08:51 +00:00
2014-12-30 23:53:40 +09:00
2015-06-18 17:43:09 +09:00
2015-11-30 17:18:50 +09:00
2023-11-03 05:17:39 +01:00
2023-09-26 16:23:03 +02:00
2011-06-09 18:40:22 +02:00
2007-11-10 22:55:14 +00:00
2010-07-11 09:47:58 +00:00
2015-06-18 17:43:09 +09:00
2014-12-31 01:44:25 +09:00
2015-06-18 14:41:37 +09:00
2014-12-30 23:53:40 +09:00
2011-06-24 01:31:15 +02:00