mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-18 20:40:28 +00:00
Merge branch 'odin-lang:master' into union-tag-intrinsics
This commit is contained in:
@@ -63,8 +63,8 @@ read_at_least :: proc(fd: Handle, buf: []byte, min: int) -> (n: int, err: Errno)
|
||||
if len(buf) < min {
|
||||
return 0, -1
|
||||
}
|
||||
for n < min && err == 0 {
|
||||
nn: int
|
||||
nn := max(int)
|
||||
for nn > 0 && n < min && err == 0 {
|
||||
nn, err = read(fd, buf[n:])
|
||||
n += nn
|
||||
}
|
||||
|
||||
@@ -5366,7 +5366,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
|
||||
|
||||
Operand op = {};
|
||||
check_expr(c, &op, ce->args[1]);
|
||||
if (op.mode != Addressing_Constant && !is_type_integer(op.type)) {
|
||||
if (op.mode != Addressing_Constant || !is_type_integer(op.type)) {
|
||||
error(op.expr, "Expected a constant integer for the index of procedure parameter value");
|
||||
return false;
|
||||
}
|
||||
@@ -5425,7 +5425,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
|
||||
|
||||
Operand op = {};
|
||||
check_expr(c, &op, ce->args[1]);
|
||||
if (op.mode != Addressing_Constant && !is_type_integer(op.type)) {
|
||||
if (op.mode != Addressing_Constant || !is_type_integer(op.type)) {
|
||||
error(op.expr, "Expected a constant integer for the index of procedure parameter value");
|
||||
return false;
|
||||
}
|
||||
@@ -5503,7 +5503,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
|
||||
} else {
|
||||
Operand op = {};
|
||||
check_expr(c, &op, ce->args[1]);
|
||||
if (op.mode != Addressing_Constant && !is_type_integer(op.type)) {
|
||||
if (op.mode != Addressing_Constant || !is_type_integer(op.type)) {
|
||||
error(op.expr, "Expected a constant integer for the index of record parameter value");
|
||||
return false;
|
||||
}
|
||||
|
||||
2
vendor/glfw/bindings/bindings.odin
vendored
2
vendor/glfw/bindings/bindings.odin
vendored
@@ -39,7 +39,7 @@ when ODIN_OS == .Windows {
|
||||
/*** Functions ***/
|
||||
@(default_calling_convention="c", link_prefix="glfw")
|
||||
foreign glfw {
|
||||
Init :: proc() -> c.int ---
|
||||
Init :: proc() -> b32 ---
|
||||
Terminate :: proc() ---
|
||||
|
||||
InitHint :: proc(hint, value: c.int) ---
|
||||
|
||||
2
vendor/glfw/bindings/types.odin
vendored
2
vendor/glfw/bindings/types.odin
vendored
@@ -41,7 +41,7 @@ WindowMaximizeProc :: #type proc "c" (window: WindowHandle, iconified: c.int
|
||||
WindowContentScaleProc :: #type proc "c" (window: WindowHandle, xscale, yscale: f32)
|
||||
FramebufferSizeProc :: #type proc "c" (window: WindowHandle, width, height: c.int)
|
||||
DropProc :: #type proc "c" (window: WindowHandle, count: c.int, paths: [^]cstring)
|
||||
MonitorProc :: #type proc "c" (window: WindowHandle)
|
||||
MonitorProc :: #type proc "c" (window: WindowHandle, event: c.int)
|
||||
|
||||
KeyProc :: #type proc "c" (window: WindowHandle, key, scancode, action, mods: c.int)
|
||||
MouseButtonProc :: #type proc "c" (window: WindowHandle, button, action, mods: c.int)
|
||||
|
||||
14
vendor/glfw/wrapper.odin
vendored
14
vendor/glfw/wrapper.odin
vendored
@@ -49,7 +49,19 @@ SetGammaRamp :: glfw.SetGammaRamp
|
||||
CreateWindow :: glfw.CreateWindow
|
||||
DestroyWindow :: glfw.DestroyWindow
|
||||
|
||||
WindowHint :: glfw.WindowHint
|
||||
WindowHint_int :: proc "contextless" (hint: c.int, value: c.int) {
|
||||
glfw.WindowHint(hint, value)
|
||||
}
|
||||
|
||||
WindowHint_bool :: proc "contextless" (hint: c.int, value: b32) {
|
||||
glfw.WindowHint(hint, cast(c.int) value)
|
||||
}
|
||||
|
||||
WindowHint :: proc {
|
||||
WindowHint_int,
|
||||
WindowHint_bool,
|
||||
}
|
||||
|
||||
DefaultWindowHints :: glfw.DefaultWindowHints
|
||||
WindowHintString :: glfw.WindowHintString
|
||||
WindowShouldClose :: glfw.WindowShouldClose
|
||||
|
||||
Reference in New Issue
Block a user