lang: rename signed integer types sN -> iN

Surface rename of the signed integer family: s1..s64 become i1..i64
(u1..u64, usize, isize unchanged). 'string' keeps the s-prefix arm in
name classification; width parsing moves to the i-prefix arm next to
isize.

Internal TypeId tags follow the surface (.s8/.s16/.s32/.s64 ->
.i8/.i16/.i32/.i64), as do mono-key mangle fragments (ptr_i64,
tu_i64_bool) and all display/diagnostic formatting (i{d}).

Migrated in the same sweep: stdlib + examples + issue repros + FFI C
companions (shared symbol names like ffi_id_i64), expected
stdout/stderr/ir snapshots, specs.md, readme.md, CLAUDE.md/AGENTS.md,
implementation_plan.md, docs/, issue writeups. Vendored stb_image and
historical flow state left untouched.

zig build test: 426/426; examples suite: 595/595.
This commit is contained in:
agra
2026-06-12 09:31:53 +03:00
parent 515ecebea7
commit d8076b9333
1054 changed files with 6836 additions and 6839 deletions

View File

@@ -26,8 +26,8 @@ SEL :: *void;
// Apple's `BOOL` is a signed char (NOT sx's built-in `bool`, which is
// LLVM `i1`). Obj-C method signatures that take or return `BOOL` cross
// the FFI boundary as `s8`.
BOOL :: s8;
// the FFI boundary as `i8`.
BOOL :: i8;
// On macOS libobjc is auto-loaded by libSystem; on iOS it isn't, so we
// link it explicitly. Foundation registers NSString etc. with the runtime,

View File

