authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-05-29 18:55:42-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-05-29 19:09:58-04:00
logbfc86776d501dc317737be09e8ed8d13da18f67c
tree805594b08d7b54b1e742034ee594a05725a0d9ef
parent8a4ee5942b996d2ffe9c61d7d73fe10f8b1ecea4
signaturelock-open Commit is signed but in an unrecognized format.

run zig fmt to update `use` to `usingnamespace`


39 files changed, 32 insertions(+), 44 deletions(-)

src-self-hosted/c.zig+1-1
......@@ -1,4 +1,4 @@
1pub use @cImport({
1pub usingnamespace @cImport({
22 @cDefine("__STDC_CONSTANT_MACROS", "");
33 @cDefine("__STDC_LIMIT_MACROS", "");
44 @cInclude("inttypes.h");
src-self-hosted/translate_c.zig+1-1
......@@ -6,7 +6,7 @@ const builtin = @import("builtin");
66const assert = std.debug.assert;
77const ast = std.zig.ast;
88const Token = std.zig.Token;
9use @import("clang.zig");
9usingnamespace @import("clang.zig");
1010
1111pub const Mode = enum {
1212 import,
std/c.zig+2-2
......@@ -2,9 +2,9 @@ const builtin = @import("builtin");
22const std = @import("std");
33const page_size = std.mem.page_size;
44
5pub use @import("os/bits.zig");
5pub usingnamespace @import("os/bits.zig");
66
7pub use switch (builtin.os) {
7pub usingnamespace switch (builtin.os) {
88 .linux => @import("c/linux.zig"),
99 .windows => @import("c/windows.zig"),
1010 .macosx, .ios, .tvos, .watchos => @import("c/darwin.zig"),
std/c/darwin.zig+1-1
......@@ -3,7 +3,7 @@ const assert = std.debug.assert;
33const builtin = @import("builtin");
44const macho = std.macho;
55
6use @import("../os/bits.zig");
6usingnamespace @import("../os/bits.zig");
77
88extern "c" fn __error() *c_int;
99pub extern "c" fn _NSGetExecutablePath(buf: [*]u8, bufsize: *u32) c_int;
std/c/linux.zig+1-1
......@@ -1,5 +1,5 @@
11const std = @import("../std.zig");
2use std.c;
2usingnamespace std.c;
33
44extern "c" fn __errno_location() *c_int;
55pub const _errno = __errno_location;
std/math/big.zig+2-2
......@@ -1,5 +1,5 @@
1pub use @import("big/int.zig");
2pub use @import("big/rational.zig");
1pub usingnamespace @import("big/int.zig");
2pub usingnamespace @import("big/rational.zig");
33
44test "math.big" {
55 _ = @import("big/int.zig");
std/os.zig+1-1
......@@ -46,7 +46,7 @@ pub const system = if (builtin.link_libc) std.c else switch (builtin.os) {
4646 else => struct {},
4747};
4848
49pub use @import("os/bits.zig");
49pub usingnamespace @import("os/bits.zig");
5050
5151/// See also `getenv`. Populated by startup code before main().
5252pub var environ: [][*]u8 = undefined;
std/os/bits.zig+1-1
......@@ -3,7 +3,7 @@
33
44const builtin = @import("builtin");
55
6pub use switch (builtin.os) {
6pub usingnamespace switch (builtin.os) {
77 .macosx, .ios, .tvos, .watchos => @import("bits/darwin.zig"),
88 .freebsd => @import("bits/freebsd.zig"),
99 .linux => @import("bits/linux.zig"),
std/os/bits/linux.zig+3-3
......@@ -1,10 +1,10 @@
11const builtin = @import("builtin");
22const std = @import("../../std.zig");
33const maxInt = std.math.maxInt;
4use @import("../bits.zig");
4usingnamespace @import("../bits.zig");
55
6pub use @import("linux/errno.zig");
7pub use switch (builtin.arch) {
6pub usingnamespace @import("linux/errno.zig");
7pub usingnamespace switch (builtin.arch) {
88 .x86_64 => @import("linux/x86_64.zig"),
99 .aarch64 => @import("linux/arm64.zig"),
1010 else => struct {},
std/os/bits/windows.zig+1-1
......@@ -1,6 +1,6 @@
11// The reference for these types and values is Microsoft Windows's ucrt (Universal C RunTime).
22
3use @import("../windows/bits.zig");
3usingnamespace @import("../windows/bits.zig");
44
55pub const fd_t = HANDLE;
66pub const pid_t = HANDLE;
std/os/darwin.zig+1-1
......@@ -4,4 +4,4 @@ pub const is_the_target = switch (builtin.os) {
44 .macosx, .tvos, .watchos, .ios => true,
55 else => false,
66};
7pub use std.c;
7pub usingnamespace std.c;
std/os/freebsd.zig+1-1
......@@ -1,4 +1,4 @@
11const std = @import("../std.zig");
22const builtin = @import("builtin");
33pub const is_the_target = builtin.os == .freebsd;
4pub use std.c;
4pub usingnamespace std.c;
std/os/linux.zig+2-2
......@@ -14,12 +14,12 @@ const vdso = @import("linux/vdso.zig");
1414const dl = @import("../dynamic_library.zig");
1515
1616pub const is_the_target = builtin.os == .linux;
17pub use switch (builtin.arch) {
17pub usingnamespace switch (builtin.arch) {
1818 .x86_64 => @import("linux/x86_64.zig"),
1919 .aarch64 => @import("linux/arm64.zig"),
2020 else => struct {},
2121};
22pub use @import("bits.zig");
22pub usingnamespace @import("bits.zig");
2323pub const tls = @import("linux/tls.zig");
2424
2525/// Set by startup code, used by `getauxval`.
std/os/linux/x86_64.zig+1-1
......@@ -1,4 +1,4 @@
1use @import("../bits.zig");
1usingnamespace @import("../bits.zig");
22
33pub fn syscall0(number: usize) usize {
44 return asm volatile ("syscall"
std/os/netbsd.zig+1-1
......@@ -1,4 +1,4 @@
11const builtin = @import("builtin");
22const std = @import("../std.zig");
33pub const is_the_target = builtin.os == .netbsd;
4pub use std.c;
4pub usingnamespace std.c;
std/os/wasi.zig+1-1
......@@ -5,7 +5,7 @@ const std = @import("std");
55const assert = std.debug.assert;
66
77pub const is_the_target = builtin.os == .wasi;
8pub use @import("bits.zig");
8pub usingnamespace @import("bits.zig");
99
1010comptime {
1111 assert(@alignOf(i8) == 1);
std/os/windows.zig+1-1
......@@ -18,7 +18,7 @@ pub const ntdll = @import("windows/ntdll.zig");
1818pub const ole32 = @import("windows/ole32.zig");
1919pub const shell32 = @import("windows/shell32.zig");
2020
21pub use @import("windows/bits.zig");
21pub usingnamespace @import("windows/bits.zig");
2222
2323pub const CreateFileError = error{
2424 SharingViolation,
std/os/windows/advapi32.zig+1-1
......@@ -1,4 +1,4 @@
1use @import("bits.zig");
1usingnamespace @import("bits.zig");
22
33pub extern "advapi32" stdcallcc fn RegOpenKeyExW(
44 hKey: HKEY,
std/os/windows/kernel32.zig+1-1
......@@ -1,4 +1,4 @@
1use @import("bits.zig");
1usingnamespace @import("bits.zig");
22
33pub extern "kernel32" stdcallcc fn CancelIoEx(hFile: HANDLE, lpOverlapped: LPOVERLAPPED) BOOL;
44
std/os/windows/ntdll.zig+1-1
......@@ -1,3 +1,3 @@
1use @import("bits.zig");
1usingnamespace @import("bits.zig");
22
33pub extern "NtDll" stdcallcc fn RtlCaptureStackBackTrace(FramesToSkip: DWORD, FramesToCapture: DWORD, BackTrace: **c_void, BackTraceHash: ?*DWORD) WORD;
std/os/windows/ole32.zig+1-1
......@@ -1,4 +1,4 @@
1use @import("bits.zig");
1usingnamespace @import("bits.zig");
22
33pub extern "ole32" stdcallcc fn CoTaskMemFree(pv: LPVOID) void;
44pub extern "ole32" stdcallcc fn CoUninitialize() void;
std/os/windows/shell32.zig+1-1
......@@ -1,3 +1,3 @@
1use @import("bits.zig");
1usingnamespace @import("bits.zig");
22
33pub extern "shell32" stdcallcc fn SHGetKnownFolderPath(rfid: *const KNOWNFOLDERID, dwFlags: DWORD, hToken: ?HANDLE, ppszPath: *[*]WCHAR) HRESULT;
std/os/zen.zig+1-1
......@@ -80,7 +80,7 @@ pub const STDOUT_FILENO = 1;
8080pub const STDERR_FILENO = 2;
8181
8282// FIXME: let's borrow Linux's error numbers for now.
83use @import("bits/linux/errno.zig");
83usingnamespace @import("bits/linux/errno.zig");
8484// Get the errno from a syscall return value, or 0 for no error.
8585pub fn getErrno(r: usize) usize {
8686 const signed_r = @bitCast(isize, r);
test/stage1/behavior/alignof.zig-1
......@@ -15,4 +15,3 @@ test "@alignOf(T) before referencing T" {
1515 comptime expect(@alignOf(Foo) == 4);
1616 }
1717}
18
test/stage1/behavior/bugs/1076.zig-1
......@@ -13,4 +13,3 @@ fn testCastPtrOfArrayToSliceAndPtr() void {
1313 x[0] += 1;
1414 expect(mem.eql(u8, array[0..], "boeu"));
1515}
16
test/stage1/behavior/bugs/1486.zig-1
......@@ -8,4 +8,3 @@ test "constant pointer to global variable causes runtime load" {
88 expect(&global == ptr);
99 expect(ptr.* == 1234);
1010}
11
test/stage1/behavior/bugs/421.zig-1
......@@ -13,4 +13,3 @@ fn extractOne64(a: u128) u64 {
1313 const x = @bitCast([2]u64, a);
1414 return x[1];
1515}
16
test/stage1/behavior/bugs/529.zig-1
......@@ -12,4 +12,3 @@ test "issue 529 fixed" {
1212 @import("529_other_file.zig").issue529(null);
1313 issue529(null);
1414}
15
test/stage1/behavior/bugs/726.zig-1
......@@ -13,4 +13,3 @@ test "@ptrCast from var in empty struct to nullable" {
1313 var x: ?*const u8 = @ptrCast(?*const u8, &container.c);
1414 expect(x.?.* == 4);
1515}
16
test/stage1/behavior/fn.zig-1
......@@ -205,4 +205,3 @@ test "extern struct with stdcallcc fn pointer" {
205205 s.ptr = S.foo;
206206 expect(s.ptr() == 1234);
207207}
208
test/stage1/behavior/import.zig+1-1
......@@ -12,7 +12,7 @@ test "importing the same thing gives the same import" {
1212
1313test "import in non-toplevel scope" {
1414 const S = struct {
15 use @import("import/a_namespace.zig");
15 usingnamespace @import("import/a_namespace.zig");
1616 };
1717 expectEqual(i32(1234), S.foo());
1818}
test/stage1/behavior/popcount.zig-1
......@@ -41,4 +41,3 @@ fn testPopCount() void {
4141 expect(@popCount(i128, 0b11111111000110001100010000100001000011000011100101010001) == 24);
4242 }
4343}
44
test/stage1/behavior/reflection.zig-1
......@@ -93,4 +93,3 @@ const Bar = union(enum) {
9393 Three: bool,
9494 Four: f64,
9595};
96
test/stage1/behavior/struct.zig+1-1
......@@ -552,7 +552,7 @@ test "packed struct with fp fields" {
552552
553553test "use within struct scope" {
554554 const S = struct {
555 use struct {
555 usingnamespace struct {
556556 pub fn inner() i32 {
557557 return 42;
558558 }
test/stage1/behavior/this.zig-1
......@@ -32,4 +32,3 @@ test "this refer to container" {
3232 expect(pt.x == 13);
3333 expect(pt.y == 35);
3434}
35
test/stage1/behavior/undefined.zig-1
......@@ -66,4 +66,3 @@ test "type name of undefined" {
6666 const x = undefined;
6767 expect(mem.eql(u8, @typeName(@typeOf(x)), "(undefined)"));
6868}
69
test/stage1/behavior/union.zig+1-1
......@@ -374,7 +374,7 @@ const Attribute = union(enum) {
374374fn setAttribute(attr: Attribute) void {}
375375
376376fn Setter(attr: Attribute) type {
377 return struct{
377 return struct {
378378 fn set() void {
379379 setAttribute(attr);
380380 }
test/stage1/behavior/widening.zig-1
......@@ -25,4 +25,3 @@ test "float widening" {
2525 var d: f128 = c;
2626 expect(d == a);
2727}
28
test/standalone/use_alias/c.zig+1-1
......@@ -1 +1 @@
1pub use @cImport(@cInclude("foo.h"));
1pub usingnamespace @cImport(@cInclude("foo.h"));