aboutsummaryrefslogtreecommitdiff
path: root/src/std
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-04-08 13:26:33 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-04-08 13:26:33 +0200
commitd7e5728e831f2bc9424227c84be477c554c97aa8 (patch)
treec18de092ba6ce5823b775a56977c8e1e69988bb9 /src/std
parentcf534d762754860ed5b714974f99acd282d48b3b (diff)
Switch from pyright to ty
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'src/std')
-rw-r--r--src/std/test_vec.c6
-rw-r--r--src/std/time.c11
2 files changed, 8 insertions, 9 deletions
diff --git a/src/std/test_vec.c b/src/std/test_vec.c
index e95a1b6..451b965 100644
--- a/src/std/test_vec.c
+++ b/src/std/test_vec.c
@@ -34,7 +34,8 @@ i32 test_vec_push() {
Vec v = Vec_new(&perm, i32, 4);
i32 vals[] = {10, 20, 30};
- for (i32 i = 0; i < 3; i++) Vec_push(&perm, &v, &vals[i]);
+ for (i32 i = 0; i < 3; i++)
+ Vec_push(&perm, &v, &vals[i]);
t_assert_equal(v.len, 3);
t_assert_equal(*Vec_get(v, i32, 0), 10);
@@ -49,7 +50,8 @@ i32 test_vec_grow() {
Arena perm = Arena_new(128e3);
Vec v = Vec_new(&perm, i32, 2);
- for (i32 i = 0; i < 8; i++) Vec_push(&perm, &v, &i);
+ for (i32 i = 0; i < 8; i++)
+ Vec_push(&perm, &v, &i);
t_assert_equal(v.len, 8);
t_assert_equal(Arena_get_used(perm), sizeof(i32) * (2 + 4 + 8));
diff --git a/src/std/time.c b/src/std/time.c
index 331f1d5..7a14f06 100644
--- a/src/std/time.c
+++ b/src/std/time.c
@@ -6,13 +6,12 @@
Time Time_get() {
struct timespec system_time;
- assert(clock_gettime(CLOCK_MONOTONIC, &system_time) == 0, "clock_gettime failed");
+ assert(clock_gettime(CLOCK_MONOTONIC, &system_time) == 0,
+ "clock_gettime failed");
return (Time){system_time.tv_sec, system_time.tv_nsec};
}
-f32 Time_ms(Time time) {
- return time.s * 1e3 + time.ns / 1e6;
-}
+f32 Time_ms(Time time) { return time.s * 1e3 + time.ns / 1e6; }
Duration Time_diff(Time end, Time start) {
Duration d;
@@ -25,9 +24,7 @@ Duration Time_diff(Time end, Time start) {
return d;
}
-f32 Duration_ms(Duration d) {
- return d.s * 1e3 + d.ns / 1e6;
-}
+f32 Duration_ms(Duration d) { return d.s * 1e3 + d.ns / 1e6; }
Duration Duration_from_ms(f32 ms) {
Duration d;