@@ -32,8 +32,8 @@
// it wraps. Total = 48 bytes.
Block :: struct {
isa: *void;
flags: s32;
reserved: s32;
flags: i32;
reserved: i32;
invoke: *void;
descriptor: *void;
sx_env: *void;
@@ -95,7 +95,7 @@ impl Into(Block) for Closure(..$args) -> $R {
build_block_convert :: (args: []Type, $ret: Type) -> string {
ret_name := type_name(ret);
code := "__invoke :: (block_self: *Block";
i : s64 = 0;
i : i64 = 0;
while i < args.len {
code = concat(code, ", arg");
code = concat(code, int_to_string(i));

View File

@@ -2,8 +2,8 @@
// No #library needed — caller provides a loader (e.g. SDL_GL_GetProcAddress)
// Constants
GL_FALSE :s32: 0;
GL_TRUE :s32: 1;
GL_FALSE :i32: 0;
GL_TRUE :i32: 1;
GL_DEPTH_TEST :u32: 0x0B71;
GL_CULL_FACE :u32: 0x0B44;
GL_BLEND :u32: 0x0BE2;
@@ -29,35 +29,35 @@ glClearColor : (f32, f32, f32, f32) -> void callconv(.c) = ---;
glClear : (u32) -> void callconv(.c) = ---;
glEnable : (u32) -> void callconv(.c) = ---;
glDisable : (u32) -> void callconv(.c) = ---;
glViewport : (s32, s32, s32, s32) -> void callconv(.c) = ---;
glViewport : (i32, i32, i32, i32) -> void callconv(.c) = ---;
glFlush : () -> void callconv(.c) = ---;
glDrawArrays : (u32, s32, s32) -> void callconv(.c) = ---;
glDrawArrays : (u32, i32, i32) -> void callconv(.c) = ---;
glPolygonMode : (u32, u32) -> void callconv(.c) = ---;
glLineWidth : (f32) -> void callconv(.c) = ---;
glCreateShader : (u32) -> u32 callconv(.c) = ---;
glShaderSource : (u32, s32, *[:0]u8, *s32) -> void callconv(.c) = ---;
glShaderSource : (u32, i32, *[:0]u8, *i32) -> void callconv(.c) = ---;
glCompileShader : (u32) -> void callconv(.c) = ---;
glGetShaderiv : (u32, u32, *s32) -> void callconv(.c) = ---;
glGetShaderInfoLog : (u32, s32, *s32, [*]u8) -> void callconv(.c) = ---;
glGetShaderiv : (u32, u32, *i32) -> void callconv(.c) = ---;
glGetShaderInfoLog : (u32, i32, *i32, [*]u8) -> void callconv(.c) = ---;
glCreateProgram : () -> u32 callconv(.c) = ---;
glAttachShader : (u32, u32) -> void callconv(.c) = ---;
glLinkProgram : (u32) -> void callconv(.c) = ---;
glGetProgramiv : (u32, u32, *s32) -> void callconv(.c) = ---;
glGetProgramInfoLog : (u32, s32, *s32, [*]u8) -> void callconv(.c) = ---;
glGetProgramiv : (u32, u32, *i32) -> void callconv(.c) = ---;
glGetProgramInfoLog : (u32, i32, *i32, [*]u8) -> void callconv(.c) = ---;
glUseProgram : (u32) -> void callconv(.c) = ---;
glDeleteShader : (u32) -> void callconv(.c) = ---;
glGenVertexArrays : (s32, *u32) -> void callconv(.c) = ---;
glGenBuffers : (s32, *u32) -> void callconv(.c) = ---;
glGenVertexArrays : (i32, *u32) -> void callconv(.c) = ---;
glGenBuffers : (i32, *u32) -> void callconv(.c) = ---;
glBindVertexArray : (u32) -> void callconv(.c) = ---;
glBindBuffer : (u32, u32) -> void callconv(.c) = ---;
glBufferData : (u32, isize, *void, u32) -> void callconv(.c) = ---;
glVertexAttribPointer : (u32, s32, u32, u8, s32, *void) -> void callconv(.c) = ---;
glVertexAttribPointer : (u32, i32, u32, u8, i32, *void) -> void callconv(.c) = ---;
glEnableVertexAttribArray : (u32) -> void callconv(.c) = ---;
glGetUniformLocation : (u32, [*]u8) -> s32 callconv(.c) = ---;
glUniformMatrix4fv : (s32, s32, u8, [*]f32) -> void callconv(.c) = ---;
glUniform3f : (s32, f32, f32, f32) -> void callconv(.c) = ---;
glGetUniformLocation : (u32, [*]u8) -> i32 callconv(.c) = ---;
glUniformMatrix4fv : (i32, i32, u8, [*]f32) -> void callconv(.c) = ---;
glUniform3f : (i32, f32, f32, f32) -> void callconv(.c) = ---;
glDepthFunc : (u32) -> void callconv(.c) = ---;
glUniform1f : (s32, f32) -> void callconv(.c) = ---;
glUniform1f : (i32, f32) -> void callconv(.c) = ---;
GL_LESS :u32: 0x0201;
GL_LEQUAL :u32: 0x0203;
GL_SCISSOR_TEST :u32: 0x0C11;
@@ -76,26 +76,26 @@ GL_RED :u32: 0x1903;
GL_R8 :u32: 0x8229;
GL_UNPACK_ALIGNMENT :u32: 0x0CF5;
glScissor : (s32, s32, s32, s32) -> void callconv(.c) = ---;
glScissor : (i32, i32, i32, i32) -> void callconv(.c) = ---;
glBufferSubData : (u32, isize, isize, *void) -> void callconv(.c) = ---;
glGenTextures : (s32, *u32) -> void callconv(.c) = ---;
glGenTextures : (i32, *u32) -> void callconv(.c) = ---;
glBindTexture : (u32, u32) -> void callconv(.c) = ---;
glTexImage2D : (u32, s32, s32, s32, s32, s32, u32, u32, *void) -> void callconv(.c) = ---;
glTexParameteri : (u32, u32, s32) -> void callconv(.c) = ---;
glTexImage2D : (u32, i32, i32, i32, i32, i32, u32, u32, *void) -> void callconv(.c) = ---;
glTexParameteri : (u32, u32, i32) -> void callconv(.c) = ---;
glBlendFunc : (u32, u32) -> void callconv(.c) = ---;
glReadPixels : (s32, s32, s32, s32, u32, u32, *void) -> void callconv(.c) = ---;
glReadPixels : (i32, i32, i32, i32, u32, u32, *void) -> void callconv(.c) = ---;
glActiveTexture : (u32) -> void callconv(.c) = ---;
glUniform1i : (s32, s32) -> void callconv(.c) = ---;
glPixelStorei : (u32, s32) -> void callconv(.c) = ---;
glTexSubImage2D : (u32, s32, s32, s32, s32, s32, u32, u32, *void) -> void callconv(.c) = ---;
glDeleteTextures : (s32, *u32) -> void callconv(.c) = ---;
glUniform1i : (i32, i32) -> void callconv(.c) = ---;
glPixelStorei : (u32, i32) -> void callconv(.c) = ---;
glTexSubImage2D : (u32, i32, i32, i32, i32, i32, u32, u32, *void) -> void callconv(.c) = ---;
glDeleteTextures : (i32, *u32) -> void callconv(.c) = ---;
glGenFramebuffers : (s32, *u32) -> void callconv(.c) = ---;
glGenRenderbuffers : (s32, *u32) -> void callconv(.c) = ---;
glGenFramebuffers : (i32, *u32) -> void callconv(.c) = ---;
glGenRenderbuffers : (i32, *u32) -> void callconv(.c) = ---;
glBindFramebuffer : (u32, u32) -> void callconv(.c) = ---;
glBindRenderbuffer : (u32, u32) -> void callconv(.c) = ---;
glFramebufferRenderbuffer : (u32, u32, u32, u32) -> void callconv(.c) = ---;
glGetRenderbufferParameteriv : (u32, u32, *s32) -> void callconv(.c) = ---;
glGetRenderbufferParameteriv : (u32, u32, *i32) -> void callconv(.c) = ---;
glCheckFramebufferStatus : (u32) -> u32 callconv(.c) = ---;
GL_TEXTURE_WRAP_S :u32: 0x2802;
@@ -173,7 +173,7 @@ create_program :: (vert_src: [:0]u8, frag_src: [:0]u8) -> u32 {
glAttachShader(prog, fs);
glLinkProgram(prog);
status : s32 = 0;
status : i32 = 0;
glGetProgramiv(prog, GL_LINK_STATUS, @status);
if status == GL_FALSE {
log_buf: [512]u8 = ---;
@@ -190,7 +190,7 @@ compile_shader :: (shader_type : u32, source: [:0]u8) -> u32 {
glShaderSource(shader, 1, source, null);
glCompileShader(shader);
status : s32 = 0;
status : i32 = 0;
glGetShaderiv(shader, GL_COMPILE_STATUS, @status);
if status == GL_FALSE {
log_buf : [512]u8 = ---;

View File

@@ -8,7 +8,7 @@ Vector2 :: struct {
x, y: f32;
}
InitWindow :: (width: s32, height: s32, title: [:0]u8) -> void #foreign raylib;
InitWindow :: (width: i32, height: i32, title: [:0]u8) -> void #foreign raylib;
CloseWindow :: () -> void #foreign raylib;
WindowShouldClose :: () -> bool #foreign raylib;
BeginDrawing :: () -> void #foreign raylib;

View File

@@ -9,19 +9,19 @@ SDL_WINDOW_RESIZABLE :u64: 0x20;
SDL_WINDOW_HIGH_PIXEL_DENSITY :u64: 0x2000;
// SDL_GLAttr (enum starting at 0)
SDL_GL_DOUBLEBUFFER :s32: 5;
SDL_GL_DEPTH_SIZE :s32: 6;
SDL_GL_CONTEXT_MAJOR_VERSION :s32: 17;
SDL_GL_CONTEXT_MINOR_VERSION :s32: 18;
SDL_GL_CONTEXT_FLAGS :s32: 19;
SDL_GL_CONTEXT_PROFILE_MASK :s32: 20;
SDL_GL_DOUBLEBUFFER :i32: 5;
SDL_GL_DEPTH_SIZE :i32: 6;
SDL_GL_CONTEXT_MAJOR_VERSION :i32: 17;
SDL_GL_CONTEXT_MINOR_VERSION :i32: 18;
SDL_GL_CONTEXT_FLAGS :i32: 19;
SDL_GL_CONTEXT_PROFILE_MASK :i32: 20;
// SDL_GLProfile
SDL_GL_CONTEXT_PROFILE_CORE :s32: 0x1;
SDL_GL_CONTEXT_PROFILE_ES :s32: 0x4;
SDL_GL_CONTEXT_PROFILE_CORE :i32: 0x1;
SDL_GL_CONTEXT_PROFILE_ES :i32: 0x4;
// SDL_GLContextFlag
SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG :s32: 0x2;
SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG :i32: 0x2;
// SDL_Keycode — virtual key codes (layout-dependent)
SDL_Keycode :: enum u32 {
@@ -220,8 +220,8 @@ SDL_Keycode :: enum u32 {
SDL_WindowData :: struct {
timestamp: u64; // event time in nanoseconds
window_id: u32;
data1: s32; // event-dependent: x position for moved, width for resized
data2: s32; // event-dependent: y position for moved, height for resized
data1: i32; // event-dependent: x position for moved, width for resized
data2: i32; // event-dependent: y position for moved, height for resized
}
SDL_Keymod :: enum flags u16 {
@@ -322,14 +322,14 @@ SDL_Event :: enum struct { tag: u32; _: u32; payload: [30]u32; } {
// Functions
SDL_Init :: (flags: u32) -> bool #foreign;
SDL_Quit :: () -> void #foreign;
SDL_CreateWindow :: (title: [:0]u8, w: s32, h: s32, flags: u64) -> *void #foreign;
SDL_CreateWindow :: (title: [:0]u8, w: i32, h: i32, flags: u64) -> *void #foreign;
SDL_DestroyWindow :: (window: *void) -> void #foreign;
SDL_GL_SetAttribute :: (attr: s32, value: s32) -> bool #foreign;
SDL_GL_SetAttribute :: (attr: i32, value: i32) -> bool #foreign;
SDL_GL_CreateContext :: (window: *void) -> *void #foreign;
SDL_GL_DestroyContext :: (context: *void) -> bool #foreign;
SDL_GL_MakeCurrent :: (window: *void, context: *void) -> bool #foreign;
SDL_GL_SwapWindow :: (window: *void) -> bool #foreign;
SDL_GL_SetSwapInterval :: (interval: s32) -> bool #foreign;
SDL_GL_SetSwapInterval :: (interval: i32) -> bool #foreign;
SDL_GL_GetProcAddress :: (proc: [:0]u8) -> *void #foreign;
SDL_PollEvent :: (event: *SDL_Event) -> bool #foreign;
SDL_AddEventWatch :: (filter: *void, userdata: *void) -> bool #foreign;
@@ -338,15 +338,15 @@ SDL_GetPerformanceCounter :: () -> u64 #foreign;
SDL_GetPerformanceFrequency :: () -> u64 #foreign;
SDL_Delay :: (ms: u32) -> void #foreign;
SDL_GetWindowDisplayScale :: (window: *void) -> f32 #foreign;
SDL_GetWindowSize :: (window: *void, w: *s32, h: *s32) -> bool #foreign;
SDL_SetWindowSize :: (window: *void, w: s32, h: s32) -> bool #foreign;
SDL_GetWindowSizeInPixels :: (window: *void, w: *s32, h: *s32) -> bool #foreign;
SDL_GetWindowSize :: (window: *void, w: *i32, h: *i32) -> bool #foreign;
SDL_SetWindowSize :: (window: *void, w: i32, h: i32) -> bool #foreign;
SDL_GetWindowSizeInPixels :: (window: *void, w: *i32, h: *i32) -> bool #foreign;
SDL_Rect :: struct {
x: s32;
y: s32;
w: s32;
h: s32;
x: i32;
y: i32;
w: i32;
h: i32;
}
SDL_GetPrimaryDisplay :: () -> u32 #foreign;

View File

@@ -1,4 +1,4 @@
libc :: #library "c";
emscripten_set_main_loop :: (func: *void, fps: s32, sim_infinite: s32) #foreign libc;
emscripten_run_script_int :: (script: [:0]u8) -> s32 #foreign libc;
emscripten_set_main_loop :: (func: *void, fps: i32, sim_infinite: i32) #foreign libc;
emscripten_run_script_int :: (script: [:0]u8) -> i32 #foreign libc;