From ac867cc45f8e99297647bd29ddfa746462500b72 Mon Sep 17 00:00:00 2001 From: Josh Wolfe Date: Fri, 3 Jan 2020 20:55:47 -0700 Subject: [PATCH] fix tests --- test/translate_c.zig | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/translate_c.zig b/test/translate_c.zig index 0299da7b7e..556d498fb8 100644 --- 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.*; \\ })); \\}