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