run zig fmt to update use
to usingnamespace
This commit is contained in:
parent
8a4ee5942b
commit
bfc86776d5
@ -1,4 +1,4 @@
|
||||
pub use @cImport({
|
||||
pub usingnamespace @cImport({
|
||||
@cDefine("__STDC_CONSTANT_MACROS", "");
|
||||
@cDefine("__STDC_LIMIT_MACROS", "");
|
||||
@cInclude("inttypes.h");
|
||||
|
@ -6,7 +6,7 @@ const builtin = @import("builtin");
|
||||
const assert = std.debug.assert;
|
||||
const ast = std.zig.ast;
|
||||
const Token = std.zig.Token;
|
||||
use @import("clang.zig");
|
||||
usingnamespace @import("clang.zig");
|
||||
|
||||
pub const Mode = enum {
|
||||
import,
|
||||
|
@ -2,9 +2,9 @@ const builtin = @import("builtin");
|
||||
const std = @import("std");
|
||||
const page_size = std.mem.page_size;
|
||||
|
||||
pub use @import("os/bits.zig");
|
||||
pub usingnamespace @import("os/bits.zig");
|
||||
|
||||
pub use switch (builtin.os) {
|
||||
pub usingnamespace switch (builtin.os) {
|
||||
.linux => @import("c/linux.zig"),
|
||||
.windows => @import("c/windows.zig"),
|
||||
.macosx, .ios, .tvos, .watchos => @import("c/darwin.zig"),
|
||||
|
@ -3,7 +3,7 @@ const assert = std.debug.assert;
|
||||
const builtin = @import("builtin");
|
||||
const macho = std.macho;
|
||||
|
||||
use @import("../os/bits.zig");
|
||||
usingnamespace @import("../os/bits.zig");
|
||||
|
||||
extern "c" fn __error() *c_int;
|
||||
pub extern "c" fn _NSGetExecutablePath(buf: [*]u8, bufsize: *u32) c_int;
|
||||
|
@ -1,5 +1,5 @@
|
||||
const std = @import("../std.zig");
|
||||
use std.c;
|
||||
usingnamespace std.c;
|
||||
|
||||
extern "c" fn __errno_location() *c_int;
|
||||
pub const _errno = __errno_location;
|
||||
|
@ -1,5 +1,5 @@
|
||||
pub use @import("big/int.zig");
|
||||
pub use @import("big/rational.zig");
|
||||
pub usingnamespace @import("big/int.zig");
|
||||
pub usingnamespace @import("big/rational.zig");
|
||||
|
||||
test "math.big" {
|
||||
_ = @import("big/int.zig");
|
||||
|
@ -46,7 +46,7 @@ pub const system = if (builtin.link_libc) std.c else switch (builtin.os) {
|
||||
else => struct {},
|
||||
};
|
||||
|
||||
pub use @import("os/bits.zig");
|
||||
pub usingnamespace @import("os/bits.zig");
|
||||
|
||||
/// See also `getenv`. Populated by startup code before main().
|
||||
pub var environ: [][*]u8 = undefined;
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
const builtin = @import("builtin");
|
||||
|
||||
pub use switch (builtin.os) {
|
||||
pub usingnamespace switch (builtin.os) {
|
||||
.macosx, .ios, .tvos, .watchos => @import("bits/darwin.zig"),
|
||||
.freebsd => @import("bits/freebsd.zig"),
|
||||
.linux => @import("bits/linux.zig"),
|
||||
|
@ -1,10 +1,10 @@
|
||||
const builtin = @import("builtin");
|
||||
const std = @import("../../std.zig");
|
||||
const maxInt = std.math.maxInt;
|
||||
use @import("../bits.zig");
|
||||
usingnamespace @import("../bits.zig");
|
||||
|
||||
pub use @import("linux/errno.zig");
|
||||
pub use switch (builtin.arch) {
|
||||
pub usingnamespace @import("linux/errno.zig");
|
||||
pub usingnamespace switch (builtin.arch) {
|
||||
.x86_64 => @import("linux/x86_64.zig"),
|
||||
.aarch64 => @import("linux/arm64.zig"),
|
||||
else => struct {},
|
||||
|
@ -1,6 +1,6 @@
|
||||
// The reference for these types and values is Microsoft Windows's ucrt (Universal C RunTime).
|
||||
|
||||
use @import("../windows/bits.zig");
|
||||
usingnamespace @import("../windows/bits.zig");
|
||||
|
||||
pub const fd_t = HANDLE;
|
||||
pub const pid_t = HANDLE;
|
||||
|
@ -4,4 +4,4 @@ pub const is_the_target = switch (builtin.os) {
|
||||
.macosx, .tvos, .watchos, .ios => true,
|
||||
else => false,
|
||||
};
|
||||
pub use std.c;
|
||||
pub usingnamespace std.c;
|
||||
|
@ -1,4 +1,4 @@
|
||||
const std = @import("../std.zig");
|
||||
const builtin = @import("builtin");
|
||||
pub const is_the_target = builtin.os == .freebsd;
|
||||
pub use std.c;
|
||||
pub usingnamespace std.c;
|
||||
|
@ -14,12 +14,12 @@ const vdso = @import("linux/vdso.zig");
|
||||
const dl = @import("../dynamic_library.zig");
|
||||
|
||||
pub const is_the_target = builtin.os == .linux;
|
||||
pub use switch (builtin.arch) {
|
||||
pub usingnamespace switch (builtin.arch) {
|
||||
.x86_64 => @import("linux/x86_64.zig"),
|
||||
.aarch64 => @import("linux/arm64.zig"),
|
||||
else => struct {},
|
||||
};
|
||||
pub use @import("bits.zig");
|
||||
pub usingnamespace @import("bits.zig");
|
||||
pub const tls = @import("linux/tls.zig");
|
||||
|
||||
/// Set by startup code, used by `getauxval`.
|
||||
|
@ -1,4 +1,4 @@
|
||||
use @import("../bits.zig");
|
||||
usingnamespace @import("../bits.zig");
|
||||
|
||||
pub fn syscall0(number: usize) usize {
|
||||
return asm volatile ("syscall"
|
||||
|
@ -1,4 +1,4 @@
|
||||
const builtin = @import("builtin");
|
||||
const std = @import("../std.zig");
|
||||
pub const is_the_target = builtin.os == .netbsd;
|
||||
pub use std.c;
|
||||
pub usingnamespace std.c;
|
||||
|
@ -5,7 +5,7 @@ const std = @import("std");
|
||||
const assert = std.debug.assert;
|
||||
|
||||
pub const is_the_target = builtin.os == .wasi;
|
||||
pub use @import("bits.zig");
|
||||
pub usingnamespace @import("bits.zig");
|
||||
|
||||
comptime {
|
||||
assert(@alignOf(i8) == 1);
|
||||
|
@ -18,7 +18,7 @@ pub const ntdll = @import("windows/ntdll.zig");
|
||||
pub const ole32 = @import("windows/ole32.zig");
|
||||
pub const shell32 = @import("windows/shell32.zig");
|
||||
|
||||
pub use @import("windows/bits.zig");
|
||||
pub usingnamespace @import("windows/bits.zig");
|
||||
|
||||
pub const CreateFileError = error{
|
||||
SharingViolation,
|
||||
|
@ -1,4 +1,4 @@
|
||||
use @import("bits.zig");
|
||||
usingnamespace @import("bits.zig");
|
||||
|
||||
pub extern "advapi32" stdcallcc fn RegOpenKeyExW(
|
||||
hKey: HKEY,
|
||||
|
@ -1,4 +1,4 @@
|
||||
use @import("bits.zig");
|
||||
usingnamespace @import("bits.zig");
|
||||
|
||||
pub extern "kernel32" stdcallcc fn CancelIoEx(hFile: HANDLE, lpOverlapped: LPOVERLAPPED) BOOL;
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
use @import("bits.zig");
|
||||
usingnamespace @import("bits.zig");
|
||||
|
||||
pub extern "NtDll" stdcallcc fn RtlCaptureStackBackTrace(FramesToSkip: DWORD, FramesToCapture: DWORD, BackTrace: **c_void, BackTraceHash: ?*DWORD) WORD;
|
||||
|
@ -1,4 +1,4 @@
|
||||
use @import("bits.zig");
|
||||
usingnamespace @import("bits.zig");
|
||||
|
||||
pub extern "ole32" stdcallcc fn CoTaskMemFree(pv: LPVOID) void;
|
||||
pub extern "ole32" stdcallcc fn CoUninitialize() void;
|
||||
|
@ -1,3 +1,3 @@
|
||||
use @import("bits.zig");
|
||||
usingnamespace @import("bits.zig");
|
||||
|
||||
pub extern "shell32" stdcallcc fn SHGetKnownFolderPath(rfid: *const KNOWNFOLDERID, dwFlags: DWORD, hToken: ?HANDLE, ppszPath: *[*]WCHAR) HRESULT;
|
||||
|
@ -80,7 +80,7 @@ pub const STDOUT_FILENO = 1;
|
||||
pub const STDERR_FILENO = 2;
|
||||
|
||||
// FIXME: let's borrow Linux's error numbers for now.
|
||||
use @import("bits/linux/errno.zig");
|
||||
usingnamespace @import("bits/linux/errno.zig");
|
||||
// Get the errno from a syscall return value, or 0 for no error.
|
||||
pub fn getErrno(r: usize) usize {
|
||||
const signed_r = @bitCast(isize, r);
|
||||
|
@ -15,4 +15,3 @@ test "@alignOf(T) before referencing T" {
|
||||
comptime expect(@alignOf(Foo) == 4);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,4 +13,3 @@ fn testCastPtrOfArrayToSliceAndPtr() void {
|
||||
x[0] += 1;
|
||||
expect(mem.eql(u8, array[0..], "boeu"));
|
||||
}
|
||||
|
||||
|
@ -8,4 +8,3 @@ test "constant pointer to global variable causes runtime load" {
|
||||
expect(&global == ptr);
|
||||
expect(ptr.* == 1234);
|
||||
}
|
||||
|
||||
|
@ -13,4 +13,3 @@ fn extractOne64(a: u128) u64 {
|
||||
const x = @bitCast([2]u64, a);
|
||||
return x[1];
|
||||
}
|
||||
|
||||
|
@ -12,4 +12,3 @@ test "issue 529 fixed" {
|
||||
@import("529_other_file.zig").issue529(null);
|
||||
issue529(null);
|
||||
}
|
||||
|
||||
|
@ -13,4 +13,3 @@ test "@ptrCast from var in empty struct to nullable" {
|
||||
var x: ?*const u8 = @ptrCast(?*const u8, &container.c);
|
||||
expect(x.?.* == 4);
|
||||
}
|
||||
|
||||
|
@ -205,4 +205,3 @@ test "extern struct with stdcallcc fn pointer" {
|
||||
s.ptr = S.foo;
|
||||
expect(s.ptr() == 1234);
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ test "importing the same thing gives the same import" {
|
||||
|
||||
test "import in non-toplevel scope" {
|
||||
const S = struct {
|
||||
use @import("import/a_namespace.zig");
|
||||
usingnamespace @import("import/a_namespace.zig");
|
||||
};
|
||||
expectEqual(i32(1234), S.foo());
|
||||
}
|
||||
|
@ -41,4 +41,3 @@ fn testPopCount() void {
|
||||
expect(@popCount(i128, 0b11111111000110001100010000100001000011000011100101010001) == 24);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,4 +93,3 @@ const Bar = union(enum) {
|
||||
Three: bool,
|
||||
Four: f64,
|
||||
};
|
||||
|
||||
|
@ -552,7 +552,7 @@ test "packed struct with fp fields" {
|
||||
|
||||
test "use within struct scope" {
|
||||
const S = struct {
|
||||
use struct {
|
||||
usingnamespace struct {
|
||||
pub fn inner() i32 {
|
||||
return 42;
|
||||
}
|
||||
|
@ -32,4 +32,3 @@ test "this refer to container" {
|
||||
expect(pt.x == 13);
|
||||
expect(pt.y == 35);
|
||||
}
|
||||
|
||||
|
@ -66,4 +66,3 @@ test "type name of undefined" {
|
||||
const x = undefined;
|
||||
expect(mem.eql(u8, @typeName(@typeOf(x)), "(undefined)"));
|
||||
}
|
||||
|
||||
|
@ -374,7 +374,7 @@ const Attribute = union(enum) {
|
||||
fn setAttribute(attr: Attribute) void {}
|
||||
|
||||
fn Setter(attr: Attribute) type {
|
||||
return struct{
|
||||
return struct {
|
||||
fn set() void {
|
||||
setAttribute(attr);
|
||||
}
|
||||
|
@ -25,4 +25,3 @@ test "float widening" {
|
||||
var d: f128 = c;
|
||||
expect(d == a);
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
pub use @cImport(@cInclude("foo.h"));
|
||||
pub usingnamespace @cImport(@cInclude("foo.h"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user