Skip to content

Commit ee220a8

Browse files
committed
sat-arithmetic: fixups zig fmt / astcheck
1 parent 1659b97 commit ee220a8

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

lib/std/zig/tokenizer.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,9 +1999,9 @@ test "tokenizer - invalid builtin identifiers" {
19991999
}
20002000

20012001
test "tokenizer - saturating" {
2002-
try testTokenize("<<", &.{ .angle_bracket_angle_bracket_left });
2003-
try testTokenize("<<|", &.{ .angle_bracket_angle_bracket_left_pipe });
2004-
try testTokenize("<<|=", &.{ .angle_bracket_angle_bracket_left_pipe_equal });
2002+
try testTokenize("<<", &.{.angle_bracket_angle_bracket_left});
2003+
try testTokenize("<<|", &.{.angle_bracket_angle_bracket_left_pipe});
2004+
try testTokenize("<<|=", &.{.angle_bracket_angle_bracket_left_pipe_equal});
20052005
}
20062006

20072007
fn testTokenize(source: [:0]const u8, expected_tokens: []const Token.Tag) !void {

src/AstGen.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2746,7 +2746,7 @@ fn assignShift(
27462746
fn assignShiftSat(
27472747
gz: *GenZir,
27482748
scope: *Scope,
2749-
infix_node: ast.Node.Index,
2749+
infix_node: Ast.Node.Index,
27502750
op_inst_tag: Zir.Inst.Tag,
27512751
) InnerError!void {
27522752
try emitDbgNode(gz, infix_node);

src/codegen/c.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,12 +1269,12 @@ fn airSatOp(
12691269
const int_info = inst_ty.intInfo(o.dg.module.getTarget());
12701270
const bits = int_info.bits;
12711271

1272-
// if it's an unsigned int with non-arbitrary bit size then we can just add
1273-
const ok_bits = switch (bits) {
1274-
8, 16, 32, 64, 128 => true,
1275-
else => false,
1276-
};
1272+
switch (bits) {
1273+
8, 16, 32, 64, 128 => {},
1274+
else => return o.dg.fail("TODO: C backend: airSatOp for non power of 2 integers", .{}),
1275+
}
12771276

1277+
// if it's an unsigned int with non-arbitrary bit size then we can just add
12781278
if (bits > 64) {
12791279
return o.dg.fail("TODO: C backend: airSatOp for large integers", .{});
12801280
}

0 commit comments

Comments
 (0)