[Bindings/Odin] pass -vet -strict-style

Many Odin users build with these flags and it would turn up errors here.
It is therefore advised to build libraries to conform to the strictest Odin flags.
This commit is contained in:
Laytan Laats 2025-02-17 20:13:21 +01:00
parent afa739b37b
commit 9b60a3628f

View File

@ -1,7 +1,6 @@
package clay package clay
import "core:c" import "core:c"
import "core:strings"
when ODIN_OS == .Windows { when ODIN_OS == .Windows {
foreign import Clay "windows/clay.lib" foreign import Clay "windows/clay.lib"
@ -176,7 +175,7 @@ FloatingElementConfig :: struct {
zIndex: i32, zIndex: i32,
attachment: FloatingAttachPoints, attachment: FloatingAttachPoints,
pointerCaptureMode: PointerCaptureMode, pointerCaptureMode: PointerCaptureMode,
attachTo: FloatingAttachToElement attachTo: FloatingAttachToElement,
} }
TextRenderData :: struct { TextRenderData :: struct {
@ -338,7 +337,7 @@ ElementDeclaration :: struct {
custom: CustomElementConfig, custom: CustomElementConfig,
scroll: ScrollElementConfig, scroll: ScrollElementConfig,
border: BorderElementConfig, border: BorderElementConfig,
userData: rawptr userData: rawptr,
} }
ErrorType :: enum EnumBackingType { ErrorType :: enum EnumBackingType {
@ -355,12 +354,12 @@ ErrorType :: enum EnumBackingType {
ErrorData :: struct { ErrorData :: struct {
errorType: ErrorType, errorType: ErrorType,
errorText: String, errorText: String,
userData: rawptr userData: rawptr,
} }
ErrorHandler :: struct { ErrorHandler :: struct {
handler: proc "c" (errorData: ErrorData), handler: proc "c" (errorData: ErrorData),
userData: rawptr userData: rawptr,
} }
Context :: struct {} // opaque structure, only use as a pointer Context :: struct {} // opaque structure, only use as a pointer
@ -409,12 +408,12 @@ foreign Clay {
} }
ClayOpenElement :: struct { ClayOpenElement :: struct {
configure: proc (config: ElementDeclaration) -> bool configure: proc (config: ElementDeclaration) -> bool,
} }
ConfigureOpenElement :: proc(config: ElementDeclaration) -> bool { ConfigureOpenElement :: proc(config: ElementDeclaration) -> bool {
_ConfigureOpenElement(config) _ConfigureOpenElement(config)
return true; return true
} }
@(deferred_none = _CloseElement) @(deferred_none = _CloseElement)