diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-04-21 10:39:13 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-04-21 10:39:13 -0400 |
| commit | e3c524c1d482a845bb2d6555bda386739c862226 (patch) | |
| tree | f787e6def3e09691db95852e1a264eb660585af1 /std | |
| parent | ecb71d1dd34e98fc9813cffa473f83127e6e3d01 (diff) | |
| download | zig-e3c524c1d482a845bb2d6555bda386739c862226.tar.gz zig-e3c524c1d482a845bb2d6555bda386739c862226.zip | |
rename `@ptrcast` to `@ptrCast` to follow convention
Diffstat (limited to 'std')
| -rw-r--r-- | std/buf_map.zig | 2 | ||||
| -rw-r--r-- | std/buf_set.zig | 2 | ||||
| -rw-r--r-- | std/debug.zig | 2 | ||||
| -rw-r--r-- | std/hash_map.zig | 2 | ||||
| -rw-r--r-- | std/os/darwin.zig | 2 | ||||
| -rw-r--r-- | std/os/index.zig | 2 | ||||
| -rw-r--r-- | std/os/linux.zig | 6 | ||||
| -rw-r--r-- | std/special/bootstrap.zig | 6 | ||||
| -rw-r--r-- | std/special/compiler_rt.zig | 24 |
9 files changed, 24 insertions, 24 deletions
diff --git a/std/buf_map.zig b/std/buf_map.zig index 81834c6782..3f7787a7c3 100644 --- a/std/buf_map.zig +++ b/std/buf_map.zig @@ -58,7 +58,7 @@ pub const BufMap = struct { fn free(self: &BufMap, value: []const u8) { // remove the const - const mut_value = @ptrcast(&u8, value.ptr)[0...value.len]; + const mut_value = @ptrCast(&u8, value.ptr)[0...value.len]; self.hash_map.allocator.free(mut_value); } diff --git a/std/buf_set.zig b/std/buf_set.zig index 7c9f0f9058..dfda99e15b 100644 --- a/std/buf_set.zig +++ b/std/buf_set.zig @@ -47,7 +47,7 @@ pub const BufSet = struct { fn free(self: &BufSet, value: []const u8) { // remove the const - const mut_value = @ptrcast(&u8, value.ptr)[0...value.len]; + const mut_value = @ptrCast(&u8, value.ptr)[0...value.len]; self.hash_map.allocator.free(mut_value); } diff --git a/std/debug.zig b/std/debug.zig index 529c459992..a37f8749cf 100644 --- a/std/debug.zig +++ b/std/debug.zig @@ -74,7 +74,7 @@ pub fn writeStackTrace(out_stream: &io.OutStream) -> %void { const name = %return compile_unit.die.getAttrString(st, DW.AT_name); %return out_stream.printf("{} -> {}\n", return_address, name); - maybe_fp = *@ptrcast(&const ?&const u8, fp); + maybe_fp = *@ptrCast(&const ?&const u8, fp); } }, ObjectFormat.coff => { diff --git a/std/hash_map.zig b/std/hash_map.zig index 3e99dde47b..fdb7e65e8f 100644 --- a/std/hash_map.zig +++ b/std/hash_map.zig @@ -250,7 +250,7 @@ test "basicHashMapTest" { } fn hash_i32(x: i32) -> u32 { - *@ptrcast(&u32, &x) + *@ptrCast(&u32, &x) } fn eql_i32(a: i32, b: i32) -> bool { diff --git a/std/os/darwin.zig b/std/os/darwin.zig index 12a4c56167..90e8c3fb0a 100644 --- a/std/os/darwin.zig +++ b/std/os/darwin.zig @@ -59,7 +59,7 @@ pub fn exit(status: usize) -> noreturn { /// Get the errno from a syscall return value, or 0 for no error. pub fn getErrno(r: usize) -> usize { - const signed_r = *@ptrcast(&const isize, &r); + const signed_r = *@ptrCast(&const isize, &r); if (signed_r > -4096 and signed_r < 0) usize(-signed_r) else 0 } diff --git a/std/os/index.zig b/std/os/index.zig index 52e26d9e2b..60e3c9a9b8 100644 --- a/std/os/index.zig +++ b/std/os/index.zig @@ -752,7 +752,7 @@ pub const Dir = struct { break; } } - const linux_entry = @ptrcast(&LinuxEntry, &self.buf[self.index]); + const linux_entry = @ptrCast(&LinuxEntry, &self.buf[self.index]); const next_index = self.index + linux_entry.d_reclen; self.index = next_index; diff --git a/std/os/linux.zig b/std/os/linux.zig index 1ebade3baf..86a37e1b1c 100644 --- a/std/os/linux.zig +++ b/std/os/linux.zig @@ -251,8 +251,8 @@ pub const DT_LNK = 10; pub const DT_SOCK = 12; pub const DT_WHT = 14; -fn unsigned(s: i32) -> u32 { *@ptrcast(&u32, &s) } -fn signed(s: u32) -> i32 { *@ptrcast(&i32, &s) } +fn unsigned(s: i32) -> u32 { *@ptrCast(&u32, &s) } +fn signed(s: u32) -> i32 { *@ptrCast(&i32, &s) } pub fn WEXITSTATUS(s: i32) -> i32 { signed((unsigned(s) & 0xff00) >> 8) } pub fn WTERMSIG(s: i32) -> i32 { signed(unsigned(s) & 0x7f) } pub fn WSTOPSIG(s: i32) -> i32 { WEXITSTATUS(s) } @@ -262,7 +262,7 @@ pub fn WIFSIGNALED(s: i32) -> bool { (unsigned(s)&0xffff)-%1 < 0xff } /// Get the errno from a syscall return value, or 0 for no error. pub fn getErrno(r: usize) -> usize { - const signed_r = *@ptrcast(&const isize, &r); + const signed_r = *@ptrCast(&const isize, &r); if (signed_r > -4096 and signed_r < 0) usize(-signed_r) else 0 } diff --git a/std/special/bootstrap.zig b/std/special/bootstrap.zig index d2a7703144..3fa9bcaf0d 100644 --- a/std/special/bootstrap.zig +++ b/std/special/bootstrap.zig @@ -31,8 +31,8 @@ export nakedcc fn _start() -> noreturn { fn callMainAndExit() -> noreturn { const argc = *argc_ptr; - const argv = @ptrcast(&&u8, &argc_ptr[1]); - const envp = @ptrcast(&?&u8, &argv[argc + 1]); + const argv = @ptrCast(&&u8, &argc_ptr[1]); + const envp = @ptrCast(&?&u8, &argv[argc + 1]); callMain(argc, argv, envp) %% exit(1); exit(0); } @@ -42,7 +42,7 @@ fn callMain(argc: usize, argv: &&u8, envp: &?&u8) -> %void { var env_count: usize = 0; while (envp[env_count] != null; env_count += 1) {} - std.os.environ_raw = @ptrcast(&&u8, envp)[0...env_count]; + std.os.environ_raw = @ptrCast(&&u8, envp)[0...env_count]; return root.main(); } diff --git a/std/special/compiler_rt.zig b/std/special/compiler_rt.zig index 1ad408beb9..1fdec3f157 100644 --- a/std/special/compiler_rt.zig +++ b/std/special/compiler_rt.zig @@ -15,7 +15,7 @@ export fn __udivdi3(a: du_int, b: du_int) -> du_int { fn du_int_to_udwords(x: du_int) -> udwords { @setDebugSafety(this, false); - return *@ptrcast(&udwords, &x); + return *@ptrCast(&udwords, &x); } export fn __udivmoddi4(a: du_int, b: du_int, maybe_rem: ?&du_int) -> du_int { @@ -66,7 +66,7 @@ export fn __udivmoddi4(a: du_int, b: du_int, maybe_rem: ?&du_int) -> du_int { if (var rem ?= maybe_rem) { r[high] = n[high] % d[high]; r[low] = 0; - *rem = *@ptrcast(&du_int, &r[0]); + *rem = *@ptrCast(&du_int, &r[0]); } return n[high] / d[high]; } @@ -78,7 +78,7 @@ export fn __udivmoddi4(a: du_int, b: du_int, maybe_rem: ?&du_int) -> du_int { if (var rem ?= maybe_rem) { r[low] = n[low]; r[high] = n[high] & (d[high] - 1); - *rem = *@ptrcast(&du_int, &r[0]); + *rem = *@ptrCast(&du_int, &r[0]); } return n[high] >> @ctz(d[high]); } @@ -89,7 +89,7 @@ export fn __udivmoddi4(a: du_int, b: du_int, maybe_rem: ?&du_int) -> du_int { // 0 <= sr <= n_uword_bits - 2 or sr large if (sr > n_uword_bits - 2) { if (var rem ?= maybe_rem) { - *rem = *@ptrcast(&du_int, &n[0]); + *rem = *@ptrCast(&du_int, &n[0]); } return 0; } @@ -113,12 +113,12 @@ export fn __udivmoddi4(a: du_int, b: du_int, maybe_rem: ?&du_int) -> du_int { *rem = n[low] & (d[low] - 1); } if (d[low] == 1) { - return *@ptrcast(&du_int, &n[0]); + return *@ptrCast(&du_int, &n[0]); } sr = @ctz(d[low]); q[high] = n[high] >> sr; q[low] = (n[high] << (n_uword_bits - sr)) | (n[low] >> sr); - return *@ptrcast(&du_int, &q[0]); + return *@ptrCast(&du_int, &q[0]); } // K X // --- @@ -154,7 +154,7 @@ export fn __udivmoddi4(a: du_int, b: du_int, maybe_rem: ?&du_int) -> du_int { // 0 <= sr <= n_uword_bits - 1 or sr large if (sr > n_uword_bits - 1) { if (var rem ?= maybe_rem) { - *rem = *@ptrcast(&du_int, &n[0]); + *rem = *@ptrCast(&du_int, &n[0]); } return 0; } @@ -191,17 +191,17 @@ export fn __udivmoddi4(a: du_int, b: du_int, maybe_rem: ?&du_int) -> du_int { // r.all -= d.all; // carry = 1; // } - const s: di_int = (di_int)(*@ptrcast(&du_int, &d[0]) - *@ptrcast(&du_int, &r[0]) - 1) >> (n_udword_bits - 1); + const s: di_int = (di_int)(*@ptrCast(&du_int, &d[0]) - *@ptrCast(&du_int, &r[0]) - 1) >> (n_udword_bits - 1); carry = su_int(s & 1); - *@ptrcast(&du_int, &r[0]) -= *@ptrcast(&du_int, &d[0]) & u64(s); + *@ptrCast(&du_int, &r[0]) -= *@ptrCast(&du_int, &d[0]) & u64(s); sr -= 1; } - *@ptrcast(&du_int, &q[0]) = (*@ptrcast(&du_int, &q[0]) << 1) | u64(carry); + *@ptrCast(&du_int, &q[0]) = (*@ptrCast(&du_int, &q[0]) << 1) | u64(carry); if (var rem ?= maybe_rem) { - *rem = *@ptrcast(&du_int, &r[0]); + *rem = *@ptrCast(&du_int, &r[0]); } - return *@ptrcast(&du_int, &q[0]); + return *@ptrCast(&du_int, &q[0]); } export fn __umoddi3(a: du_int, b: du_int) -> du_int { |
