This PR simply wildcards files in the repository in the metainformation
.reuse/dep5 to express copyright and licensing information for files
that can't easily be parsed by REUSE. If any of the assertions made in
.reuse/dep5 are incorrect, we should fix that before this PR
is accepted.
This approach works OK, though a more intrusive, but superior version of
this PR would simplify copyright / license statements as follows, and
make sure they're present in every file:
// Copyright 2019-2020 Binomial LLC
// SPDX-License-Identifier: Apache-2.0
(or whatever the appropriate copyright owner and license are for each
file). If that were done, the wildcarding in .reuse/dep5 would not be
required to pass REUSE.
(1 << num_bits) was converted to a signed integer that caused an overflow (as num_bits was usually set to 31). It worked fine since the value was later converted back to uint32_t but signed integer overflow is technically an undefined behavior and it was triggering errors in our automated tests.
Image slices have m_file_ofs. It is not relative to the start of the header, it is relative to the
start of the file. Double-check basisu_basis_file.cpp:
`m_images_descs[i].m_file_ofs = (uint32_t)cur_slice_file_ofs;`
basis_file_header has m_endpoint_cb_file_ofs. It might be easier to read if the comment on it
just said "file offset," but to clear up any confusion if someone is re-reading the spec later
this commit leaves the "relative to the" language but clarifies it. Ditto for
m_selector_cb_file_ofs.
The original implementation was dereferencing a nullptr which is an undefined behavior according to the C++ spec. It was triggering some automatic errors during our sanitizer tests (asan with nullptr check).
The fix replaces the offset with standard implementation of offsetof that uses compiler built in instructions when available (avoiding the undefined behavior).