authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-05-07 12:26:02-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2019-05-07 12:26:02-04:00
log097a62555e39e44ed403b73350c87e20c9753532
treea048e330f3559acead465c520be7ea14afae16c5
parent7432fb04d6e3c52b40e81911d6c608e4d17317df
parent4ab7b459dfea45d1dbdfe301eeb840eaa796a4e7
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #2439 from LemonBoy/fixes-fixes-fixes

A batch of miscellaneous fixes

7 files changed, 17 insertions(+), 15 deletions(-)

std/io.zig+1-1
......@@ -290,7 +290,7 @@ pub fn readFileAllocAligned(allocator: *mem.Allocator, path: []const u8, comptim
290290 var file = try File.openRead(path);
291291 defer file.close();
292292
293 const size = try file.getEndPos();
293 const size = try math.cast(usize, try file.getEndPos());
294294 const buf = try allocator.alignedAlloc(u8, A, size);
295295 errdefer allocator.free(buf);
296296
std/os/linux.zig+7-5
......@@ -1392,17 +1392,19 @@ pub fn sched_getaffinity(pid: i32, set: []usize) usize {
13921392 return syscall3(SYS_sched_getaffinity, @bitCast(usize, isize(pid)), set.len * @sizeOf(usize), @ptrToInt(set.ptr));
13931393}
13941394
1395pub const epoll_data = packed union {
1395pub const epoll_data = extern union {
13961396 ptr: usize,
13971397 fd: i32,
13981398 @"u32": u32,
13991399 @"u64": u64,
14001400};
14011401
1402pub const epoll_event = packed struct {
1403 events: u32,
1404 data: epoll_data,
1405};
1402// On x86_64 the structure is packed so that it matches the definition of its
1403// 32bit counterpart
1404pub const epoll_event = if (builtin.arch != .x86_64)
1405 extern struct { events: u32, data: epoll_data }
1406 else
1407 packed struct { events: u32, data: epoll_data };
14061408
14071409pub fn epoll_create() usize {
14081410 return epoll_create1(0);
std/special/compiler_rt/addXf3.zig+2-2
......@@ -78,8 +78,8 @@ fn addXf3(comptime T: type, a: T, b: T) T {
7878 const infRep = @bitCast(Z, std.math.inf(T));
7979
8080 // Detect if a or b is zero, infinity, or NaN.
81 if (aAbs - Z(1) >= infRep - Z(1) or
82 bAbs - Z(1) >= infRep - Z(1))
81 if (aAbs -% Z(1) >= infRep - Z(1) or
82 bAbs -% Z(1) >= infRep - Z(1))
8383 {
8484 // NaN + anything = qNaN
8585 if (aAbs > infRep) return @bitCast(T, @bitCast(Z, a) | quietBit);
std/special/compiler_rt/arm/aeabi_dcmp.zig+1-1
......@@ -87,7 +87,7 @@ inline fn aeabi_dcmp(comptime cond: ConditionalOperator) void {
8787 .Ge => asm volatile (
8888 \\ bl __ltdf2
8989 \\ cmp r0, #0
90 \\ blt 1f
90 \\ bge 1f
9191 \\ movs r0, #0
9292 \\ pop { r4, pc }
9393 \\ 1:
std/special/compiler_rt/arm/aeabi_fcmp.zig+1-1
......@@ -87,7 +87,7 @@ inline fn aeabi_fcmp(comptime cond: ConditionalOperator) void {
8787 .Ge => asm volatile (
8888 \\ bl __ltsf2
8989 \\ cmp r0, #0
90 \\ blt 1f
90 \\ bge 1f
9191 \\ movs r0, #0
9292 \\ pop { r4, pc }
9393 \\ 1:
std/special/compiler_rt/extendXfYf2.zig+4-4
......@@ -3,20 +3,20 @@ const builtin = @import("builtin");
33const is_test = builtin.is_test;
44
55pub extern fn __extenddftf2(a: f64) f128 {
6 return extendXfYf2(f128, f64, a);
6 return extendXfYf2(f128, f64, @bitCast(u64, a));
77}
88
99pub extern fn __extendsftf2(a: f32) f128 {
10 return extendXfYf2(f128, f32, a);
10 return extendXfYf2(f128, f32, @bitCast(u32, a));
1111}
1212
1313pub extern fn __extendhfsf2(a: u16) f32 {
14 return extendXfYf2(f32, f16, @bitCast(f16, a));
14 return extendXfYf2(f32, f16, a);
1515}
1616
1717const CHAR_BIT = 8;
1818
19inline fn extendXfYf2(comptime dst_t: type, comptime src_t: type, a: src_t) dst_t {
19inline fn extendXfYf2(comptime dst_t: type, comptime src_t: type, a: @IntType(false, @typeInfo(src_t).Float.bits)) dst_t {
2020 const src_rep_t = @IntType(false, @typeInfo(src_t).Float.bits);
2121 const dst_rep_t = @IntType(false, @typeInfo(dst_t).Float.bits);
2222 const srcSigBits = std.math.floatMantissaBits(src_t);
std/zig/render.zig+1-1
......@@ -748,7 +748,7 @@ fn renderExpression(
748748 counting_stream.bytes_written = 0;
749749 var dummy_col: usize = 0;
750750 try renderExpression(allocator, &counting_stream.stream, tree, 0, &dummy_col, expr.*, Space.None);
751 const width = counting_stream.bytes_written;
751 const width = @intCast(usize, counting_stream.bytes_written);
752752 const col = i % row_size;
753753 column_widths[col] = std.math.max(column_widths[col], width);
754754 expr_widths[i] = width;