lang migration: rename signed integer types sN -> iN
Mechanical sweep of all .sx sources, plan docs, and tests/expected snapshots for the sx language rename (s8/s16/s32/s64 -> i8/i16/i32/i64). Verified: tools/run_tests.sh 23/23. Note: the ios-sim build has 2 pre-existing 'restart' dot-call errors from the sx opt-in UFCS change (sx a47ea14) — independent of this rename (present pre-sweep); migrated in the follow-up commit.
This commit is contained in:
@@ -14,19 +14,19 @@
|
||||
#import "board.sx";
|
||||
#import "board_layout.sx";
|
||||
|
||||
main :: () -> s32 {
|
||||
main :: () -> i32 {
|
||||
// 800×600 with no safe inset → a 600px square grid, cell 75, centered: the
|
||||
// grid origin lands at (100, 0). Integer math keeps the dump deterministic.
|
||||
lay : BoardLayout = ---;
|
||||
lay.compute(Frame.make(0.0, 0.0, 800.0, 600.0), EdgeInsets.zero());
|
||||
|
||||
print("grid origin ({},{}) cell {}\n",
|
||||
cast(s64) lay.origin.x, cast(s64) lay.origin.y, cast(s64) lay.cell_size);
|
||||
cast(i64) lay.origin.x, cast(i64) lay.origin.y, cast(i64) lay.cell_size);
|
||||
|
||||
fails : s64 = 0;
|
||||
fails : i64 = 0;
|
||||
|
||||
// Every cell center must map back to its own cell.
|
||||
hits : s64 = 0;
|
||||
hits : i64 = 0;
|
||||
for 0..BOARD_ROWS (row) {
|
||||
for 0..BOARD_COLS (col) {
|
||||
cf := lay.cell_frame(col, row);
|
||||
@@ -42,8 +42,8 @@ main :: () -> s32 {
|
||||
// A cell's top-left corner belongs to that cell (the leading edge is
|
||||
// inclusive), so corner-of-(3,5) resolves to (3,5).
|
||||
corner := Point.{ x = lay.origin.x + 3.0 * lay.cell_size, y = lay.origin.y + 5.0 * lay.cell_size };
|
||||
corner_col : s64 = -1;
|
||||
corner_row : s64 = -1;
|
||||
corner_col : i64 = -1;
|
||||
corner_row : i64 = -1;
|
||||
if h := lay.point_to_cell(corner) { corner_col = h.col; corner_row = h.row; }
|
||||
if corner_col != 3 or corner_row != 5 { fails += 1; }
|
||||
print("corner maps to ({},{})\n", corner_col, corner_row);
|
||||
@@ -53,7 +53,7 @@ main :: () -> s32 {
|
||||
off_left := Point.{ x = lay.origin.x - 5.0, y = lay.origin.y + 10.0 };
|
||||
off_above := Point.{ x = lay.origin.x + 10.0, y = lay.origin.y - 5.0 };
|
||||
off_right := Point.{ x = lay.origin.x + 8.0 * lay.cell_size + 1.0, y = lay.origin.y + 10.0 };
|
||||
on_board : s64 = 0;
|
||||
on_board : i64 = 0;
|
||||
if h := lay.point_to_cell(off_left) { on_board += 1; print("off_left hit ({},{})\n", h.col, h.row); }
|
||||
if h := lay.point_to_cell(off_above) { on_board += 1; print("off_above hit ({},{})\n", h.col, h.row); }
|
||||
if h := lay.point_to_cell(off_right) { on_board += 1; print("off_right hit ({},{})\n", h.col, h.row); }
|
||||
|
||||
Reference in New Issue
Block a user