12 if ((bhead->
code & 0xFFFF) == 0) {
26 if ((bhead->
code & 0xFFFF) == 0) {
40 if ((bhead->
code & 0xFFFF) == 0) {
64 if constexpr (
sizeof(
void *) == 8) {
65 return reinterpret_cast<const void *
>(
ptr);
76 bhead.
len = small_bhead8.
len;
79 bhead.
nr = small_bhead8.
nr;
87 bhead.
len = large_bhead8.
len;
90 bhead.
nr = large_bhead8.
nr;
96 const bool do_endian_swap)
103 if (readsize ==
sizeof(bhead4) || bhead4.code ==
BLO_CODE_ENDB) {
104 if (do_endian_swap) {
114 const int64_t readsize =
file->read(
file, &small_bhead8,
sizeof(small_bhead8));
115 if (readsize ==
sizeof(small_bhead8) || small_bhead8.code ==
BLO_CODE_ENDB) {
116 if (do_endian_swap) {
126 const int64_t readsize =
file->read(
file, &large_bhead8,
sizeof(large_bhead8));
127 if (readsize ==
sizeof(large_bhead8) || large_bhead8.code ==
BLO_CODE_ENDB) {
128 if (do_endian_swap) {
BLI_INLINE void BLI_endian_switch_int64(int64_t *val) ATTR_NONNULL(1)
BLI_INLINE void BLI_endian_switch_int32(int *val) ATTR_NONNULL(1)
Wrapper for reading from various sources (e.g. raw files, compressed files, memory....
uint32_t uint32_from_uint64_ptr(uint64_t ptr, const bool use_endian_swap)
static BHead bhead_from_small_bhead8(const SmallBHead8 &small_bhead8, const bool use_endian_swap)
static void switch_endian_small_bh8(SmallBHead8 *bhead)
static const void * old_ptr_from_uint64_ptr(const uint64_t ptr, const bool use_endian_swap)
static BHead bhead_from_large_bhead8(const LargeBHead8 &large_bhead8, const bool use_endian_swap)
static BHead bhead_from_bhead4(const BHead4 &bhead4)
static void switch_endian_bh4(BHead4 *bhead)
static void switch_endian_large_bh8(LargeBHead8 *bhead)
std::optional< BHead > BLO_readfile_read_bhead(FileReader *file, const BHeadType type, const bool do_endian_swap)
_W64 unsigned int uintptr_t
unsigned __int64 uint64_t