authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-28 22:58:12-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-04-28 22:58:12-07:00
logc60d8f017ea698c5fe4c7c6046f8ca09f0b8bf1d
treebbb3db8d212f7612bc5d81f6754f33a060b06ae2
parent0c71d2fdc1cfa251b1c45a93724240a052c77a92

std: remove redundant comptime keyword

@g-w1's fancy new compile error in action

12 files changed, 26 insertions(+), 26 deletions(-)

lib/std/crypto/25519/edwards25519.zig+2-2
......@@ -226,12 +226,12 @@ pub const Edwards25519 = struct {
226226 return pc;
227227 }
228228
229 const basePointPc = comptime pc: {
229 const basePointPc = pc: {
230230 @setEvalBranchQuota(10000);
231231 break :pc precompute(Edwards25519.basePoint, 15);
232232 };
233233
234 const basePointPc8 = comptime pc: {
234 const basePointPc8 = pc: {
235235 @setEvalBranchQuota(10000);
236236 break :pc precompute(Edwards25519.basePoint, 8);
237237 };
lib/std/crypto/25519/field.zig+1-1
......@@ -292,7 +292,7 @@ pub const Fe = struct {
292292 return _carry128(&r);
293293 }
294294
295 fn _sq(a: Fe, double: comptime bool) callconv(.Inline) Fe {
295 fn _sq(a: Fe, double: bool) callconv(.Inline) Fe {
296296 var ax: [5]u128 = undefined;
297297 var r: [5]u128 = undefined;
298298 comptime var i = 0;
lib/std/crypto/aes.zig+3-3
......@@ -8,9 +8,9 @@ const std = @import("../std.zig");
88const testing = std.testing;
99const builtin = std.builtin;
1010
11const has_aesni = comptime std.Target.x86.featureSetHas(std.Target.current.cpu.features, .aes);
12const has_avx = comptime std.Target.x86.featureSetHas(std.Target.current.cpu.features, .avx);
13const has_armaes = comptime std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes);
11const has_aesni = std.Target.x86.featureSetHas(std.Target.current.cpu.features, .aes);
12const has_avx = std.Target.x86.featureSetHas(std.Target.current.cpu.features, .avx);
13const has_armaes = std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes);
1414const impl = if (std.Target.current.cpu.arch == .x86_64 and has_aesni and has_avx) impl: {
1515 break :impl @import("aes/aesni.zig");
1616} else if (std.Target.current.cpu.arch == .aarch64 and has_armaes)
lib/std/crypto/aes_ocb.zig+2-2
......@@ -106,8 +106,8 @@ fn AesOcb(comptime Aes: anytype) type {
106106 return offset;
107107 }
108108
109 const has_aesni = comptime std.Target.x86.featureSetHas(std.Target.current.cpu.features, .aes);
110 const has_armaes = comptime std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes);
109 const has_aesni = std.Target.x86.featureSetHas(std.Target.current.cpu.features, .aes);
110 const has_armaes = std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes);
111111 const wb: usize = if ((std.Target.current.cpu.arch == .x86_64 and has_aesni) or (std.Target.current.cpu.arch == .aarch64 and has_armaes)) 4 else 0;
112112
113113 /// c: ciphertext: output buffer should be of size m.len
lib/std/crypto/ghash.zig+3-3
......@@ -137,9 +137,9 @@ pub const Ghash = struct {
137137 return z0 | z1 | z2 | z3;
138138 }
139139
140 const has_pclmul = comptime std.Target.x86.featureSetHas(std.Target.current.cpu.features, .pclmul);
141 const has_avx = comptime std.Target.x86.featureSetHas(std.Target.current.cpu.features, .avx);
142 const has_armaes = comptime std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes);
140 const has_pclmul = std.Target.x86.featureSetHas(std.Target.current.cpu.features, .pclmul);
141 const has_avx = std.Target.x86.featureSetHas(std.Target.current.cpu.features, .avx);
142 const has_armaes = std.Target.aarch64.featureSetHas(std.Target.current.cpu.features, .aes);
143143 const clmul = if (std.Target.current.cpu.arch == .x86_64 and has_pclmul and has_avx) impl: {
144144 break :impl clmul_pclmul;
145145 } else if (std.Target.current.cpu.arch == .aarch64 and has_armaes) impl: {
lib/std/crypto/modes.zig+1-1
......@@ -16,7 +16,7 @@ const debug = std.debug;
1616///
1717/// Important: the counter mode doesn't provide authenticated encryption: the ciphertext can be trivially modified without this being detected.
1818/// As a result, applications should generally never use it directly, but only in a construction that includes a MAC.
19pub fn ctr(comptime BlockCipher: anytype, block_cipher: BlockCipher, dst: []u8, src: []const u8, iv: [BlockCipher.block_length]u8, endian: comptime builtin.Endian) void {
19pub fn ctr(comptime BlockCipher: anytype, block_cipher: BlockCipher, dst: []u8, src: []const u8, iv: [BlockCipher.block_length]u8, endian: builtin.Endian) void {
2020 debug.assert(dst.len >= src.len);
2121 const block_length = BlockCipher.block_length;
2222 var counter: [BlockCipher.block_length]u8 = undefined;
lib/std/crypto/poly1305.zig+1-1
......@@ -39,7 +39,7 @@ pub const Poly1305 = struct {
3939 };
4040 }
4141
42 fn blocks(st: *Poly1305, m: []const u8, last: comptime bool) void {
42 fn blocks(st: *Poly1305, m: []const u8, last: bool) void {
4343 const hibit: u64 = if (last) 0 else 1 << 40;
4444 const r0 = st.r[0];
4545 const r1 = st.r[1];
lib/std/debug.zig+3-3
......@@ -353,18 +353,18 @@ pub const StackIterator = struct {
353353 }
354354
355355 // Offset of the saved BP wrt the frame pointer.
356 const fp_offset = if (comptime native_arch.isRISCV())
356 const fp_offset = if (native_arch.isRISCV())
357357 // On RISC-V the frame pointer points to the top of the saved register
358358 // area, on pretty much every other architecture it points to the stack
359359 // slot where the previous frame pointer is saved.
360360 2 * @sizeOf(usize)
361 else if (comptime native_arch.isSPARC())
361 else if (native_arch.isSPARC())
362362 // On SPARC the previous frame pointer is stored at 14 slots past %fp+BIAS.
363363 14 * @sizeOf(usize)
364364 else
365365 0;
366366
367 const fp_bias = if (comptime native_arch.isSPARC())
367 const fp_bias = if (native_arch.isSPARC())
368368 // On SPARC frame pointers are biased by a constant.
369369 2047
370370 else
lib/std/hash/crc.zig+2-2
......@@ -28,7 +28,7 @@ pub const Crc32 = Crc32WithPoly(.IEEE);
2828pub fn Crc32WithPoly(comptime poly: Polynomial) type {
2929 return struct {
3030 const Self = @This();
31 const lookup_tables = comptime block: {
31 const lookup_tables = block: {
3232 @setEvalBranchQuota(20000);
3333 var tables: [8][256]u32 = undefined;
3434
......@@ -128,7 +128,7 @@ test "crc32 castagnoli" {
128128pub fn Crc32SmallWithPoly(comptime poly: Polynomial) type {
129129 return struct {
130130 const Self = @This();
131 const lookup_table = comptime block: {
131 const lookup_table = block: {
132132 var table: [16]u32 = undefined;
133133
134134 for (table) |*e, i| {
lib/std/heap.zig+3-3
......@@ -28,17 +28,17 @@ const CAllocator = struct {
2828 }
2929 }
3030
31 usingnamespace if (comptime @hasDecl(c, "malloc_size"))
31 usingnamespace if (@hasDecl(c, "malloc_size"))
3232 struct {
3333 pub const supports_malloc_size = true;
3434 pub const malloc_size = c.malloc_size;
3535 }
36 else if (comptime @hasDecl(c, "malloc_usable_size"))
36 else if (@hasDecl(c, "malloc_usable_size"))
3737 struct {
3838 pub const supports_malloc_size = true;
3939 pub const malloc_size = c.malloc_usable_size;
4040 }
41 else if (comptime @hasDecl(c, "_msize"))
41 else if (@hasDecl(c, "_msize"))
4242 struct {
4343 pub const supports_malloc_size = true;
4444 pub const malloc_size = c._msize;
lib/std/io/bit_reader.zig+3-3
......@@ -23,9 +23,9 @@ pub fn BitReader(endian: builtin.Endian, comptime ReaderType: type) type {
2323 pub const Reader = io.Reader(*Self, Error, read);
2424
2525 const Self = @This();
26 const u8_bit_count = comptime meta.bitCount(u8);
27 const u7_bit_count = comptime meta.bitCount(u7);
28 const u4_bit_count = comptime meta.bitCount(u4);
26 const u8_bit_count = meta.bitCount(u8);
27 const u7_bit_count = meta.bitCount(u7);
28 const u4_bit_count = meta.bitCount(u4);
2929
3030 pub fn init(forward_reader: ReaderType) Self {
3131 return Self{
lib/std/io/bit_writer.zig+2-2
......@@ -23,8 +23,8 @@ pub fn BitWriter(endian: builtin.Endian, comptime WriterType: type) type {
2323 pub const Writer = io.Writer(*Self, Error, write);
2424
2525 const Self = @This();
26 const u8_bit_count = comptime meta.bitCount(u8);
27 const u4_bit_count = comptime meta.bitCount(u4);
26 const u8_bit_count = meta.bitCount(u8);
27 const u4_bit_count = meta.bitCount(u4);
2828
2929 pub fn init(forward_writer: WriterType) Self {
3030 return Self{