zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit ac867cc45f8e99297647bd29ddfa746462500b72 (tree)
parent 7838031b436fa403c628af46f62c7eb914808fd7
Author: Josh Wolfe <thejoshwolfe@gmail.com>
Date:   Fri,  3 Jan 2020 20:55:47 -0700

fix tests

Diffstat:
Mtest/translate_c.zig | 22+++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/test/translate_c.zig b/test/translate_c.zig @@ -814,7 +814,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { \\} , &[_][]const u8{ \\pub export fn foo() c_int { - \\ return (@as(c_int, 1) << @as(@import("std").math.Log2Int(c_int), 2)) >> @as(@import("std").math.Log2Int(c_int), 1); + \\ return (@as(c_int, 1) << @intCast(@import("std").math.Log2Int(c_int), 2)) >> @intCast(@import("std").math.Log2Int(c_int), 1); \\} }); @@ -1980,7 +1980,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { \\ var a = arg_a; \\ var i: c_int = 0; \\ while (a > @bitCast(c_uint, @as(c_int, 0))) { - \\ a >>= @as(@import("std").math.Log2Int(c_int), 1); + \\ a >>= @intCast(@import("std").math.Log2Int(c_int), 1); \\ } \\ return i; \\} @@ -2000,7 +2000,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { \\ var a = arg_a; \\ var i: c_int = 0; \\ while (a > @bitCast(c_uint, @as(c_int, 0))) { - \\ a >>= @as(@import("std").math.Log2Int(c_int), 1); + \\ a >>= @intCast(@import("std").math.Log2Int(c_int), 1); \\ } \\ return i; \\} @@ -2051,14 +2051,14 @@ pub fn addCases(cases: *tests.TranslateCContext) void { \\ ref.* = ref.* ^ @as(c_int, 1); \\ break :blk ref.*; \\ }); - \\ a >>= @as(@import("std").math.Log2Int(c_int), (blk: { + \\ a >>= @intCast(@import("std").math.Log2Int(c_int), (blk: { \\ const ref = &a; - \\ ref.* = ref.* >> @as(@import("std").math.Log2Int(c_int), @as(c_int, 1)); + \\ ref.* = ref.* >> @intCast(@import("std").math.Log2Int(c_int), @as(c_int, 1)); \\ break :blk ref.*; \\ })); - \\ a <<= @as(@import("std").math.Log2Int(c_int), (blk: { + \\ a <<= @intCast(@import("std").math.Log2Int(c_int), (blk: { \\ const ref = &a; - \\ ref.* = ref.* << @as(@import("std").math.Log2Int(c_int), @as(c_int, 1)); + \\ ref.* = ref.* << @intCast(@import("std").math.Log2Int(c_int), @as(c_int, 1)); \\ break :blk ref.*; \\ })); \\} @@ -2109,14 +2109,14 @@ pub fn addCases(cases: *tests.TranslateCContext) void { \\ ref.* = ref.* ^ @bitCast(c_uint, @as(c_int, 1)); \\ break :blk ref.*; \\ }); - \\ a >>= @as(@import("std").math.Log2Int(c_uint), (blk: { + \\ a >>= @intCast(@import("std").math.Log2Int(c_uint), (blk: { \\ const ref = &a; - \\ ref.* = ref.* >> @as(@import("std").math.Log2Int(c_int), @as(c_int, 1)); + \\ ref.* = ref.* >> @intCast(@import("std").math.Log2Int(c_int), @as(c_int, 1)); \\ break :blk ref.*; \\ })); - \\ a <<= @as(@import("std").math.Log2Int(c_uint), (blk: { + \\ a <<= @intCast(@import("std").math.Log2Int(c_uint), (blk: { \\ const ref = &a; - \\ ref.* = ref.* << @as(@import("std").math.Log2Int(c_int), @as(c_int, 1)); + \\ ref.* = ref.* << @intCast(@import("std").math.Log2Int(c_int), @as(c_int, 1)); \\ break :blk ref.*; \\ })); \\}