diff --git a/lib/std/crypto/ml_kem.zig b/lib/std/crypto/ml_kem.zig index c3cb5805ee..23ea7bb8ec 100644 --- a/lib/std/crypto/ml_kem.zig +++ b/lib/std/crypto/ml_kem.zig @@ -677,10 +677,10 @@ fn montReduce(x: i32) i16 { // Note gcd(2¹⁶, q) = 1 as q is prime. Write q' := 62209 = q⁻¹ mod R. // First we compute // - // m := ((x mod R) q') mod R + // m := ((x mod R) q') mod R // = x q' mod R - // = int16(x q') - // = int16(int32(x) * int32(q')) + // = int16(x q') + // = int16(int32(x) * int32(q')) // // Note that x q' might be as big as 2³² and could overflow the int32 // multiplication in the last line. However for any int32s a and b, diff --git a/lib/std/macho.zig b/lib/std/macho.zig index d477befbc4..75aa91e536 100644 --- a/lib/std/macho.zig +++ b/lib/std/macho.zig @@ -203,8 +203,7 @@ pub const symtab_command = extern struct { /// local symbols (static and debugging symbols) - grouped by module /// defined external symbols - grouped by module (sorted by name if not lib) /// undefined external symbols (sorted by name if MH_BINDATLOAD is not set, -/// and in order the were seen by the static -/// linker if MH_BINDATLOAD is set) +/// and in order the were seen by the static linker if MH_BINDATLOAD is set) /// In this load command there are offsets and counts to each of the three groups /// of symbols. /// @@ -219,9 +218,9 @@ pub const symtab_command = extern struct { /// shared library. For executable and object modules, which are files /// containing only one module, the information that would be in these three /// tables is determined as follows: -/// table of contents - the defined external symbols are sorted by name -/// module table - the file contains only one module so everything in the -/// file is part of the module. +/// table of contents - the defined external symbols are sorted by name +/// module table - the file contains only one module so everything in the file +/// is part of the module. /// reference symbol table - is the defined and undefined external symbols /// /// For dynamically linked shared library files this load command also contains diff --git a/lib/std/zig/system/darwin/macos.zig b/lib/std/zig/system/darwin/macos.zig index bf26079e5a..0bc08b319c 100644 --- a/lib/std/zig/system/darwin/macos.zig +++ b/lib/std/zig/system/darwin/macos.zig @@ -303,16 +303,16 @@ test "detect" { \\ \\ \\ - \\ ProductBuildVersion - \\ 7W98 - \\ ProductCopyright - \\ Apple Computer, Inc. 1983-2004 - \\ ProductName - \\ Mac OS X - \\ ProductUserVisibleVersion - \\ 10.3.9 - \\ ProductVersion - \\ 10.3.9 + \\ ProductBuildVersion + \\ 7W98 + \\ ProductCopyright + \\ Apple Computer, Inc. 1983-2004 + \\ ProductName + \\ Mac OS X + \\ ProductUserVisibleVersion + \\ 10.3.9 + \\ ProductVersion + \\ 10.3.9 \\ \\ , @@ -323,18 +323,18 @@ test "detect" { \\ \\ \\ - \\ ProductBuildVersion - \\ 19G68 - \\ ProductCopyright - \\ 1983-2020 Apple Inc. - \\ ProductName - \\ Mac OS X - \\ ProductUserVisibleVersion - \\ 10.15.6 - \\ ProductVersion - \\ 10.15.6 - \\ iOSSupportVersion - \\ 13.6 + \\ ProductBuildVersion + \\ 19G68 + \\ ProductCopyright + \\ 1983-2020 Apple Inc. + \\ ProductName + \\ Mac OS X + \\ ProductUserVisibleVersion + \\ 10.15.6 + \\ ProductVersion + \\ 10.15.6 + \\ iOSSupportVersion + \\ 13.6 \\ \\ , @@ -345,18 +345,18 @@ test "detect" { \\ \\ \\ - \\ ProductBuildVersion - \\ 20A2408 - \\ ProductCopyright - \\ 1983-2020 Apple Inc. - \\ ProductName - \\ macOS - \\ ProductUserVisibleVersion - \\ 11.0 - \\ ProductVersion - \\ 11.0 - \\ iOSSupportVersion - \\ 14.2 + \\ ProductBuildVersion + \\ 20A2408 + \\ ProductCopyright + \\ 1983-2020 Apple Inc. + \\ ProductName + \\ macOS + \\ ProductUserVisibleVersion + \\ 11.0 + \\ ProductVersion + \\ 11.0 + \\ iOSSupportVersion + \\ 14.2 \\ \\ , @@ -367,18 +367,18 @@ test "detect" { \\ \\ \\ - \\ ProductBuildVersion - \\ 20C63 - \\ ProductCopyright - \\ 1983-2020 Apple Inc. - \\ ProductName - \\ macOS - \\ ProductUserVisibleVersion - \\ 11.1 - \\ ProductVersion - \\ 11.1 - \\ iOSSupportVersion - \\ 14.3 + \\ ProductBuildVersion + \\ 20C63 + \\ ProductCopyright + \\ 1983-2020 Apple Inc. + \\ ProductName + \\ macOS + \\ ProductUserVisibleVersion + \\ 11.1 + \\ ProductVersion + \\ 11.1 + \\ iOSSupportVersion + \\ 14.3 \\ \\ , diff --git a/lib/std/zig/system/linux.zig b/lib/std/zig/system/linux.zig index 5f58d6d926..7e37185f3e 100644 --- a/lib/std/zig/system/linux.zig +++ b/lib/std/zig/system/linux.zig @@ -109,12 +109,12 @@ const RiscvCpuinfoParser = CpuinfoParser(RiscvCpuinfoImpl); test "cpuinfo: RISC-V" { try testParser(RiscvCpuinfoParser, .riscv64, &Target.riscv.cpu.sifive_u74, - \\processor : 0 - \\hart : 1 - \\isa : rv64imafdc - \\mmu : sv39 - \\isa-ext : - \\uarch : sifive,u74-mc + \\processor : 0 + \\hart : 1 + \\isa : rv64imafdc + \\mmu : sv39 + \\isa-ext : + \\uarch : sifive,u74-mc ); } @@ -177,16 +177,16 @@ const PowerpcCpuinfoParser = CpuinfoParser(PowerpcCpuinfoImpl); test "cpuinfo: PowerPC" { try testParser(PowerpcCpuinfoParser, .powerpc, &Target.powerpc.cpu.@"970", - \\processor : 0 - \\cpu : PPC970MP, altivec supported - \\clock : 1250.000000MHz - \\revision : 1.1 (pvr 0044 0101) + \\processor : 0 + \\cpu : PPC970MP, altivec supported + \\clock : 1250.000000MHz + \\revision : 1.1 (pvr 0044 0101) ); try testParser(PowerpcCpuinfoParser, .powerpc64le, &Target.powerpc.cpu.pwr8, - \\processor : 0 - \\cpu : POWER8 (raw), altivec supported - \\clock : 2926.000000MHz - \\revision : 2.0 (pvr 004d 0200) + \\processor : 0 + \\cpu : POWER8 (raw), altivec supported + \\clock : 2926.000000MHz + \\revision : 2.0 (pvr 004d 0200) ); } @@ -304,25 +304,25 @@ test "cpuinfo: ARM" { \\CPU revision : 7 ); try testParser(ArmCpuinfoParser, .arm, &Target.arm.cpu.cortex_a7, - \\processor : 0 - \\model name : ARMv7 Processor rev 3 (v7l) - \\BogoMIPS : 18.00 - \\Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae - \\CPU implementer : 0x41 + \\processor : 0 + \\model name : ARMv7 Processor rev 3 (v7l) + \\BogoMIPS : 18.00 + \\Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae + \\CPU implementer : 0x41 \\CPU architecture: 7 - \\CPU variant : 0x0 - \\CPU part : 0xc07 - \\CPU revision : 3 + \\CPU variant : 0x0 + \\CPU part : 0xc07 + \\CPU revision : 3 \\ - \\processor : 4 - \\model name : ARMv7 Processor rev 3 (v7l) - \\BogoMIPS : 90.00 - \\Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae - \\CPU implementer : 0x41 + \\processor : 4 + \\model name : ARMv7 Processor rev 3 (v7l) + \\BogoMIPS : 90.00 + \\Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae + \\CPU implementer : 0x41 \\CPU architecture: 7 - \\CPU variant : 0x2 - \\CPU part : 0xc0f - \\CPU revision : 3 + \\CPU variant : 0x2 + \\CPU part : 0xc0f + \\CPU revision : 3 ); try testParser(ArmCpuinfoParser, .aarch64, &Target.aarch64.cpu.cortex_a72, \\processor : 0 diff --git a/src/link/tapi/yaml/test.zig b/src/link/tapi/yaml/test.zig index 8db9435885..d354a94b1d 100644 --- a/src/link/tapi/yaml/test.zig +++ b/src/link/tapi/yaml/test.zig @@ -237,10 +237,7 @@ test "double quoted string" { try testing.expectEqualStrings( \\"here" are some escaped quotes , arr[1]); - try testing.expectEqualStrings( - \\newlines and tabs - \\are supported - , arr[2]); + try testing.expectEqualStrings("newlines and tabs\nare\tsupported", arr[2]); try testing.expectEqualStrings( \\let's have \\some fun! diff --git a/test/run_translated_c.zig b/test/run_translated_c.zig index 744d08f27a..73aa7d01f4 100644 --- a/test/run_translated_c.zig +++ b/test/run_translated_c.zig @@ -26,17 +26,17 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void { \\void baz(void); \\struct foo { int x; }; \\void bar() { - \\ struct foo tmp; + \\ struct foo tmp; \\} \\ \\void baz() { - \\ struct foo tmp; + \\ struct foo tmp; \\} \\ \\int main(void) { - \\ bar(); - \\ baz(); - \\ return 0; + \\ bar(); + \\ baz(); + \\ return 0; \\} , ""); @@ -53,7 +53,7 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void { cases.add("parenthesized string literal", \\void foo(const char *s) {} \\int main(void) { - \\ foo(("bar")); + \\ foo(("bar")); \\} , ""); diff --git a/test/translate_c.zig b/test/translate_c.zig index c07b29f772..2100e23ea3 100644 --- a/test/translate_c.zig +++ b/test/translate_c.zig @@ -133,20 +133,20 @@ pub fn addCases(cases: *tests.TranslateCContext) void { cases.add("scoped typedef", \\void foo() { - \\ typedef union { - \\ int A; - \\ int B; - \\ int C; - \\ } Foo; - \\ Foo a = {0}; - \\ { - \\ typedef union { - \\ int A; - \\ int B; - \\ int C; - \\ } Foo; - \\ Foo a = {0}; - \\ } + \\ typedef union { + \\ int A; + \\ int B; + \\ int C; + \\ } Foo; + \\ Foo a = {0}; + \\ { + \\ typedef union { + \\ int A; + \\ int B; + \\ int C; + \\ } Foo; + \\ Foo a = {0}; + \\ } \\} , &[_][]const u8{ \\pub export fn foo() void { @@ -2043,18 +2043,18 @@ pub fn addCases(cases: *tests.TranslateCContext) void { \\ break; \\ } \\ case 4: - \\ case 5: + \\ case 5: \\ res = 69; \\ { \\ res = 5; - \\ return; + \\ return; \\ } \\ case 6: \\ switch (res) { \\ case 9: break; \\ } \\ res = 1; - \\ return; + \\ return; \\ } \\} , &[_][]const u8{