diff options
Diffstat (limited to 'src/util')
| -rw-r--r-- | src/util/asset_manager.cc | 12 | ||||
| -rw-r--r-- | src/util/fatal_error.h | 16 |
2 files changed, 14 insertions, 14 deletions
diff --git a/src/util/asset_manager.cc b/src/util/asset_manager.cc index 0baa063..a606b46 100644 --- a/src/util/asset_manager.cc +++ b/src/util/asset_manager.cc @@ -112,7 +112,7 @@ const uint8_t* GetAsset(AssetId asset_id, size_t* out_size) { CHECK_RETURN_END // Write header - uint32_t* header = reinterpret_cast<uint32_t*>(generated_data); + uint32_t* header = (uint32_t*)(generated_data); header[0] = (uint32_t)width; header[1] = (uint32_t)height; @@ -155,7 +155,7 @@ TextureAsset GetTextureAsset(AssetId asset_id) { return {0, 0, nullptr}; } - const uint32_t* header = reinterpret_cast<const uint32_t*>(data); + const uint32_t* header = (const uint32_t*)(data); return {(int)header[0], (int)header[1], data + 8}; } @@ -167,13 +167,13 @@ MeshAsset GetMeshAsset(AssetId asset_id) { } const uint8_t* ptr = data; - uint32_t num_vertices = *reinterpret_cast<const uint32_t*>(ptr); + uint32_t num_vertices = *(const uint32_t*)(ptr); ptr += sizeof(uint32_t); - const MeshVertex* vertices = reinterpret_cast<const MeshVertex*>(ptr); + const MeshVertex* vertices = (const MeshVertex*)(ptr); ptr += num_vertices * sizeof(MeshVertex); - uint32_t num_indices = *reinterpret_cast<const uint32_t*>(ptr); + uint32_t num_indices = *(const uint32_t*)(ptr); ptr += sizeof(uint32_t); - const uint32_t* indices = reinterpret_cast<const uint32_t*>(ptr); + const uint32_t* indices = (const uint32_t*)(ptr); return {num_vertices, vertices, num_indices, indices}; } diff --git a/src/util/fatal_error.h b/src/util/fatal_error.h index 988ec1d..e1dda38 100644 --- a/src/util/fatal_error.h +++ b/src/util/fatal_error.h @@ -31,17 +31,17 @@ // ============================================================================== // Early return if device is nullptr (headless mode stub) -#define HEADLESS_RETURN_IF_NULL(device) \ - do { \ - if ((device) == nullptr) \ - return; \ +#define HEADLESS_RETURN_IF_NULL(device) \ + do { \ + if ((device) == nullptr) \ + return; \ } while (0) // Early return with value if device is nullptr (headless mode stub) -#define HEADLESS_RETURN_VAL_IF_NULL(device, val) \ - do { \ - if ((device) == nullptr) \ - return (val); \ +#define HEADLESS_RETURN_VAL_IF_NULL(device, val) \ + do { \ + if ((device) == nullptr) \ + return (val); \ } while (0) #endif /* defined(STRIP_ALL) || defined(FINAL_STRIP) */ |
