Skip to content

Commit 6769806

Browse files
authored
Merge pull request ziglang#21727 from 87flowers/fmt-render2
std/zig/render: Rewrite indentation
2 parents b6a1fdd + eb3c7f5 commit 6769806

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1725
-1499
lines changed

lib/compiler/aro/aro/Parser.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ fn decl(p: *Parser) Error!bool {
979979
_ = try p.expectToken(.semicolon);
980980
if (decl_spec.ty.is(.@"enum") or
981981
(decl_spec.ty.isRecord() and !decl_spec.ty.isAnonymousRecord(p.comp) and
982-
!decl_spec.ty.isTypeof())) // we follow GCC and clang's behavior here
982+
!decl_spec.ty.isTypeof())) // we follow GCC and clang's behavior here
983983
{
984984
const specifier = decl_spec.ty.canonicalize(.standard).specifier;
985985
const attrs = p.attr_buf.items(.attr)[attr_buf_top..];

lib/compiler/aro/aro/pragmas/gcc.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ fn preprocessorHandler(pragma: *Pragma, pp: *Preprocessor, start_idx: TokenIndex
114114

115115
const gcc_pragma = std.meta.stringToEnum(Directive, pp.expandedSlice(directive_tok)) orelse
116116
return pp.comp.addDiagnostic(.{
117-
.tag = .unknown_gcc_pragma,
118-
.loc = directive_tok.loc,
119-
}, pp.expansionSlice(start_idx + 1));
117+
.tag = .unknown_gcc_pragma,
118+
.loc = directive_tok.loc,
119+
}, pp.expansionSlice(start_idx + 1));
120120

