fix macos build (#859)

* update macos.yml

* update macos.yml

* update macos.yml

* update macos.yml

* update macos.yml

* update macos.yml

* update workflows

* update test

* fix unused function warning

* update test

* fixes

* update test

* update test

* update macos.yml

* Revert "update workflows"

This reverts commit ae78ff3ca2.
This commit is contained in:
MihailRis 2026-07-07 17:42:24 +03:00 • committed by GitHub
parent 51c0f99061
commit a8ed3cb36f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 4 deletions

View file

@ -11,9 +11,9 @@
namespace util {
template<typename T>
inline T read_int_le(const uint8_t* src, ptrdiff_t offset=0) {
inline T read_int_le(const uint8_t* src) {
T tmp;
std::memcpy(&tmp, src + offset * sizeof(T), sizeof(T));
std::memcpy(&tmp, src, sizeof(T));
return dataio::le2h(tmp);
}
@ -126,7 +126,7 @@ namespace util {
if (ptr == nullptr) {
return 0;
}
return read_int_le<Tsize>(ptr, -1);
return read_int_le<Tsize>(ptr - sizeof(Tsize));
}
/// @return number of entries
@ -177,7 +177,7 @@ namespace util {
) : buffer(buffer), index(index), offset(offset) {}
Tsize size() const {
return read_int_le<Tsize>(buffer.data() + offset, -1);
return read_int_le<Tsize>(buffer.data() + offset - sizeof(Tsize));
}
bool operator!=(const const_iterator& o) const {