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:
@@ -21,12 +21,12 @@ libc :: #library "c";
|
||||
// ── Low-level libc bindings ─────────────────────────────────────────
|
||||
|
||||
popen :: (cmd: [:0]u8, mode: [:0]u8) -> *void #foreign libc;
|
||||
pclose :: (stream: *void) -> s32 #foreign libc;
|
||||
pclose :: (stream: *void) -> i32 #foreign libc;
|
||||
fread :: (ptr: [*]u8, size: usize, nmemb: usize, stream: *void) -> usize #foreign libc;
|
||||
feof :: (stream: *void) -> s32 #foreign libc;
|
||||
feof :: (stream: *void) -> i32 #foreign libc;
|
||||
getenv :: (name: [:0]u8) -> *u8 #foreign libc;
|
||||
strlen :: (s: *u8) -> usize #foreign libc;
|
||||
system :: (cmd: [:0]u8) -> s32 #foreign libc;
|
||||
system :: (cmd: [:0]u8) -> i32 #foreign libc;
|
||||
|
||||
// ── Public types ─────────────────────────────────────────────────────
|
||||
|
||||
@@ -34,7 +34,7 @@ ProcessResult :: struct {
|
||||
/// Exit code as reported by `WEXITSTATUS(status)`. 0 = success.
|
||||
/// Note: doesn't distinguish "killed by signal" from "exited
|
||||
/// non-zero"; phase 1B will return a tagged union.
|
||||
exit_code: s32;
|
||||
exit_code: i32;
|
||||
stdout: string;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ ProcessResult :: struct {
|
||||
// with stdout, append " 2>&1" to the command.
|
||||
run :: (cmd: [:0]u8) -> ?ProcessResult {
|
||||
f := popen(cmd, "r");
|
||||
if cast(s64) f == 0 { return null; }
|
||||
if cast(i64) f == 0 { return null; }
|
||||
|
||||
out := "";
|
||||
buf := cstring(4096);
|
||||
@@ -61,7 +61,7 @@ run :: (cmd: [:0]u8) -> ?ProcessResult {
|
||||
if n > 0 {
|
||||
chunk : string = ---;
|
||||
chunk.ptr = buf.ptr;
|
||||
chunk.len = cast(s64) n;
|
||||
chunk.len = cast(i64) n;
|
||||
out = concat(out, chunk);
|
||||
}
|
||||
}
|
||||
@@ -85,12 +85,12 @@ run :: (cmd: [:0]u8) -> ?ProcessResult {
|
||||
// string if set to "".
|
||||
env :: (name: [:0]u8) -> ?string {
|
||||
p := getenv(name);
|
||||
addr : s64 = xx p;
|
||||
addr : i64 = xx p;
|
||||
if addr == 0 { return null; }
|
||||
n := strlen(p);
|
||||
if n == 0 { return ""; }
|
||||
buf := cstring(cast(s64) n);
|
||||
memcpy(buf.ptr, xx p, cast(s64) n);
|
||||
buf := cstring(cast(i64) n);
|
||||
memcpy(buf.ptr, xx p, cast(i64) n);
|
||||
buf
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ find_executable :: (name: [:0]u8) -> ?string {
|
||||
// via `write(2)`, so skipping the stdio flush loses nothing. Binding the
|
||||
// symbol `"exit"` would also collide with this module's own `exit` function
|
||||
// at the link level.
|
||||
clib_exit :: (code: s32) -> noreturn #foreign libc "_exit";
|
||||
clib_exit :: (code: i32) -> noreturn #foreign libc "_exit";
|
||||
|
||||
// Stop the process immediately with exit code `code`. Does NOT unwind:
|
||||
// no `defer` / `onfail` cleanup runs, no error-trace frames are pushed —
|
||||
|
||||
Reference in New Issue
Block a user