Skip to content

Commit

Permalink
Make certain procedures "contextless" for microui
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerBill committed Jun 8, 2024
1 parent 575e5a2 commit 371749d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vendor/microui/microui.odin
Original file line number Diff line number Diff line change
Expand Up @@ -622,15 +622,15 @@ push_command :: proc(ctx: ^Context, $Type: typeid, extra_size := 0) -> ^Type {
return cmd
}

next_command :: proc(ctx: ^Context, pcmd: ^^Command) -> bool {
next_command :: proc "contextless" (ctx: ^Context, pcmd: ^^Command) -> bool {
cmd := pcmd^
defer pcmd^ = cmd
if cmd != nil {
cmd = (^Command)(uintptr(cmd) + uintptr(cmd.size))
} else {
cmd = (^Command)(&ctx.command_list.items[0])
}
invalid_command :: #force_inline proc(ctx: ^Context) -> ^Command {
invalid_command :: #force_inline proc "contextless" (ctx: ^Context) -> ^Command {
return (^Command)(&ctx.command_list.items[ctx.command_list.idx])
}
for cmd != invalid_command(ctx) {
Expand All @@ -643,7 +643,7 @@ next_command :: proc(ctx: ^Context, pcmd: ^^Command) -> bool {
return false
}

next_command_iterator :: proc(ctx: ^Context, pcm: ^^Command) -> (Command_Variant, bool) {
next_command_iterator :: proc "contextless" (ctx: ^Context, pcm: ^^Command) -> (Command_Variant, bool) {
if next_command(ctx, pcm) {
return pcm^.variant, true
}
Expand Down

0 comments on commit 371749d

Please sign in to comment.