Keep -vet and -strict-style happy

This commit is contained in:
gingerBill
2025-01-30 12:22:22 +00:00
parent 376f6a6b77
commit bf7c192ce9
4 changed files with 10 additions and 11 deletions

View File

@@ -2,5 +2,5 @@ package sdl3
@(export)
foreign import lib {
"SDL3.lib"
"SDL3.lib",
}

View File

@@ -2,7 +2,6 @@ package sdl3
import "base:intrinsics"
import "core:c"
import "core:strings"
TriggerBreakpoint :: intrinsics.debug_trap
AssertBreakpoint :: TriggerBreakpoint

View File

@@ -13,12 +13,12 @@ BYTEORDER :: LIL_ENDIAN when ODIN_ENDIAN == .Little else BIG_ENDIAN
@(require_results) SwapFloat :: #force_inline proc "c" (x: f32) -> f32 { return intrinsics.byte_swap(x) }
@(require_results) Swap16LE :: #force_inline proc "c" (x: Uint16) -> Uint16 { return Uint16(transmute(u16le)x) }
@(require_results) Swap32LE :: #force_inline proc "c" (x: Uint32) -> Uint32 { return Uint32(transmute(u32le)x) }
@(require_results) Swap64LE :: #force_inline proc "c" (x: Uint64) -> Uint64 { return Uint64(transmute(u64le)x) }
@(require_results) SwapFloatLE :: #force_inline proc "c" (x: f32) -> f32 { return f32 (transmute(f32le)x) }
@(require_results) Swap16LE :: #force_inline proc "c" (x: Uint16) -> Uint16 { x := x; return Uint16((^u16le)(&x)^) }
@(require_results) Swap32LE :: #force_inline proc "c" (x: Uint32) -> Uint32 { x := x; return Uint32((^u32le)(&x)^) }
@(require_results) Swap64LE :: #force_inline proc "c" (x: Uint64) -> Uint64 { x := x; return Uint64((^u64le)(&x)^) }
@(require_results) SwapFloatLE :: #force_inline proc "c" (x: f32) -> f32 { x := x; return f32 ((^f32le)(&x)^) }
@(require_results) Swap16BE :: #force_inline proc "c" (x: Uint16) -> Uint16 { return Uint16(transmute(u16be)x) }
@(require_results) Swap32BE :: #force_inline proc "c" (x: Uint32) -> Uint32 { return Uint32(transmute(u32be)x) }
@(require_results) Swap64BE :: #force_inline proc "c" (x: Uint64) -> Uint64 { return Uint64(transmute(u64be)x) }
@(require_results) SwapFloatBE :: #force_inline proc "c" (x: f32) -> f32 { return f32 (transmute(f32be)x) }
@(require_results) Swap16BE :: #force_inline proc "c" (x: Uint16) -> Uint16 { x := x; return Uint16((^u16be)(&x)^) }
@(require_results) Swap32BE :: #force_inline proc "c" (x: Uint32) -> Uint32 { x := x; return Uint32((^u32be)(&x)^) }
@(require_results) Swap64BE :: #force_inline proc "c" (x: Uint64) -> Uint64 { x := x; return Uint64((^u64be)(&x)^) }
@(require_results) SwapFloatBE :: #force_inline proc "c" (x: f32) -> f32 { x := x; return f32 ((^f32be)(&x)^) }

View File

@@ -33,7 +33,7 @@ IOStreamInterface :: struct {
#assert(
(size_of(IOStreamInterface) == 28 && size_of(rawptr) == 4) ||
(size_of(IOStreamInterface) == 56 && size_of(rawptr) == 8)
(size_of(IOStreamInterface) == 56 && size_of(rawptr) == 8),
)
IOStream :: struct {}