fix compiler warnings and release mode u32 overflow

This commit is contained in:
asrael 2025-11-10 09:59:42 -06:00
parent 9550d34e65
commit 704b14b2a0
3 changed files with 12 additions and 7 deletions

View file

@ -1,6 +1,7 @@
#pragma once
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include "pxl8_types.h"
@ -60,7 +61,9 @@ static inline i32 pxl8_read_i32(pxl8_stream* stream) {
static inline f32 pxl8_read_f32(pxl8_stream* stream) {
u32 val = pxl8_read_u32(stream);
return *(f32*)&val;
f32 result;
memcpy(&result, &val, sizeof(f32));
return result;
}
static inline void pxl8_read_bytes(pxl8_stream* stream, void* dest, u32 count) {