121121
switch (gcc_pragma) {
122122
.warning, .@"error" => {

lib/compiler/resinator/lang.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ pub fn parse(lang_tag: []const u8) error{InvalidLanguageTag}!Parsed {
255255
// Special case for qps-ploca and qps-plocm
256256
else if (std.ascii.eqlIgnoreCase(lang_code, "qps") and
257257
(std.ascii.eqlIgnoreCase(part_str, "ploca") or
258-
std.ascii.eqlIgnoreCase(part_str, "plocm")))
258+
std.ascii.eqlIgnoreCase(part_str, "plocm")))
259259
{
260260
parsed.suffix = part_str;
261261
} else {

lib/compiler_rt/count0bits.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ pub const __clzsi2 = switch (builtin.cpu.arch) {
143143
.arm, .armeb, .thumb, .thumbeb => impl: {
144144
const use_thumb1 =
145145
(builtin.cpu.arch.isThumb() or
146-
std.Target.arm.featureSetHas(builtin.cpu.features, .noarm)) and
146+
std.Target.arm.featureSetHas(builtin.cpu.features, .noarm)) and
147147
!std.Target.arm.featureSetHas(builtin.cpu.features, .thumb2);
148148

149149
if (use_thumb1) {

lib/compiler_rt/int.zig

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,19 @@ fn test_one_divmoddi4(a: i64, b: i64, expected_q: i64, expected_r: i64) !void {
8181

8282
const cases__divmoddi4 =
8383
[_][4]i64{
84-
[_]i64{ 0, 1, 0, 0 },
85-
[_]i64{ 0, -1, 0, 0 },
86-
[_]i64{ 2, 1, 2, 0 },
87-
[_]i64{ 2, -1, -2, 0 },
88-
[_]i64{ -2, 1, -2, 0 },
89-
[_]i64{ -2, -1, 2, 0 },
90-
[_]i64{ 7, 5, 1, 2 },
91-
[_]i64{ -7, 5, -1, -2 },
92-
[_]i64{ 19, 5, 3, 4 },
93-
[_]i64{ 19, -5, -3, 4 },
94-
[_]i64{ @as(i64, @bitCast(@as(u64, 0x8000000000000000))), 8, @as(i64, @bitCast(@as(u64, 0xf000000000000000))), 0 },
95-
[_]i64{ @as(i64, @bitCast(@as(u64, 0x8000000000000007))), 8, @as(i64, @bitCast(@as(u64, 0xf000000000000001))), -1 },
96-
};
84+
[_]i64{ 0, 1, 0, 0 },
85+
[_]i64{ 0, -1, 0, 0 },
86+
[_]i64{ 2, 1, 2, 0 },
87+
[_]i64{ 2, -1, -2, 0 },
88+
[_]i64{ -2, 1, -2, 0 },
89+
[_]i64{ -2, -1, 2, 0 },
90+
[_]i64{ 7, 5, 1, 2 },
91+
[_]i64{ -7, 5, -1, -2 },
92+
[_]i64{ 19, 5, 3, 4 },
93+
[_]i64{ 19, -5, -3, 4 },
94+
[_]i64{ @as(i64, @bitCast(@as(u64, 0x8000000000000000))), 8, @as(i64, @bitCast(@as(u64, 0xf000000000000000))), 0 },
95+
[_]i64{ @as(i64, @bitCast(@as(u64, 0x8000000000000007))), 8, @as(i64, @bitCast(@as(u64, 0xf000000000000001))), -1 },
96+
};
9797

9898
test "test_divmoddi4" {
9999
for (cases__divmoddi4) |case| {
@@ -215,19 +215,19 @@ pub fn __divmodsi4(a: i32, b: i32, rem: *i32) callconv(.C) i32 {
215215

216216
const cases__divmodsi4 =
217217
[_][4]i32{
218-
[_]i32{ 0, 1, 0, 0 },
219-
[_]i32{ 0, -1, 0, 0 },
220-
[_]i32{ 2, 1, 2, 0 },
221-
[_]i32{ 2, -1, -2, 0 },
222-
[_]i32{ -2, 1, -2, 0 },
223-
[_]i32{ -2, -1, 2, 0 },
224-
[_]i32{ 7, 5, 1, 2 },
225-
[_]i32{ -7, 5, -1, -2 },
226-
[_]i32{ 19, 5, 3, 4 },
227-
[_]i32{ 19, -5, -3, 4 },
228-
[_]i32{ @bitCast(@as(u32, 0x80000000)), 8, @bitCast(@as(u32, 0xf0000000)), 0 },
229-
[_]i32{ @bitCast(@as(u32, 0x80000007)), 8, @bitCast(@as(u32, 0xf0000001)), -1 },
230-
};
218+
[_]i32{ 0, 1, 0, 0 },
219+
[_]i32{ 0, -1, 0, 0 },
220+
[_]i32{ 2, 1, 2, 0 },
221+
[_]i32{ 2, -1, -2, 0 },
222+
[_]i32{ -2, 1, -2, 0 },
223+
[_]i32{ -2, -1, 2, 0 },
224+
[_]i32{ 7, 5, 1, 2 },
225+
[_]i32{ -7, 5, -1, -2 },
226+
[_]i32{ 19, 5, 3, 4 },
227+
[_]i32{ 19, -5, -3, 4 },
228+
[_]i32{ @bitCast(@as(u32, 0x80000000)), 8, @bitCast(@as(u32, 0xf0000000)), 0 },
229+
[_]i32{ @bitCast(@as(u32, 0x80000007)), 8, @bitCast(@as(u32, 0xf0000001)), -1 },
230+
};
231231

232232
fn test_one_divmodsi4(a: i32, b: i32, expected_q: i32, expected_r: i32) !void {
233233
var r: i32 = undefined;

lib/compiler_rt/popcount.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ inline fn popcountXi2(comptime ST: type, a: ST) i32 {
4040
var x: UT = @bitCast(a);
4141
x -= (x >> 1) & (~@as(UT, 0) / 3); // 0x55...55, aggregate duos
4242
x = ((x >> 2) & (~@as(UT, 0) / 5)) // 0x33...33, aggregate nibbles
43-
+ (x & (~@as(UT, 0) / 5));
43+
+ (x & (~@as(UT, 0) / 5));
4444
x += x >> 4;
4545
x &= ~@as(UT, 0) / 17; // 0x0F...0F, aggregate bytes
4646
// 8 most significant bits of x + (x<<8) + (x<<16) + ..

lib/docs/wasm/markdown/Parser.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ fn appendBlockStart(p: *Parser, block_start: BlockStart) !void {
374374
// or not of the same marker type.
375375
const should_close_list = last_pending_block.tag == .list and
376376
(block_start.tag != .list_item or
377-
block_start.data.list_item.marker != last_pending_block.data.list.marker);
377+
block_start.data.list_item.marker != last_pending_block.data.list.marker);
378378
// The last block should also be closed if the new block is not a table
379379
// row, which is the only allowed child of a table.
380380
const should_close_table = last_pending_block.tag == .table and

lib/std/Target.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ pub const Os = struct {
299299
pub fn parse(str: []const u8) !WindowsVersion {
300300
return std.meta.stringToEnum(WindowsVersion, str) orelse
301301
@enumFromInt(std.fmt.parseInt(u32, str, 0) catch
302-
return error.InvalidOperatingSystemVersion);
302+
return error.InvalidOperatingSystemVersion);
303303
}
304304

305305
/// This function is defined to serialize a Zig source code representation of this

lib/std/c.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9879,10 +9879,10 @@ pub extern "c" fn setlocale(category: LC, locale: ?[*:0]const u8) ?[*:0]const u8
98799879

98809880
pub const getcontext = if (builtin.target.abi.isAndroid() or builtin.target.os.tag == .openbsd)
98819881
{} // android bionic and openbsd libc does not implement getcontext
9882-
else if (native_os == .linux and builtin.target.abi.isMusl())
9883-
linux.getcontext
9884-
else
9885-
private.getcontext;
9882+
else if (native_os == .linux and builtin.target.abi.isMusl())
9883+
linux.getcontext
9884+
else
9885+
private.getcontext;
98869886

98879887
pub const max_align_t = if (native_abi == .msvc or native_abi == .itanium)
98889888
f64

lib/std/crypto/tls/Client.zig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ pub fn init(stream: anytype, options: Options) InitError(@TypeOf(stream))!Client
692692
const client_key_exchange_msg = .{@intFromEnum(tls.ContentType.handshake)} ++
693693
int(u16, @intFromEnum(tls.ProtocolVersion.tls_1_2)) ++
694694
array(u16, u8, .{@intFromEnum(tls.HandshakeType.client_key_exchange)} ++
695-
array(u24, u8, array(u8, u8, key_share.secp256r1_kp.public_key.toUncompressedSec1())));
695+
array(u24, u8, array(u8, u8, key_share.secp256r1_kp.public_key.toUncompressedSec1())));
696696
const client_change_cipher_spec_msg = .{@intFromEnum(tls.ContentType.change_cipher_spec)} ++
697697
int(u16, @intFromEnum(tls.ProtocolVersion.tls_1_2)) ++
698698
array(u16, tls.ChangeCipherSpecType, .{.change_cipher_spec});
@@ -720,11 +720,11 @@ pub fn init(stream: anytype, options: Options) InitError(@TypeOf(stream))!Client
720720
);
721721
const client_verify_cleartext = .{@intFromEnum(tls.HandshakeType.finished)} ++
722722
array(u24, u8, hmacExpandLabel(
723-
P.Hmac,
724-
&master_secret,
725-
&.{ "client finished", &p.transcript_hash.peek() },
726-
P.verify_data_length,
727-
));
723+
P.Hmac,
724+
&master_secret,
725+
&.{ "client finished", &p.transcript_hash.peek() },
726+
P.verify_data_length,
727+
));
728728
p.transcript_hash.update(&client_verify_cleartext);
729729
p.version = .{ .tls_1_2 = .{
730730
.expected_server_verify_data = hmacExpandLabel(
@@ -745,7 +745,7 @@ pub fn init(stream: anytype, options: Options) InitError(@TypeOf(stream))!Client
745745
var client_verify_msg = .{@intFromEnum(tls.ContentType.handshake)} ++
746746
int(u16, @intFromEnum(tls.ProtocolVersion.tls_1_2)) ++
747747
array(u16, u8, nonce[P.fixed_iv_length..].* ++
748-
@as([client_verify_cleartext.len + P.mac_length]u8, undefined));
748+
@as([client_verify_cleartext.len + P.mac_length]u8, undefined));
749749
P.AEAD.encrypt(
750750
client_verify_msg[client_verify_msg.len - P.mac_length -
751751
client_verify_cleartext.len ..][0..client_verify_cleartext.len],

0 commit comments

Comments
 (0)