@@ -11,7 +11,7 @@ pub extern fn emscripten_sleep(ms: u32) void;
1111pub const MainLoopCallback = * const fn () callconv (.c ) void ;
1212extern fn emscripten_set_main_loop (MainLoopCallback , c_int , c_int ) void ;
1313pub fn setMainLoop (cb : MainLoopCallback , maybe_fps : ? i16 , simulate_infinite_loop : bool ) void {
14- emscripten_set_main_loop (cb , if ( maybe_fps ) | fps | fps else -1 , @intFromBool (simulate_infinite_loop ));
14+ emscripten_set_main_loop (cb , maybe_fps orelse -1 , @intFromBool (simulate_infinite_loop ));
1515}
1616
1717extern fn emscripten_cancel_main_loop () void ;
@@ -22,7 +22,7 @@ pub fn cancelMainLoop() void {
2222pub const MainLoopArgCallback = * const fn (arg : * anyopaque ) callconv (.c ) void ;
2323extern fn emscripten_set_main_loop_arg (MainLoopArgCallback , arg : * anyopaque , c_int , c_int ) void ;
2424pub fn setMainLoopArg (cb : MainLoopArgCallback , arg : * anyopaque , maybe_fps : ? i16 , simulate_infinite_loop : bool ) void {
25- emscripten_set_main_loop_arg (cb , arg , if ( maybe_fps ) | fps | fps else -1 , @intFromBool (simulate_infinite_loop ));
25+ emscripten_set_main_loop_arg (cb , arg , maybe_fps orelse -1 , @intFromBool (simulate_infinite_loop ));
2626}
2727
2828pub const AnimationFrameCallback = * const fn (f64 , ? * anyopaque ) callconv (.c ) c_int ;
@@ -111,9 +111,9 @@ pub const EmmallocAllocator = struct {
111111 ) ? [* ]u8 {
112112 _ = ctx ;
113113 _ = return_address ;
114- const ptr_align : u32 = @as (u32 , 1 ) << @as ( u5 , @intFromEnum (ptr_align_log2 ));
114+ const ptr_align : u32 = @as (u32 , 1 ) << @intCast ( @intFromEnum (ptr_align_log2 ));
115115 if (! std .math .isPowerOfTwo (ptr_align )) unreachable ;
116- const ptr = emmalloc_memalign (ptr_align , len ) orelse return null ;
116+ const ptr = emmalloc_memalign (ptr_align , @intCast ( len ) ) orelse return null ;
117117 return @ptrCast (ptr );
118118 }
119119
@@ -127,7 +127,7 @@ pub const EmmallocAllocator = struct {
127127 _ = ctx ;
128128 _ = return_address ;
129129 _ = buf_align_log2 ;
130- return emmalloc_realloc_try (buf .ptr , new_len ) != null ;
130+ return emmalloc_realloc_try (buf .ptr , @intCast ( new_len ) ) != null ;
131131 }
132132
133133 fn remap (
0 commit comments