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 {
116116 const x = @bitCast(i32, r.random.scalar(u32));
117117 const node = ctx.allocator.create(Queue(i32).Node{
118118 .next = null,
119 .data = x
119 .data = x,
120120 }) catch unreachable;
121121 ctx.queue.put(node);
122122 _ = @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 {
119119 const x = @bitCast(i32, r.random.scalar(u32));
120120 const node = ctx.allocator.create(Stack(i32).Node{
121121 .next = null,
122 .data = x
122 .data = x,
123123 }) catch unreachable;
124124 ctx.stack.push(node);
125125 _ = @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 {
279279 var exe_file = try os.openSelfExe();
280280 defer exe_file.close();
281281
282 const st = try allocator.create(ElfStackTrace{
283 .symbol_table = try macho.loadSymbols(allocator, &io.FileInStream.init(&exe_file))
284 });
282 const st = try allocator.create(ElfStackTrace{ .symbol_table = try macho.loadSymbols(allocator, &io.FileInStream.init(&exe_file)) });
285283 errdefer allocator.destroy(st);
286284 return st;
287285 },
......@@ -972,7 +970,7 @@ fn scanAllCompileUnits(st: *ElfStackTrace) !void {
972970
973971 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
977975 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
194194 pub fn allocateNode(list: *Self, allocator: *Allocator) !*Node {
195195 comptime assert(!isIntrusive());
196196 return allocator.create(Node{
197 .prev = null,
198 .next = null,
199 .data = undefined
197 .prev = null,
198 .next = null,
199 .data = undefined,
200200 });
201201 }
202202
std/mem.zig+1-1
......@@ -44,7 +44,7 @@ pub const Allocator = struct {
4444 /// Alias of `create`
4545 /// Call `destroy` with the result
4646 pub fn construct(self: *Allocator, init: var) Error!*@typeOf(init) {
47 return self.create(init);
47 return self.create(init);
4848 }
4949
5050 /// `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
25832583 errdefer assert(windows.HeapFree(heap_handle, 0, bytes_ptr) != 0);
25842584 const bytes = @ptrCast([*]u8, bytes_ptr)[0..byte_count];
25852585 const outer_context = std.heap.FixedBufferAllocator.init(bytes).allocator.create(WinThread.OuterContext{
2586 .thread = undefined,
2587 .inner = context
2586 .thread = undefined,
2587 .inner = context,
25882588 }) catch unreachable;
25892589
25902590 outer_context.thread.data.heap_handle = heap_handle;
test/cases/null.zig+1-1
......@@ -146,7 +146,7 @@ test "null with default unwrap" {
146146
147147test "optional types" {
148148 comptime {
149 const opt_type_struct = StructWithOptionalType { .t=u8, };
149 const opt_type_struct = StructWithOptionalType{ .t = u8 };
150150 assert(opt_type_struct.t != null and opt_type_struct.t.? == u8);
151151 }
152152}