authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-06-20 17:16:27-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-06-20 17:16:27-04:00
loge891f9cd9dc52b4bc63ae63115822fbf5e724348
tree04db0f7f5ae715cab83eaa496861be16161998cc
parent6bd861006377ba192d5bd108a0de1e94f32c2454

zig fmt


7 files changed, 11 insertions(+), 13 deletions(-)

std/atomic/queue.zig+1-1
...@@ -116,7 +116,7 @@ fn startPuts(ctx: *Context) u8 {...@@ -116,7 +116,7 @@ fn startPuts(ctx: *Context) u8 {
116 const x = @bitCast(i32, r.random.scalar(u32));116 const x = @bitCast(i32, r.random.scalar(u32));
117 const node = ctx.allocator.create(Queue(i32).Node{117 const node = ctx.allocator.create(Queue(i32).Node{
118 .next = null,118 .next = null,
119 .data = x119 .data = x,
120 }) catch unreachable;120 }) catch unreachable;
121 ctx.queue.put(node);121 ctx.queue.put(node);
122 _ = @atomicRmw(isize, &ctx.put_sum, builtin.AtomicRmwOp.Add, x, AtomicOrder.SeqCst);122 _ = @atomicRmw(isize, &ctx.put_sum, builtin.AtomicRmwOp.Add, x, AtomicOrder.SeqCst);
std/atomic/stack.zig+1-1
...@@ -119,7 +119,7 @@ fn startPuts(ctx: *Context) u8 {...@@ -119,7 +119,7 @@ fn startPuts(ctx: *Context) u8 {
119 const x = @bitCast(i32, r.random.scalar(u32));119 const x = @bitCast(i32, r.random.scalar(u32));
120 const node = ctx.allocator.create(Stack(i32).Node{120 const node = ctx.allocator.create(Stack(i32).Node{
121 .next = null,121 .next = null,
122 .data = x122 .data = x,
123 }) catch unreachable;123 }) catch unreachable;
124 ctx.stack.push(node);124 ctx.stack.push(node);
125 _ = @atomicRmw(isize, &ctx.put_sum, builtin.AtomicRmwOp.Add, x, AtomicOrder.SeqCst);125 _ = @atomicRmw(isize, &ctx.put_sum, builtin.AtomicRmwOp.Add, x, AtomicOrder.SeqCst);
std/debug/index.zig+2-4
...@@ -279,9 +279,7 @@ pub fn openSelfDebugInfo(allocator: *mem.Allocator) !*ElfStackTrace {...@@ -279,9 +279,7 @@ pub fn openSelfDebugInfo(allocator: *mem.Allocator) !*ElfStackTrace {
279 var exe_file = try os.openSelfExe();279 var exe_file = try os.openSelfExe();
280 defer exe_file.close();280 defer exe_file.close();
281281
282 const st = try allocator.create(ElfStackTrace{282 const st = try allocator.create(ElfStackTrace{ .symbol_table = try macho.loadSymbols(allocator, &io.FileInStream.init(&exe_file)) });
283 .symbol_table = try macho.loadSymbols(allocator, &io.FileInStream.init(&exe_file))
284 });
285 errdefer allocator.destroy(st);283 errdefer allocator.destroy(st);
286 return st;284 return st;
287 },285 },
...@@ -972,7 +970,7 @@ fn scanAllCompileUnits(st: *ElfStackTrace) !void {...@@ -972,7 +970,7 @@ fn scanAllCompileUnits(st: *ElfStackTrace) !void {
972970
973 try st.self_exe_file.seekTo(compile_unit_pos);971 try st.self_exe_file.seekTo(compile_unit_pos);
974972
975 const compile_unit_die = try st.allocator().create( try parseDie(st, abbrev_table, is_64) );973 const compile_unit_die = try st.allocator().create(try parseDie(st, abbrev_table, is_64));
976974
977 if (compile_unit_die.tag_id != DW.TAG_compile_unit) return error.InvalidDebugInfo;975 if (compile_unit_die.tag_id != DW.TAG_compile_unit) return error.InvalidDebugInfo;
978976
std/linked_list.zig+3-3
...@@ -194,9 +194,9 @@ fn BaseLinkedList(comptime T: type, comptime ParentType: type, comptime field_na...@@ -194,9 +194,9 @@ fn BaseLinkedList(comptime T: type, comptime ParentType: type, comptime field_na
194 pub fn allocateNode(list: *Self, allocator: *Allocator) !*Node {194 pub fn allocateNode(list: *Self, allocator: *Allocator) !*Node {
195 comptime assert(!isIntrusive());195 comptime assert(!isIntrusive());
196 return allocator.create(Node{196 return allocator.create(Node{
197 .prev = null,197 .prev = null,
198 .next = null,198 .next = null,
199 .data = undefined199 .data = undefined,
200 });200 });
201 }201 }
202202
std/mem.zig+1-1
...@@ -44,7 +44,7 @@ pub const Allocator = struct {...@@ -44,7 +44,7 @@ pub const Allocator = struct {
44 /// Alias of `create`44 /// Alias of `create`
45 /// Call `destroy` with the result45 /// Call `destroy` with the result
46 pub fn construct(self: *Allocator, init: var) Error!*@typeOf(init) {46 pub fn construct(self: *Allocator, init: var) Error!*@typeOf(init) {
47 return self.create(init);47 return self.create(init);
48 }48 }
4949
50 /// `ptr` should be the return value of `construct` or `create`50 /// `ptr` should be the return value of `construct` or `create`
std/os/index.zig+2-2
...@@ -2583,8 +2583,8 @@ pub fn spawnThread(context: var, comptime startFn: var) SpawnThreadError!*Thread...@@ -2583,8 +2583,8 @@ pub fn spawnThread(context: var, comptime startFn: var) SpawnThreadError!*Thread
2583 errdefer assert(windows.HeapFree(heap_handle, 0, bytes_ptr) != 0);2583 errdefer assert(windows.HeapFree(heap_handle, 0, bytes_ptr) != 0);
2584 const bytes = @ptrCast([*]u8, bytes_ptr)[0..byte_count];2584 const bytes = @ptrCast([*]u8, bytes_ptr)[0..byte_count];
2585 const outer_context = std.heap.FixedBufferAllocator.init(bytes).allocator.create(WinThread.OuterContext{2585 const outer_context = std.heap.FixedBufferAllocator.init(bytes).allocator.create(WinThread.OuterContext{
2586 .thread = undefined,2586 .thread = undefined,
2587 .inner = context2587 .inner = context,
2588 }) catch unreachable;2588 }) catch unreachable;
25892589
2590 outer_context.thread.data.heap_handle = heap_handle;2590 outer_context.thread.data.heap_handle = heap_handle;
test/cases/null.zig+1-1
...@@ -146,7 +146,7 @@ test "null with default unwrap" {...@@ -146,7 +146,7 @@ test "null with default unwrap" {
146146
147test "optional types" {147test "optional types" {
148 comptime {148 comptime {
149 const opt_type_struct = StructWithOptionalType { .t=u8, };149 const opt_type_struct = StructWithOptionalType{ .t = u8 };
150 assert(opt_type_struct.t != null and opt_type_struct.t.? == u8);150 assert(opt_type_struct.t != null and opt_type_struct.t.? == u8);
151 }151 }
152}152}