From 5c8eda36d6de6e9858a7527af3a1e9851969189e Mon Sep 17 00:00:00 2001 From: Ahmed <111569638+0Ahmed-0@users.noreply.github.com> Date: Wed, 13 Mar 2024 22:30:48 +0000 Subject: [PATCH] chore: Fix some typos --- lib/compiler_rt/addf3.zig | 2 +- lib/compiler_rt/addo.zig | 2 +- lib/compiler_rt/divtf3.zig | 2 +- lib/compiler_rt/emutls.zig | 4 ++-- lib/compiler_rt/fmod.zig | 6 +++--- lib/compiler_rt/mulf3_test.zig | 2 +- lib/compiler_rt/rem_pio2_large.zig | 4 ++-- lib/compiler_rt/subo.zig | 2 +- test/standalone/stack_iterator/unwind.zig | 2 +- tools/update_spirv_features.zig | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/compiler_rt/addf3.zig b/lib/compiler_rt/addf3.zig index 8616e53e2b..ee6a2b6be4 100644 --- a/lib/compiler_rt/addf3.zig +++ b/lib/compiler_rt/addf3.zig @@ -114,7 +114,7 @@ pub inline fn addf3(comptime T: type, a: T, b: T) T { // If a == -b, return +zero. if (aSignificand == 0) return @bitCast(@as(Z, 0)); - // If partial cancellation occured, we need to left-shift the result + // If partial cancellation occurred, we need to left-shift the result // and adjust the exponent: if (aSignificand < integerBit << 3) { const shift = @as(i32, @intCast(@clz(aSignificand))) - @as(i32, @intCast(@clz(integerBit << 3))); diff --git a/lib/compiler_rt/addo.zig b/lib/compiler_rt/addo.zig index 2663dc5cae..8ce0d625da 100644 --- a/lib/compiler_rt/addo.zig +++ b/lib/compiler_rt/addo.zig @@ -25,7 +25,7 @@ inline fn addoXi4_generic(comptime ST: type, a: ST, b: ST, overflow: *c_int) ST // and the sign of a+b+carry is the same as a (or equivalently b). // Slower routine: res = ~(a ^ b) & ((sum ^ a) // Faster routine: res = (sum ^ a) & (sum ^ b) - // Overflow occured, iff (res < 0) + // Overflow occurred, iff (res < 0) if (((sum ^ a) & (sum ^ b)) < 0) overflow.* = 1; return sum; diff --git a/lib/compiler_rt/divtf3.zig b/lib/compiler_rt/divtf3.zig index 2e0d271ba2..1fcdae442e 100644 --- a/lib/compiler_rt/divtf3.zig +++ b/lib/compiler_rt/divtf3.zig @@ -140,7 +140,7 @@ inline fn div(a: f128, b: f128) f128 { var reciprocal: u128 = undefined; // NOTE: This operation is equivalent to __multi3, which is not implemented - // in some architechure + // in some architecture var r64q63: u128 = undefined; var r64q127: u128 = undefined; var r64cH: u128 = undefined; diff --git a/lib/compiler_rt/emutls.zig b/lib/compiler_rt/emutls.zig index 3a04012925..265fcb8782 100644 --- a/lib/compiler_rt/emutls.zig +++ b/lib/compiler_rt/emutls.zig @@ -145,7 +145,7 @@ const ObjectArray = struct { } }; -// Global stucture for Thread Storage. +// Global structure for Thread Storage. // It provides thread-safety for on-demand storage of Thread Objects. const current_thread_storage = struct { var key: std.c.pthread_key_t = undefined; @@ -358,7 +358,7 @@ test "__emutls_get_address with default_value" { try expect(y.* == 9012); // the modified storage persists } -test "test default_value with differents sizes" { +test "test default_value with different sizes" { if (!builtin.link_libc or builtin.os.tag != .openbsd) return error.SkipZigTest; const testType = struct { diff --git a/lib/compiler_rt/fmod.zig b/lib/compiler_rt/fmod.zig index 08e1ff892c..465d46e7f1 100644 --- a/lib/compiler_rt/fmod.zig +++ b/lib/compiler_rt/fmod.zig @@ -58,7 +58,7 @@ pub fn __fmodx(a: f80, b: f80) callconv(.C) f80 { // - fmodx(val, NaN) // - fmodx(inf, val) // The sign on checked values does not matter. - // Doing (a * b) / (a * b) procudes undefined results + // Doing (a * b) / (a * b) produces undefined results // because the three cases always produce undefined calculations: // - 0 / 0 // - val * NaN @@ -163,7 +163,7 @@ pub fn fmodq(a: f128, b: f128) callconv(.C) f128 { // - fmodq(val, NaN) // - fmodq(inf, val) // The sign on checked values does not matter. - // Doing (a * b) / (a * b) procudes undefined results + // Doing (a * b) / (a * b) produces undefined results // because the three cases always produce undefined calculations: // - 0 / 0 // - val * NaN @@ -239,7 +239,7 @@ pub fn fmodq(a: f128, b: f128) callconv(.C) f128 { aPtr_u64[high_index] = highA; aPtr_u64[low_index] = lowA; - // Combine the exponent with the sign, normalize if happend to be denormalized + // Combine the exponent with the sign, normalize if happened to be denormalized if (expA <= 0) { aPtr_u16[exp_and_sign_index] = @as(u16, @truncate(@as(u32, @bitCast((expA +% 120))))) | signA; amod *= 0x1p-120; diff --git a/lib/compiler_rt/mulf3_test.zig b/lib/compiler_rt/mulf3_test.zig index e770ecaefc..751b8933f6 100644 --- a/lib/compiler_rt/mulf3_test.zig +++ b/lib/compiler_rt/mulf3_test.zig @@ -13,7 +13,7 @@ const __muldf3 = @import("muldf3.zig").__muldf3; const __mulsf3 = @import("mulsf3.zig").__mulsf3; // return true if equal -// use two 64-bit integers intead of one 128-bit integer +// use two 64-bit integers instead of one 128-bit integer // because 128-bit integer constant can't be assigned directly fn compareResultLD(result: f128, expectedHi: u64, expectedLo: u64) bool { const rep: u128 = @bitCast(result); diff --git a/lib/compiler_rt/rem_pio2_large.zig b/lib/compiler_rt/rem_pio2_large.zig index e0e7ed0d08..a234fa6ab7 100644 --- a/lib/compiler_rt/rem_pio2_large.zig +++ b/lib/compiler_rt/rem_pio2_large.zig @@ -174,14 +174,14 @@ const PIo2 = [_]f64{ /// z = (z-x[i])*2**24 /// /// -/// y[] ouput result in an array of double precision numbers. +/// y[] output result in an array of double precision numbers. /// The dimension of y[] is: /// 24-bit precision 1 /// 53-bit precision 2 /// 64-bit precision 2 /// 113-bit precision 3 /// The actual value is the sum of them. Thus for 113-bit -/// precison, one may have to do something like: +/// precision, one may have to do something like: /// /// long double t,w,r_head, r_tail; /// t = (long double)y[2] + (long double)y[1]; diff --git a/lib/compiler_rt/subo.zig b/lib/compiler_rt/subo.zig index a14dd5e18e..7b0fd8086c 100644 --- a/lib/compiler_rt/subo.zig +++ b/lib/compiler_rt/subo.zig @@ -34,7 +34,7 @@ inline fn suboXi4_generic(comptime ST: type, a: ST, b: ST, overflow: *c_int) ST // and the sign of a-b-carry is opposite of a (or equivalently same as b). // Faster routine: res = (a ^ b) & (sum ^ a) // Slower routine: res = (sum^a) & ~(sum^b) - // Overflow occured, iff (res < 0) + // Overflow occurred, iff (res < 0) if (((a ^ b) & (sum ^ a)) < 0) overflow.* = 1; return sum; diff --git a/test/standalone/stack_iterator/unwind.zig b/test/standalone/stack_iterator/unwind.zig index 4bb459bdac..69c463a0c1 100644 --- a/test/standalone/stack_iterator/unwind.zig +++ b/test/standalone/stack_iterator/unwind.zig @@ -19,7 +19,7 @@ noinline fn frame3(expected: *[4]usize, unwound: *[4]usize) void { } noinline fn frame2(expected: *[4]usize, unwound: *[4]usize) void { - // Excercise different __unwind_info / DWARF CFI encodings by forcing some registers to be restored + // Exercise different __unwind_info / DWARF CFI encodings by forcing some registers to be restored if (builtin.target.ofmt != .c) { switch (builtin.cpu.arch) { .x86 => { diff --git a/tools/update_spirv_features.zig b/tools/update_spirv_features.zig index 0215c24507..9d6813b2fd 100644 --- a/tools/update_spirv_features.zig +++ b/tools/update_spirv_features.zig @@ -243,7 +243,7 @@ fn gather_extensions(allocator: Allocator, spirv_registry_root: []const u8) ![]c if (!std.mem.endsWith(u8, ext_entry.name, ".asciidoc")) continue; - // Unfortunately, some extension filenames are incorrect, so we need to look for the string in tne 'Name Strings' section. + // Unfortunately, some extension filenames are incorrect, so we need to look for the string in the 'Name Strings' section. // This has the following format: // ``` // Name Strings