aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-02-22 17:03:24 -0800
committerAndrew Kelley <andrew@ziglang.org>2025-02-22 17:09:20 -0800
commiteb3c7f570601a6e00cbf03f0a026b3493887a534 (patch)
treee621eb6aa4ab49bb72018d33c373b258f55922df /lib
parentc0c911bfa78ea2968cd110ad64a4ba0d70ca93e5 (diff)
downloadzig-eb3c7f570601a6e00cbf03f0a026b3493887a534.tar.gz
zig-eb3c7f570601a6e00cbf03f0a026b3493887a534.zip
zig build fmt
Diffstat (limited to 'lib')
-rw-r--r--lib/compiler/aro/aro/Parser.zig2
-rw-r--r--lib/compiler/aro/aro/pragmas/gcc.zig6
-rw-r--r--lib/compiler/resinator/lang.zig2
-rw-r--r--lib/compiler_rt/count0bits.zig2
-rw-r--r--lib/compiler_rt/int.zig52
-rw-r--r--lib/compiler_rt/popcount.zig2
-rw-r--r--lib/docs/wasm/markdown/Parser.zig2
-rw-r--r--lib/std/Target.zig2
-rw-r--r--lib/std/c.zig8
-rw-r--r--lib/std/crypto/tls/Client.zig14
-rw-r--r--lib/std/debug/SelfInfo.zig18
-rw-r--r--lib/std/http/Client.zig24
-rw-r--r--lib/std/posix.zig12
-rw-r--r--lib/std/zig/render.zig8
14 files changed, 77 insertions, 77 deletions
diff --git a/lib/compiler/aro/aro/Parser.zig b/lib/compiler/aro/aro/Parser.zig
index 85053b7e48..8327469853 100644
--- a/lib/compiler/aro/aro/Parser.zig
+++ b/lib/compiler/aro/aro/Parser.zig
@@ -979,7 +979,7 @@ fn decl(p: *Parser) Error!bool {
_ = try p.expectToken(.semicolon);
if (decl_spec.ty.is(.@"enum") or
(decl_spec.ty.isRecord() and !decl_spec.ty.isAnonymousRecord(p.comp) and
- !decl_spec.ty.isTypeof())) // we follow GCC and clang's behavior here
+ !decl_spec.ty.isTypeof())) // we follow GCC and clang's behavior here
{
const specifier = decl_spec.ty.canonicalize(.standard).specifier;
const attrs = p.attr_buf.items(.attr)[attr_buf_top..];
diff --git a/lib/compiler/aro/aro/pragmas/gcc.zig b/lib/compiler/aro/aro/pragmas/gcc.zig
index bf5daf95be..ce67698b88 100644
--- a/lib/compiler/aro/aro/pragmas/gcc.zig
+++ b/lib/compiler/aro/aro/pragmas/gcc.zig
@@ -114,9 +114,9 @@ fn preprocessorHandler(pragma: *Pragma, pp: *Preprocessor, start_idx: TokenIndex
const gcc_pragma = std.meta.stringToEnum(Directive, pp.expandedSlice(directive_tok)) orelse
return pp.comp.addDiagnostic(.{
- .tag = .unknown_gcc_pragma,
- .loc = directive_tok.loc,
- }, pp.expansionSlice(start_idx + 1));
+ .tag = .unknown_gcc_pragma,
+ .loc = directive_tok.loc,
+ }, pp.expansionSlice(start_idx + 1));
switch (gcc_pragma) {
.warning, .@"error" => {
diff --git a/lib/compiler/resinator/lang.zig b/lib/compiler/resinator/lang.zig
index 7cc69f1cf1..769733ceba 100644
--- a/lib/compiler/resinator/lang.zig
+++ b/lib/compiler/resinator/lang.zig
@@ -255,7 +255,7 @@ pub fn parse(lang_tag: []const u8) error{InvalidLanguageTag}!Parsed {
// Special case for qps-ploca and qps-plocm
else if (std.ascii.eqlIgnoreCase(lang_code, "qps") and
(std.ascii.eqlIgnoreCase(part_str, "ploca") or
- std.ascii.eqlIgnoreCase(part_str, "plocm")))
+ std.ascii.eqlIgnoreCase(part_str, "plocm")))
{
parsed.suffix = part_str;
} else {
diff --git a/lib/compiler_rt/count0bits.zig b/lib/compiler_rt/count0bits.zig
index 874cbacdc7..c2fba8ba1e 100644
--- a/lib/compiler_rt/count0bits.zig
+++ b/lib/compiler_rt/count0bits.zig
@@ -143,7 +143,7 @@ pub const __clzsi2 = switch (builtin.cpu.arch) {
.arm, .armeb, .thumb, .thumbeb => impl: {
const use_thumb1 =
(builtin.cpu.arch.isThumb() or
- std.Target.arm.featureSetHas(builtin.cpu.features, .noarm)) and
+ std.Target.arm.featureSetHas(builtin.cpu.features, .noarm)) and
!std.Target.arm.featureSetHas(builtin.cpu.features, .thumb2);
if (use_thumb1) {
diff --git a/lib/compiler_rt/int.zig b/lib/compiler_rt/int.zig
index e71a0c0990..758ca74781 100644
--- a/lib/compiler_rt/int.zig
+++ b/lib/compiler_rt/int.zig
@@ -81,19 +81,19 @@ fn test_one_divmoddi4(a: i64, b: i64, expected_q: i64, expected_r: i64) !void {
const cases__divmoddi4 =
[_][4]i64{
- [_]i64{ 0, 1, 0, 0 },
- [_]i64{ 0, -1, 0, 0 },
- [_]i64{ 2, 1, 2, 0 },
- [_]i64{ 2, -1, -2, 0 },
- [_]i64{ -2, 1, -2, 0 },
- [_]i64{ -2, -1, 2, 0 },
- [_]i64{ 7, 5, 1, 2 },
- [_]i64{ -7, 5, -1, -2 },
- [_]i64{ 19, 5, 3, 4 },
- [_]i64{ 19, -5, -3, 4 },
- [_]i64{ @as(i64, @bitCast(@as(u64, 0x8000000000000000))), 8, @as(i64, @bitCast(@as(u64, 0xf000000000000000))), 0 },
- [_]i64{ @as(i64, @bitCast(@as(u64, 0x8000000000000007))), 8, @as(i64, @bitCast(@as(u64, 0xf000000000000001))), -1 },
-};
+ [_]i64{ 0, 1, 0, 0 },
+ [_]i64{ 0, -1, 0, 0 },
+ [_]i64{ 2, 1, 2, 0 },
+ [_]i64{ 2, -1, -2, 0 },
+ [_]i64{ -2, 1, -2, 0 },
+ [_]i64{ -2, -1, 2, 0 },
+ [_]i64{ 7, 5, 1, 2 },
+ [_]i64{ -7, 5, -1, -2 },
+ [_]i64{ 19, 5, 3, 4 },
+ [_]i64{ 19, -5, -3, 4 },
+ [_]i64{ @as(i64, @bitCast(@as(u64, 0x8000000000000000))), 8, @as(i64, @bitCast(@as(u64, 0xf000000000000000))), 0 },
+ [_]i64{ @as(i64, @bitCast(@as(u64, 0x8000000000000007))), 8, @as(i64, @bitCast(@as(u64, 0xf000000000000001))), -1 },
+ };
test "test_divmoddi4" {
for (cases__divmoddi4) |case| {
@@ -215,19 +215,19 @@ pub fn __divmodsi4(a: i32, b: i32, rem: *i32) callconv(.C) i32 {
const cases__divmodsi4 =
[_][4]i32{
- [_]i32{ 0, 1, 0, 0 },
- [_]i32{ 0, -1, 0, 0 },
- [_]i32{ 2, 1, 2, 0 },
- [_]i32{ 2, -1, -2, 0 },
- [_]i32{ -2, 1, -2, 0 },
- [_]i32{ -2, -1, 2, 0 },
- [_]i32{ 7, 5, 1, 2 },
- [_]i32{ -7, 5, -1, -2 },
- [_]i32{ 19, 5, 3, 4 },
- [_]i32{ 19, -5, -3, 4 },
- [_]i32{ @bitCast(@as(u32, 0x80000000)), 8, @bitCast(@as(u32, 0xf0000000)), 0 },
- [_]i32{ @bitCast(@as(u32, 0x80000007)), 8, @bitCast(@as(u32, 0xf0000001)), -1 },
-};
+ [_]i32{ 0, 1, 0, 0 },
+ [_]i32{ 0, -1, 0, 0 },
+ [_]i32{ 2, 1, 2, 0 },
+ [_]i32{ 2, -1, -2, 0 },
+ [_]i32{ -2, 1, -2, 0 },
+ [_]i32{ -2, -1, 2, 0 },
+ [_]i32{ 7, 5, 1, 2 },
+ [_]i32{ -7, 5, -1, -2 },
+ [_]i32{ 19, 5, 3, 4 },
+ [_]i32{ 19, -5, -3, 4 },
+ [_]i32{ @bitCast(@as(u32, 0x80000000)), 8, @bitCast(@as(u32, 0xf0000000)), 0 },
+ [_]i32{ @bitCast(@as(u32, 0x80000007)), 8, @bitCast(@as(u32, 0xf0000001)), -1 },
+ };
fn test_one_divmodsi4(a: i32, b: i32, expected_q: i32, expected_r: i32) !void {
var r: i32 = undefined;
diff --git a/lib/compiler_rt/popcount.zig b/lib/compiler_rt/popcount.zig
index d54a4aab42..492423dda5 100644
--- a/lib/compiler_rt/popcount.zig
+++ b/lib/compiler_rt/popcount.zig
@@ -40,7 +40,7 @@ inline fn popcountXi2(comptime ST: type, a: ST) i32 {
var x: UT = @bitCast(a);
x -= (x >> 1) & (~@as(UT, 0) / 3); // 0x55...55, aggregate duos
x = ((x >> 2) & (~@as(UT, 0) / 5)) // 0x33...33, aggregate nibbles
- + (x & (~@as(UT, 0) / 5));
+ + (x & (~@as(UT, 0) / 5));
x += x >> 4;
x &= ~@as(UT, 0) / 17; // 0x0F...0F, aggregate bytes
// 8 most significant bits of x + (x<<8) + (x<<16) + ..
diff --git a/lib/docs/wasm/markdown/Parser.zig b/lib/docs/wasm/markdown/Parser.zig
index 1b5f40792e..fab43afa84 100644
--- a/lib/docs/wasm/markdown/Parser.zig
+++ b/lib/docs/wasm/markdown/Parser.zig
@@ -374,7 +374,7 @@ fn appendBlockStart(p: *Parser, block_start: BlockStart) !void {
// or not of the same marker type.
const should_close_list = last_pending_block.tag == .list and
(block_start.tag != .list_item or
- block_start.data.list_item.marker != last_pending_block.data.list.marker);
+ block_start.data.list_item.marker != last_pending_block.data.list.marker);
// The last block should also be closed if the new block is not a table
// row, which is the only allowed child of a table.
const should_close_table = last_pending_block.tag == .table and
diff --git a/lib/std/Target.zig b/lib/std/Target.zig
index 740949858f..2f1d2d599d 100644
--- a/lib/std/Target.zig
+++ b/lib/std/Target.zig
@@ -299,7 +299,7 @@ pub const Os = struct {
pub fn parse(str: []const u8) !WindowsVersion {
return std.meta.stringToEnum(WindowsVersion, str) orelse
@enumFromInt(std.fmt.parseInt(u32, str, 0) catch
- return error.InvalidOperatingSystemVersion);
+ return error.InvalidOperatingSystemVersion);
}
/// This function is defined to serialize a Zig source code representation of this
diff --git a/lib/std/c.zig b/lib/std/c.zig
index 498e7d14ca..9b7d36cb32 100644
--- a/lib/std/c.zig
+++ b/lib/std/c.zig
@@ -9879,10 +9879,10 @@ pub extern "c" fn setlocale(category: LC, locale: ?[*:0]const u8) ?[*:0]const u8
pub const getcontext = if (builtin.target.abi.isAndroid() or builtin.target.os.tag == .openbsd)
{} // android bionic and openbsd libc does not implement getcontext
-else if (native_os == .linux and builtin.target.abi.isMusl())
- linux.getcontext
-else
- private.getcontext;
+ else if (native_os == .linux and builtin.target.abi.isMusl())
+ linux.getcontext
+ else
+ private.getcontext;
pub const max_align_t = if (native_abi == .msvc or native_abi == .itanium)
f64
diff --git a/lib/std/crypto/tls/Client.zig b/lib/std/crypto/tls/Client.zig
index 09e5e0fdd5..738fe122dd 100644
--- a/lib/std/crypto/tls/Client.zig
+++ b/lib/std/crypto/tls/Client.zig
@@ -692,7 +692,7 @@ pub fn init(stream: anytype, options: Options) InitError(@TypeOf(stream))!Client
const client_key_exchange_msg = .{@intFromEnum(tls.ContentType.handshake)} ++
int(u16, @intFromEnum(tls.ProtocolVersion.tls_1_2)) ++
array(u16, u8, .{@intFromEnum(tls.HandshakeType.client_key_exchange)} ++
- array(u24, u8, array(u8, u8, key_share.secp256r1_kp.public_key.toUncompressedSec1())));
+ array(u24, u8, array(u8, u8, key_share.secp256r1_kp.public_key.toUncompressedSec1())));
const client_change_cipher_spec_msg = .{@intFromEnum(tls.ContentType.change_cipher_spec)} ++
int(u16, @intFromEnum(tls.ProtocolVersion.tls_1_2)) ++
array(u16, tls.ChangeCipherSpecType, .{.change_cipher_spec});
@@ -720,11 +720,11 @@ pub fn init(stream: anytype, options: Options) InitError(@TypeOf(stream))!Client
);
const client_verify_cleartext = .{@intFromEnum(tls.HandshakeType.finished)} ++
array(u24, u8, hmacExpandLabel(
- P.Hmac,
- &master_secret,
- &.{ "client finished", &p.transcript_hash.peek() },
- P.verify_data_length,
- ));
+ P.Hmac,
+ &master_secret,
+ &.{ "client finished", &p.transcript_hash.peek() },
+ P.verify_data_length,
+ ));
p.transcript_hash.update(&client_verify_cleartext);
p.version = .{ .tls_1_2 = .{
.expected_server_verify_data = hmacExpandLabel(
@@ -745,7 +745,7 @@ pub fn init(stream: anytype, options: Options) InitError(@TypeOf(stream))!Client
var client_verify_msg = .{@intFromEnum(tls.ContentType.handshake)} ++
int(u16, @intFromEnum(tls.ProtocolVersion.tls_1_2)) ++
array(u16, u8, nonce[P.fixed_iv_length..].* ++
- @as([client_verify_cleartext.len + P.mac_length]u8, undefined));
+ @as([client_verify_cleartext.len + P.mac_length]u8, undefined));
P.AEAD.encrypt(
client_verify_msg[client_verify_msg.len - P.mac_length -
client_verify_cleartext.len ..][0..client_verify_cleartext.len],
diff --git a/lib/std/debug/SelfInfo.zig b/lib/std/debug/SelfInfo.zig
index 0bd3f2d41b..ea7ecac4ed 100644
--- a/lib/std/debug/SelfInfo.zig
+++ b/lib/std/debug/SelfInfo.zig
@@ -689,15 +689,15 @@ pub const Module = switch (native_os) {
const o_file_path = mem.sliceTo(self.strings[symbol.ofile..], 0);
const o_file_info = self.ofiles.getPtr(o_file_path) orelse
(self.loadOFile(allocator, o_file_path) catch |err| switch (err) {
- error.FileNotFound,
- error.MissingDebugInfo,
- error.InvalidDebugInfo,
- => return .{
- .relocated_address = relocated_address,
- .symbol = symbol,
- },
- else => return err,
- });
+ error.FileNotFound,
+ error.MissingDebugInfo,
+ error.InvalidDebugInfo,
+ => return .{
+ .relocated_address = relocated_address,
+ .symbol = symbol,
+ },
+ else => return err,
+ });
return .{
.relocated_address = relocated_address,
diff --git a/lib/std/http/Client.zig b/lib/std/http/Client.zig
index 3560e69b58..86f29b4a08 100644
--- a/lib/std/http/Client.zig
+++ b/lib/std/http/Client.zig
@@ -960,13 +960,13 @@ pub const Request = struct {
pub const WaitError = RequestError || SendError || TransferReadError ||
proto.HeadersParser.CheckCompleteHeadError || Response.ParseError ||
error{
- TooManyHttpRedirects,
- RedirectRequiresResend,
- HttpRedirectLocationMissing,
- HttpRedirectLocationInvalid,
- CompressionInitializationFailed,
- CompressionUnsupported,
- };
+ TooManyHttpRedirects,
+ RedirectRequiresResend,
+ HttpRedirectLocationMissing,
+ HttpRedirectLocationInvalid,
+ CompressionInitializationFailed,
+ CompressionUnsupported,
+ };
/// Waits for a response from the server and parses any headers that are sent.
/// This function will block until the final response is received.
@@ -1540,12 +1540,12 @@ pub fn connect(
pub const RequestError = ConnectTcpError || ConnectErrorPartial || Request.SendError ||
std.fmt.ParseIntError || Connection.WriteError ||
error{
- UnsupportedUriScheme,
- UriMissingHost,
+ UnsupportedUriScheme,
+ UriMissingHost,
- CertificateBundleLoadFailure,
- UnsupportedTransferEncoding,
-};
+ CertificateBundleLoadFailure,
+ UnsupportedTransferEncoding,
+ };
pub const RequestOptions = struct {
version: http.Version = .@"HTTP/1.1",
diff --git a/lib/std/posix.zig b/lib/std/posix.zig
index 4dd93f719f..30cbcab6e9 100644
--- a/lib/std/posix.zig
+++ b/lib/std/posix.zig
@@ -2851,12 +2851,12 @@ pub fn renameatW(
rc =
windows.ntdll.NtSetInformationFile(
- src_fd,
- &io_status_block,
- rename_info,
- @intCast(struct_len), // already checked for error.NameTooLong
- .FileRenameInformation,
- );
+ src_fd,
+ &io_status_block,
+ rename_info,
+ @intCast(struct_len), // already checked for error.NameTooLong
+ .FileRenameInformation,
+ );
}
switch (rc) {
diff --git a/lib/std/zig/render.zig b/lib/std/zig/render.zig
index a24b5f5401..264a262a04 100644
--- a/lib/std/zig/render.zig
+++ b/lib/std/zig/render.zig
@@ -372,7 +372,7 @@ fn renderExpression(r: *Render, node: Ast.Node.Index, space: Space) Error!void {
if (!ais.indentStackEmpty() and
token_tags[i] != .colon and
((token_tags[i] != .semicolon and token_tags[i] != .comma) or
- ais.lastSpaceModeIndent() < ais.currentIndent()))
+ ais.lastSpaceModeIndent() < ais.currentIndent()))
{
ais.popIndent();
try ais.pushIndent(.normal);
@@ -1185,9 +1185,9 @@ fn renderVarDeclWithoutFixups(
{
const name_space = if (var_decl.ast.type_node == 0 and
(var_decl.ast.align_node != 0 or
- var_decl.ast.addrspace_node != 0 or
- var_decl.ast.section_node != 0 or
- var_decl.ast.init_node != 0))
+ var_decl.ast.addrspace_node != 0 or
+ var_decl.ast.section_node != 0 or
+ var_decl.ast.init_node != 0))
Space.space
else
Space.none;