authorgravatar for me@tadeo.caTadeo Kondrak <me@tadeo.ca> 2021-01-11 08:03:09-07:00
committergravatar for me@tadeo.caTadeo Kondrak <me@tadeo.ca> 2021-02-10 20:06:12-07:00
log5dfe0e7e8fabd3cfc3fdf5c7099791da98899903
tree9232489bf17f8ac7dec688277dcfcc1792849d3e
parent9c797fe3ac3a377caa01bdbd74b984d11b53398e
signature Commit is signed but in an unrecognized format.

Convert inline fn to callconv(.Inline) everywhere


36 files changed, 199 insertions(+), 199 deletions(-)

doc/langref.html.in+2-2
......@@ -4240,9 +4240,9 @@ fn _start() callconv(.Naked) noreturn {
42404240 abort();
42414241}
42424242
4243// The inline specifier forces a function to be inlined at all call sites.
4243// The inline calling convention forces a function to be inlined at all call sites.
42444244// If the function cannot be inlined, it is a compile-time error.
4245inline fn shiftLeftOne(a: u32) u32 {
4245fn shiftLeftOne(a: u32) callconv(.Inline) u32 {
42464246 return a << 1;
42474247}
42484248
lib/std/c/builtins.zig+49-49
......@@ -6,70 +6,70 @@
66
77const std = @import("std");
88
9pub inline fn __builtin_bswap16(val: u16) callconv(.C) u16 { return @byteSwap(u16, val); }
10pub inline fn __builtin_bswap32(val: u32) callconv(.C) u32 { return @byteSwap(u32, val); }
11pub inline fn __builtin_bswap64(val: u64) callconv(.C) u64 { return @byteSwap(u64, val); }
9pub fn __builtin_bswap16(val: u16) callconv(.Inline) u16 { return @byteSwap(u16, val); }
10pub fn __builtin_bswap32(val: u32) callconv(.Inline) u32 { return @byteSwap(u32, val); }
11pub fn __builtin_bswap64(val: u64) callconv(.Inline) u64 { return @byteSwap(u64, val); }
1212
13pub inline fn __builtin_signbit(val: f64) callconv(.C) c_int { return @boolToInt(std.math.signbit(val)); }
14pub inline fn __builtin_signbitf(val: f32) callconv(.C) c_int { return @boolToInt(std.math.signbit(val)); }
13pub fn __builtin_signbit(val: f64) callconv(.Inline) c_int { return @boolToInt(std.math.signbit(val)); }
14pub fn __builtin_signbitf(val: f32) callconv(.Inline) c_int { return @boolToInt(std.math.signbit(val)); }
1515
16pub inline fn __builtin_popcount(val: c_uint) callconv(.C) c_int {
16pub fn __builtin_popcount(val: c_uint) callconv(.Inline) c_int {
1717 // popcount of a c_uint will never exceed the capacity of a c_int
1818 @setRuntimeSafety(false);
1919 return @bitCast(c_int, @as(c_uint, @popCount(c_uint, val)));
2020}
21pub inline fn __builtin_ctz(val: c_uint) callconv(.C) c_int {
21pub fn __builtin_ctz(val: c_uint) callconv(.Inline) c_int {
2222 // Returns the number of trailing 0-bits in val, starting at the least significant bit position.
2323 // In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint
2424 @setRuntimeSafety(false);
2525 return @bitCast(c_int, @as(c_uint, @ctz(c_uint, val)));
2626}
27pub inline fn __builtin_clz(val: c_uint) callconv(.C) c_int {
27pub fn __builtin_clz(val: c_uint) callconv(.Inline) c_int {
2828 // Returns the number of leading 0-bits in x, starting at the most significant bit position.
2929 // In C if `val` is 0, the result is undefined; in zig it's the number of bits in a c_uint
3030 @setRuntimeSafety(false);
3131 return @bitCast(c_int, @as(c_uint, @clz(c_uint, val)));
3232}
3333
34pub inline fn __builtin_sqrt(val: f64) callconv(.C) f64 { return @sqrt(val); }
35pub inline fn __builtin_sqrtf(val: f32) callconv(.C) f32 { return @sqrt(val); }
36
37pub inline fn __builtin_sin(val: f64) callconv(.C) f64 { return @sin(val); }
38pub inline fn __builtin_sinf(val: f32) callconv(.C) f32 { return @sin(val); }
39pub inline fn __builtin_cos(val: f64) callconv(.C) f64 { return @cos(val); }
40pub inline fn __builtin_cosf(val: f32) callconv(.C) f32 { return @cos(val); }
41
42pub inline fn __builtin_exp(val: f64) callconv(.C) f64 { return @exp(val); }
43pub inline fn __builtin_expf(val: f32) callconv(.C) f32 { return @exp(val); }
44pub inline fn __builtin_exp2(val: f64) callconv(.C) f64 { return @exp2(val); }
45pub inline fn __builtin_exp2f(val: f32) callconv(.C) f32 { return @exp2(val); }
46pub inline fn __builtin_log(val: f64) callconv(.C) f64 { return @log(val); }
47pub inline fn __builtin_logf(val: f32) callconv(.C) f32 { return @log(val); }
48pub inline fn __builtin_log2(val: f64) callconv(.C) f64 { return @log2(val); }
49pub inline fn __builtin_log2f(val: f32) callconv(.C) f32 { return @log2(val); }
50pub inline fn __builtin_log10(val: f64) callconv(.C) f64 { return @log10(val); }
51pub inline fn __builtin_log10f(val: f32) callconv(.C) f32 { return @log10(val); }
34pub fn __builtin_sqrt(val: f64) callconv(.Inline) f64 { return @sqrt(val); }
35pub fn __builtin_sqrtf(val: f32) callconv(.Inline) f32 { return @sqrt(val); }
36
37pub fn __builtin_sin(val: f64) callconv(.Inline) f64 { return @sin(val); }
38pub fn __builtin_sinf(val: f32) callconv(.Inline) f32 { return @sin(val); }
39pub fn __builtin_cos(val: f64) callconv(.Inline) f64 { return @cos(val); }
40pub fn __builtin_cosf(val: f32) callconv(.Inline) f32 { return @cos(val); }
41
42pub fn __builtin_exp(val: f64) callconv(.Inline) f64 { return @exp(val); }
43pub fn __builtin_expf(val: f32) callconv(.Inline) f32 { return @exp(val); }
44pub fn __builtin_exp2(val: f64) callconv(.Inline) f64 { return @exp2(val); }
45pub fn __builtin_exp2f(val: f32) callconv(.Inline) f32 { return @exp2(val); }
46pub fn __builtin_log(val: f64) callconv(.Inline) f64 { return @log(val); }
47pub fn __builtin_logf(val: f32) callconv(.Inline) f32 { return @log(val); }
48pub fn __builtin_log2(val: f64) callconv(.Inline) f64 { return @log2(val); }
49pub fn __builtin_log2f(val: f32) callconv(.Inline) f32 { return @log2(val); }
50pub fn __builtin_log10(val: f64) callconv(.Inline) f64 { return @log10(val); }
51pub fn __builtin_log10f(val: f32) callconv(.Inline) f32 { return @log10(val); }
5252
5353// Standard C Library bug: The absolute value of the most negative integer remains negative.
54pub inline fn __builtin_abs(val: c_int) callconv(.C) c_int { return std.math.absInt(val) catch std.math.minInt(c_int); }
55pub inline fn __builtin_fabs(val: f64) callconv(.C) f64 { return @fabs(val); }
56pub inline fn __builtin_fabsf(val: f32) callconv(.C) f32 { return @fabs(val); }
57
58pub inline fn __builtin_floor(val: f64) callconv(.C) f64 { return @floor(val); }
59pub inline fn __builtin_floorf(val: f32) callconv(.C) f32 { return @floor(val); }
60pub inline fn __builtin_ceil(val: f64) callconv(.C) f64 { return @ceil(val); }
61pub inline fn __builtin_ceilf(val: f32) callconv(.C) f32 { return @ceil(val); }
62pub inline fn __builtin_trunc(val: f64) callconv(.C) f64 { return @trunc(val); }
63pub inline fn __builtin_truncf(val: f32) callconv(.C) f32 { return @trunc(val); }
64pub inline fn __builtin_round(val: f64) callconv(.C) f64 { return @round(val); }
65pub inline fn __builtin_roundf(val: f32) callconv(.C) f32 { return @round(val); }
66
67pub inline fn __builtin_strlen(s: [*c]const u8) callconv(.C) usize { return std.mem.lenZ(s); }
68pub inline fn __builtin_strcmp(s1: [*c]const u8, s2: [*c]const u8) callconv(.C) c_int {
54pub fn __builtin_abs(val: c_int) callconv(.Inline) c_int { return std.math.absInt(val) catch std.math.minInt(c_int); }
55pub fn __builtin_fabs(val: f64) callconv(.Inline) f64 { return @fabs(val); }
56pub fn __builtin_fabsf(val: f32) callconv(.Inline) f32 { return @fabs(val); }
57
58pub fn __builtin_floor(val: f64) callconv(.Inline) f64 { return @floor(val); }
59pub fn __builtin_floorf(val: f32) callconv(.Inline) f32 { return @floor(val); }
60pub fn __builtin_ceil(val: f64) callconv(.Inline) f64 { return @ceil(val); }
61pub fn __builtin_ceilf(val: f32) callconv(.Inline) f32 { return @ceil(val); }
62pub fn __builtin_trunc(val: f64) callconv(.Inline) f64 { return @trunc(val); }
63pub fn __builtin_truncf(val: f32) callconv(.Inline) f32 { return @trunc(val); }
64pub fn __builtin_round(val: f64) callconv(.Inline) f64 { return @round(val); }
65pub fn __builtin_roundf(val: f32) callconv(.Inline) f32 { return @round(val); }
66
67pub fn __builtin_strlen(s: [*c]const u8) callconv(.Inline) usize { return std.mem.lenZ(s); }
68pub fn __builtin_strcmp(s1: [*c]const u8, s2: [*c]const u8) callconv(.Inline) c_int {
6969 return @as(c_int, std.cstr.cmp(s1, s2));
7070}
7171
72pub inline fn __builtin_object_size(ptr: ?*const c_void, ty: c_int) callconv(.C) usize {
72pub fn __builtin_object_size(ptr: ?*const c_void, ty: c_int) callconv(.Inline) usize {
7373 // clang semantics match gcc's: https://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html
7474 // If it is not possible to determine which objects ptr points to at compile time,
7575 // __builtin_object_size should return (size_t) -1 for type 0 or 1 and (size_t) 0
......@@ -79,37 +79,37 @@ pub inline fn __builtin_object_size(ptr: ?*const c_void, ty: c_int) callconv(.C)
7979 unreachable;
8080}
8181
82pub inline fn __builtin___memset_chk(
82pub fn __builtin___memset_chk(
8383 dst: ?*c_void,
8484 val: c_int,
8585 len: usize,
8686 remaining: usize,
87) callconv(.C) ?*c_void {
87) callconv(.Inline) ?*c_void {
8888 if (len > remaining) @panic("std.c.builtins.memset_chk called with len > remaining");
8989 return __builtin_memset(dst, val, len);
9090}
9191
92pub inline fn __builtin_memset(dst: ?*c_void, val: c_int, len: usize) callconv(.C) ?*c_void {
92pub fn __builtin_memset(dst: ?*c_void, val: c_int, len: usize) callconv(.Inline) ?*c_void {
9393 const dst_cast = @ptrCast([*c]u8, dst);
9494 @memset(dst_cast, @bitCast(u8, @truncate(i8, val)), len);
9595 return dst;
9696}
9797
98pub inline fn __builtin___memcpy_chk(
98pub fn __builtin___memcpy_chk(
9999 noalias dst: ?*c_void,
100100 noalias src: ?*const c_void,
101101 len: usize,
102102 remaining: usize,
103) callconv(.C) ?*c_void {
103) callconv(.Inline) ?*c_void {
104104 if (len > remaining) @panic("std.c.builtins.memcpy_chk called with len > remaining");
105105 return __builtin_memcpy(dst, src, len);
106106}
107107
108pub inline fn __builtin_memcpy(
108pub fn __builtin_memcpy(
109109 noalias dst: ?*c_void,
110110 noalias src: ?*const c_void,
111111 len: usize,
112) callconv(.C) ?*c_void {
112) callconv(.Inline) ?*c_void {
113113 const dst_cast = @ptrCast([*c]u8, dst);
114114 const src_cast = @ptrCast([*c]const u8, src);
115115
lib/std/compress/deflate.zig+1-1
......@@ -209,7 +209,7 @@ pub fn InflateStream(comptime ReaderType: type) type {
209209
210210 // Insert a single byte into the window.
211211 // Assumes there's enough space.
212 inline fn appendUnsafe(self: *WSelf, value: u8) void {
212 fn appendUnsafe(self: *WSelf, value: u8) callconv(.Inline) void {
213213 self.buf[self.wi] = value;
214214 self.wi = (self.wi + 1) & (self.buf.len - 1);
215215 self.el += 1;
lib/std/crypto/25519/curve25519.zig+2-2
......@@ -15,12 +15,12 @@ pub const Curve25519 = struct {
1515 x: Fe,
1616
1717 /// Decode a Curve25519 point from its compressed (X) coordinates.
18 pub inline fn fromBytes(s: [32]u8) Curve25519 {
18 pub fn fromBytes(s: [32]u8) callconv(.Inline) Curve25519 {
1919 return .{ .x = Fe.fromBytes(s) };
2020 }
2121
2222 /// Encode a Curve25519 point.
23 pub inline fn toBytes(p: Curve25519) [32]u8 {
23 pub fn toBytes(p: Curve25519) callconv(.Inline) [32]u8 {
2424 return p.x.toBytes();
2525 }
2626
lib/std/crypto/25519/edwards25519.zig+3-3
......@@ -92,7 +92,7 @@ pub const Edwards25519 = struct {
9292 }
9393
9494 /// Flip the sign of the X coordinate.
95 pub inline fn neg(p: Edwards25519) Edwards25519 {
95 pub fn neg(p: Edwards25519) callconv(.Inline) Edwards25519 {
9696 return .{ .x = p.x.neg(), .y = p.y, .z = p.z, .t = p.t.neg() };
9797 }
9898
......@@ -137,14 +137,14 @@ pub const Edwards25519 = struct {
137137 return p.add(q.neg());
138138 }
139139
140 inline fn cMov(p: *Edwards25519, a: Edwards25519, c: u64) void {
140 fn cMov(p: *Edwards25519, a: Edwards25519, c: u64) callconv(.Inline) void {
141141 p.x.cMov(a.x, c);
142142 p.y.cMov(a.y, c);
143143 p.z.cMov(a.z, c);
144144 p.t.cMov(a.t, c);
145145 }
146146
147 inline fn pcSelect(comptime n: usize, pc: [n]Edwards25519, b: u8) Edwards25519 {
147 fn pcSelect(comptime n: usize, pc: [n]Edwards25519, b: u8) callconv(.Inline) Edwards25519 {
148148 var t = Edwards25519.identityElement;
149149 comptime var i: u8 = 1;
150150 inline while (i < pc.len) : (i += 1) {
lib/std/crypto/25519/field.zig+14-14
......@@ -52,7 +52,7 @@ pub const Fe = struct {
5252 pub const edwards25519sqrtam2 = Fe{ .limbs = .{ 1693982333959686, 608509411481997, 2235573344831311, 947681270984193, 266558006233600 } };
5353
5454 /// Return true if the field element is zero
55 pub inline fn isZero(fe: Fe) bool {
55 pub fn isZero(fe: Fe) callconv(.Inline) bool {
5656 var reduced = fe;
5757 reduced.reduce();
5858 const limbs = reduced.limbs;
......@@ -60,7 +60,7 @@ pub const Fe = struct {
6060 }
6161
6262 /// Return true if both field elements are equivalent
63 pub inline fn equivalent(a: Fe, b: Fe) bool {
63 pub fn equivalent(a: Fe, b: Fe) callconv(.Inline) bool {
6464 return a.sub(b).isZero();
6565 }
6666
......@@ -164,7 +164,7 @@ pub const Fe = struct {
164164 }
165165
166166 /// Add a field element
167 pub inline fn add(a: Fe, b: Fe) Fe {
167 pub fn add(a: Fe, b: Fe) callconv(.Inline) Fe {
168168 var fe: Fe = undefined;
169169 comptime var i = 0;
170170 inline while (i < 5) : (i += 1) {
......@@ -174,7 +174,7 @@ pub const Fe = struct {
174174 }
175175
176176 /// Substract a field elememnt
177 pub inline fn sub(a: Fe, b: Fe) Fe {
177 pub fn sub(a: Fe, b: Fe) callconv(.Inline) Fe {
178178 var fe = b;
179179 comptime var i = 0;
180180 inline while (i < 4) : (i += 1) {
......@@ -193,17 +193,17 @@ pub const Fe = struct {
193193 }
194194
195195 /// Negate a field element
196 pub inline fn neg(a: Fe) Fe {
196 pub fn neg(a: Fe) callconv(.Inline) Fe {
197197 return zero.sub(a);
198198 }
199199
200200 /// Return true if a field element is negative
201 pub inline fn isNegative(a: Fe) bool {
201 pub fn isNegative(a: Fe) callconv(.Inline) bool {
202202 return (a.toBytes()[0] & 1) != 0;
203203 }
204204
205205 /// Conditonally replace a field element with `a` if `c` is positive
206 pub inline fn cMov(fe: *Fe, a: Fe, c: u64) void {
206 pub fn cMov(fe: *Fe, a: Fe, c: u64) callconv(.Inline) void {
207207 const mask: u64 = 0 -% c;
208208 var x = fe.*;
209209 comptime var i = 0;
......@@ -244,7 +244,7 @@ pub const Fe = struct {
244244 }
245245 }
246246
247 inline fn _carry128(r: *[5]u128) Fe {
247 fn _carry128(r: *[5]u128) callconv(.Inline) Fe {
248248 var rs: [5]u64 = undefined;
249249 comptime var i = 0;
250250 inline while (i < 4) : (i += 1) {
......@@ -265,7 +265,7 @@ pub const Fe = struct {
265265 }
266266
267267 /// Multiply two field elements
268 pub inline fn mul(a: Fe, b: Fe) Fe {
268 pub fn mul(a: Fe, b: Fe) callconv(.Inline) Fe {
269269 var ax: [5]u128 = undefined;
270270 var bx: [5]u128 = undefined;
271271 var a19: [5]u128 = undefined;
......@@ -288,7 +288,7 @@ pub const Fe = struct {
288288 return _carry128(&r);
289289 }
290290
291 inline fn _sq(a: Fe, double: comptime bool) Fe {
291 fn _sq(a: Fe, double: comptime bool) callconv(.Inline) Fe {
292292 var ax: [5]u128 = undefined;
293293 var r: [5]u128 = undefined;
294294 comptime var i = 0;
......@@ -317,17 +317,17 @@ pub const Fe = struct {
317317 }
318318
319319 /// Square a field element
320 pub inline fn sq(a: Fe) Fe {
320 pub fn sq(a: Fe) callconv(.Inline) Fe {
321321 return _sq(a, false);
322322 }
323323
324324 /// Square and double a field element
325 pub inline fn sq2(a: Fe) Fe {
325 pub fn sq2(a: Fe) callconv(.Inline) Fe {
326326 return _sq(a, true);
327327 }
328328
329329 /// Multiply a field element with a small (32-bit) integer
330 pub inline fn mul32(a: Fe, comptime n: u32) Fe {
330 pub fn mul32(a: Fe, comptime n: u32) callconv(.Inline) Fe {
331331 const sn = @intCast(u128, n);
332332 var fe: Fe = undefined;
333333 var x: u128 = 0;
......@@ -342,7 +342,7 @@ pub const Fe = struct {
342342 }
343343
344344 /// Square a field element `n` times
345 inline fn sqn(a: Fe, comptime n: comptime_int) Fe {
345 fn sqn(a: Fe, comptime n: comptime_int) callconv(.Inline) Fe {
346346 var i: usize = 0;
347347 var fe = a;
348348 while (i < n) : (i += 1) {
lib/std/crypto/25519/ristretto255.zig+4-4
......@@ -42,7 +42,7 @@ pub const Ristretto255 = struct {
4242 }
4343
4444 /// Reject the neutral element.
45 pub inline fn rejectIdentity(p: Ristretto255) !void {
45 pub fn rejectIdentity(p: Ristretto255) callconv(.Inline) !void {
4646 return p.p.rejectIdentity();
4747 }
4848
......@@ -141,19 +141,19 @@ pub const Ristretto255 = struct {
141141 }
142142
143143 /// Double a Ristretto255 element.
144 pub inline fn dbl(p: Ristretto255) Ristretto255 {
144 pub fn dbl(p: Ristretto255) callconv(.Inline) Ristretto255 {
145145 return .{ .p = p.p.dbl() };
146146 }
147147
148148 /// Add two Ristretto255 elements.
149 pub inline fn add(p: Ristretto255, q: Ristretto255) Ristretto255 {
149 pub fn add(p: Ristretto255, q: Ristretto255) callconv(.Inline) Ristretto255 {
150150 return .{ .p = p.p.add(q.p) };
151151 }
152152
153153 /// Multiply a Ristretto255 element with a scalar.
154154 /// Return error.WeakPublicKey if the resulting element is
155155 /// the identity element.
156 pub inline fn mul(p: Ristretto255, s: [encoded_length]u8) !Ristretto255 {
156 pub fn mul(p: Ristretto255, s: [encoded_length]u8) callconv(.Inline) !Ristretto255 {
157157 return Ristretto255{ .p = try p.p.mul(s) };
158158 }
159159
lib/std/crypto/25519/scalar.zig+1-1
......@@ -46,7 +46,7 @@ pub fn reduce64(s: [64]u8) [32]u8 {
4646
4747/// Perform the X25519 "clamping" operation.
4848/// The scalar is then guaranteed to be a multiple of the cofactor.
49pub inline fn clamp(s: *[32]u8) void {
49pub fn clamp(s: *[32]u8) callconv(.Inline) void {
5050 s[0] &= 248;
5151 s[31] = (s[31] & 127) | 64;
5252}
lib/std/crypto/aegis.zig+2-2
......@@ -35,7 +35,7 @@ const State128L = struct {
3535 return state;
3636 }
3737
38 inline fn update(state: *State128L, d1: AesBlock, d2: AesBlock) void {
38 fn update(state: *State128L, d1: AesBlock, d2: AesBlock) callconv(.Inline) void {
3939 const blocks = &state.blocks;
4040 const tmp = blocks[7];
4141 comptime var i: usize = 7;
......@@ -207,7 +207,7 @@ const State256 = struct {
207207 return state;
208208 }
209209
210 inline fn update(state: *State256, d: AesBlock) void {
210 fn update(state: *State256, d: AesBlock) callconv(.Inline) void {
211211 const blocks = &state.blocks;
212212 const tmp = blocks[5].encrypt(blocks[0]);
213213 comptime var i: usize = 5;
lib/std/crypto/aes/aesni.zig+16-16
......@@ -19,24 +19,24 @@ pub const Block = struct {
1919 repr: BlockVec,
2020
2121 /// Convert a byte sequence into an internal representation.
22 pub inline fn fromBytes(bytes: *const [16]u8) Block {
22 pub fn fromBytes(bytes: *const [16]u8) callconv(.Inline) Block {
2323 const repr = mem.bytesToValue(BlockVec, bytes);
2424 return Block{ .repr = repr };
2525 }
2626
2727 /// Convert the internal representation of a block into a byte sequence.
28 pub inline fn toBytes(block: Block) [16]u8 {
28 pub fn toBytes(block: Block) callconv(.Inline) [16]u8 {
2929 return mem.toBytes(block.repr);
3030 }
3131
3232 /// XOR the block with a byte sequence.
33 pub inline fn xorBytes(block: Block, bytes: *const [16]u8) [16]u8 {
33 pub fn xorBytes(block: Block, bytes: *const [16]u8) callconv(.Inline) [16]u8 {
3434 const x = block.repr ^ fromBytes(bytes).repr;
3535 return mem.toBytes(x);
3636 }
3737
3838 /// Encrypt a block with a round key.
39 pub inline fn encrypt(block: Block, round_key: Block) Block {
39 pub fn encrypt(block: Block, round_key: Block) callconv(.Inline) Block {
4040 return Block{
4141 .repr = asm (
4242 \\ vaesenc %[rk], %[in], %[out]
......@@ -48,7 +48,7 @@ pub const Block = struct {
4848 }
4949
5050 /// Encrypt a block with the last round key.
51 pub inline fn encryptLast(block: Block, round_key: Block) Block {
51 pub fn encryptLast(block: Block, round_key: Block) callconv(.Inline) Block {
5252 return Block{
5353 .repr = asm (
5454 \\ vaesenclast %[rk], %[in], %[out]
......@@ -60,7 +60,7 @@ pub const Block = struct {
6060 }
6161
6262 /// Decrypt a block with a round key.
63 pub inline fn decrypt(block: Block, inv_round_key: Block) Block {
63 pub fn decrypt(block: Block, inv_round_key: Block) callconv(.Inline) Block {
6464 return Block{
6565 .repr = asm (
6666 \\ vaesdec %[rk], %[in], %[out]
......@@ -72,7 +72,7 @@ pub const Block = struct {
7272 }
7373
7474 /// Decrypt a block with the last round key.
75 pub inline fn decryptLast(block: Block, inv_round_key: Block) Block {
75 pub fn decryptLast(block: Block, inv_round_key: Block) callconv(.Inline) Block {
7676 return Block{
7777 .repr = asm (
7878 \\ vaesdeclast %[rk], %[in], %[out]
......@@ -84,17 +84,17 @@ pub const Block = struct {
8484 }
8585
8686 /// Apply the bitwise XOR operation to the content of two blocks.
87 pub inline fn xorBlocks(block1: Block, block2: Block) Block {
87 pub fn xorBlocks(block1: Block, block2: Block) callconv(.Inline) Block {
8888 return Block{ .repr = block1.repr ^ block2.repr };
8989 }
9090
9191 /// Apply the bitwise AND operation to the content of two blocks.
92 pub inline fn andBlocks(block1: Block, block2: Block) Block {
92 pub fn andBlocks(block1: Block, block2: Block) callconv(.Inline) Block {
9393 return Block{ .repr = block1.repr & block2.repr };
9494 }
9595
9696 /// Apply the bitwise OR operation to the content of two blocks.
97 pub inline fn orBlocks(block1: Block, block2: Block) Block {
97 pub fn orBlocks(block1: Block, block2: Block) callconv(.Inline) Block {
9898 return Block{ .repr = block1.repr | block2.repr };
9999 }
100100
......@@ -114,7 +114,7 @@ pub const Block = struct {
114114 };
115115
116116 /// Encrypt multiple blocks in parallel, each their own round key.
117 pub inline fn encryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) [count]Block {
117 pub fn encryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) callconv(.Inline) [count]Block {
118118 comptime var i = 0;
119119 var out: [count]Block = undefined;
120120 inline while (i < count) : (i += 1) {
......@@ -124,7 +124,7 @@ pub const Block = struct {
124124 }
125125
126126 /// Decrypt multiple blocks in parallel, each their own round key.
127 pub inline fn decryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) [count]Block {
127 pub fn decryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) callconv(.Inline) [count]Block {
128128 comptime var i = 0;
129129 var out: [count]Block = undefined;
130130 inline while (i < count) : (i += 1) {
......@@ -134,7 +134,7 @@ pub const Block = struct {
134134 }
135135
136136 /// Encrypt multiple blocks in parallel with the same round key.
137 pub inline fn encryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
137 pub fn encryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {
138138 comptime var i = 0;
139139 var out: [count]Block = undefined;
140140 inline while (i < count) : (i += 1) {
......@@ -144,7 +144,7 @@ pub const Block = struct {
144144 }
145145
146146 /// Decrypt multiple blocks in parallel with the same round key.
147 pub inline fn decryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
147 pub fn decryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {
148148 comptime var i = 0;
149149 var out: [count]Block = undefined;
150150 inline while (i < count) : (i += 1) {
......@@ -154,7 +154,7 @@ pub const Block = struct {
154154 }
155155
156156 /// Encrypt multiple blocks in parallel with the same last round key.
157 pub inline fn encryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
157 pub fn encryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {
158158 comptime var i = 0;
159159 var out: [count]Block = undefined;
160160 inline while (i < count) : (i += 1) {
......@@ -164,7 +164,7 @@ pub const Block = struct {
164164 }
165165
166166 /// Decrypt multiple blocks in parallel with the same last round key.
167 pub inline fn decryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
167 pub fn decryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {
168168 comptime var i = 0;
169169 var out: [count]Block = undefined;
170170 inline while (i < count) : (i += 1) {
lib/std/crypto/aes/armcrypto.zig+16-16
......@@ -19,18 +19,18 @@ pub const Block = struct {
1919 repr: BlockVec,
2020
2121 /// Convert a byte sequence into an internal representation.
22 pub inline fn fromBytes(bytes: *const [16]u8) Block {
22 pub fn fromBytes(bytes: *const [16]u8) callconv(.Inline) Block {
2323 const repr = mem.bytesToValue(BlockVec, bytes);
2424 return Block{ .repr = repr };
2525 }
2626
2727 /// Convert the internal representation of a block into a byte sequence.
28 pub inline fn toBytes(block: Block) [16]u8 {
28 pub fn toBytes(block: Block) callconv(.Inline) [16]u8 {
2929 return mem.toBytes(block.repr);
3030 }
3131
3232 /// XOR the block with a byte sequence.
33 pub inline fn xorBytes(block: Block, bytes: *const [16]u8) [16]u8 {
33 pub fn xorBytes(block: Block, bytes: *const [16]u8) callconv(.Inline) [16]u8 {
3434 const x = block.repr ^ fromBytes(bytes).repr;
3535 return mem.toBytes(x);
3636 }
......@@ -38,7 +38,7 @@ pub const Block = struct {
3838 const zero = Vector(2, u64){ 0, 0 };
3939
4040 /// Encrypt a block with a round key.
41 pub inline fn encrypt(block: Block, round_key: Block) Block {
41 pub fn encrypt(block: Block, round_key: Block) callconv(.Inline) Block {
4242 return Block{
4343 .repr = asm (
4444 \\ mov %[out].16b, %[in].16b
......@@ -54,7 +54,7 @@ pub const Block = struct {
5454 }
5555
5656 /// Encrypt a block with the last round key.
57 pub inline fn encryptLast(block: Block, round_key: Block) Block {
57 pub fn encryptLast(block: Block, round_key: Block) callconv(.Inline) Block {
5858 return Block{
5959 .repr = asm (
6060 \\ mov %[out].16b, %[in].16b
......@@ -69,7 +69,7 @@ pub const Block = struct {
6969 }
7070
7171 /// Decrypt a block with a round key.
72 pub inline fn decrypt(block: Block, inv_round_key: Block) Block {
72 pub fn decrypt(block: Block, inv_round_key: Block) callconv(.Inline) Block {
7373 return Block{
7474 .repr = asm (
7575 \\ mov %[out].16b, %[in].16b
......@@ -85,7 +85,7 @@ pub const Block = struct {
8585 }
8686
8787 /// Decrypt a block with the last round key.
88 pub inline fn decryptLast(block: Block, inv_round_key: Block) Block {
88 pub fn decryptLast(block: Block, inv_round_key: Block) callconv(.Inline) Block {
8989 return Block{
9090 .repr = asm (
9191 \\ mov %[out].16b, %[in].16b
......@@ -100,17 +100,17 @@ pub const Block = struct {
100100 }
101101
102102 /// Apply the bitwise XOR operation to the content of two blocks.
103 pub inline fn xorBlocks(block1: Block, block2: Block) Block {
103 pub fn xorBlocks(block1: Block, block2: Block) callconv(.Inline) Block {
104104 return Block{ .repr = block1.repr ^ block2.repr };
105105 }
106106
107107 /// Apply the bitwise AND operation to the content of two blocks.
108 pub inline fn andBlocks(block1: Block, block2: Block) Block {
108 pub fn andBlocks(block1: Block, block2: Block) callconv(.Inline) Block {
109109 return Block{ .repr = block1.repr & block2.repr };
110110 }
111111
112112 /// Apply the bitwise OR operation to the content of two blocks.
113 pub inline fn orBlocks(block1: Block, block2: Block) Block {
113 pub fn orBlocks(block1: Block, block2: Block) callconv(.Inline) Block {
114114 return Block{ .repr = block1.repr | block2.repr };
115115 }
116116
......@@ -120,7 +120,7 @@ pub const Block = struct {
120120 pub const optimal_parallel_blocks = 8;
121121
122122 /// Encrypt multiple blocks in parallel, each their own round key.
123 pub inline fn encryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) [count]Block {
123 pub fn encryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) callconv(.Inline) [count]Block {
124124 comptime var i = 0;
125125 var out: [count]Block = undefined;
126126 inline while (i < count) : (i += 1) {
......@@ -130,7 +130,7 @@ pub const Block = struct {
130130 }
131131
132132 /// Decrypt multiple blocks in parallel, each their own round key.
133 pub inline fn decryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) [count]Block {
133 pub fn decryptParallel(comptime count: usize, blocks: [count]Block, round_keys: [count]Block) callconv(.Inline) [count]Block {
134134 comptime var i = 0;
135135 var out: [count]Block = undefined;
136136 inline while (i < count) : (i += 1) {
......@@ -140,7 +140,7 @@ pub const Block = struct {
140140 }
141141
142142 /// Encrypt multiple blocks in parallel with the same round key.
143 pub inline fn encryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
143 pub fn encryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {
144144 comptime var i = 0;
145145 var out: [count]Block = undefined;
146146 inline while (i < count) : (i += 1) {
......@@ -150,7 +150,7 @@ pub const Block = struct {
150150 }
151151
152152 /// Decrypt multiple blocks in parallel with the same round key.
153 pub inline fn decryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
153 pub fn decryptWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {
154154 comptime var i = 0;
155155 var out: [count]Block = undefined;
156156 inline while (i < count) : (i += 1) {
......@@ -160,7 +160,7 @@ pub const Block = struct {
160160 }
161161
162162 /// Encrypt multiple blocks in parallel with the same last round key.
163 pub inline fn encryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
163 pub fn encryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {
164164 comptime var i = 0;
165165 var out: [count]Block = undefined;
166166 inline while (i < count) : (i += 1) {
......@@ -170,7 +170,7 @@ pub const Block = struct {
170170 }
171171
172172 /// Decrypt multiple blocks in parallel with the same last round key.
173 pub inline fn decryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) [count]Block {
173 pub fn decryptLastWide(comptime count: usize, blocks: [count]Block, round_key: Block) callconv(.Inline) [count]Block {
174174 comptime var i = 0;
175175 var out: [count]Block = undefined;
176176 inline while (i < count) : (i += 1) {
lib/std/crypto/aes/soft.zig+10-10
......@@ -18,7 +18,7 @@ pub const Block = struct {
1818 repr: BlockVec align(16),
1919
2020 /// Convert a byte sequence into an internal representation.
21 pub inline fn fromBytes(bytes: *const [16]u8) Block {
21 pub fn fromBytes(bytes: *const [16]u8) callconv(.Inline) Block {
2222 const s0 = mem.readIntBig(u32, bytes[0..4]);
2323 const s1 = mem.readIntBig(u32, bytes[4..8]);
2424 const s2 = mem.readIntBig(u32, bytes[8..12]);
......@@ -27,7 +27,7 @@ pub const Block = struct {
2727 }
2828
2929 /// Convert the internal representation of a block into a byte sequence.
30 pub inline fn toBytes(block: Block) [16]u8 {
30 pub fn toBytes(block: Block) callconv(.Inline) [16]u8 {
3131 var bytes: [16]u8 = undefined;
3232 mem.writeIntBig(u32, bytes[0..4], block.repr[0]);
3333 mem.writeIntBig(u32, bytes[4..8], block.repr[1]);
......@@ -37,7 +37,7 @@ pub const Block = struct {
3737 }
3838
3939 /// XOR the block with a byte sequence.
40 pub inline fn xorBytes(block: Block, bytes: *const [16]u8) [16]u8 {
40 pub fn xorBytes(block: Block, bytes: *const [16]u8) callconv(.Inline) [16]u8 {
4141 const block_bytes = block.toBytes();
4242 var x: [16]u8 = undefined;
4343 comptime var i: usize = 0;
......@@ -48,7 +48,7 @@ pub const Block = struct {
4848 }
4949
5050 /// Encrypt a block with a round key.
51 pub inline fn encrypt(block: Block, round_key: Block) Block {
51 pub fn encrypt(block: Block, round_key: Block) callconv(.Inline) Block {
5252 const src = &block.repr;
5353
5454 const s0 = block.repr[0];
......@@ -65,7 +65,7 @@ pub const Block = struct {
6565 }
6666
6767 /// Encrypt a block with the last round key.
68 pub inline fn encryptLast(block: Block, round_key: Block) Block {
68 pub fn encryptLast(block: Block, round_key: Block) callconv(.Inline) Block {
6969 const src = &block.repr;
7070
7171 const t0 = block.repr[0];
......@@ -87,7 +87,7 @@ pub const Block = struct {
8787 }
8888
8989 /// Decrypt a block with a round key.
90 pub inline fn decrypt(block: Block, round_key: Block) Block {
90 pub fn decrypt(block: Block, round_key: Block) callconv(.Inline) Block {
9191 const src = &block.repr;
9292
9393 const s0 = block.repr[0];
......@@ -104,7 +104,7 @@ pub const Block = struct {
104104 }
105105
106106 /// Decrypt a block with the last round key.
107 pub inline fn decryptLast(block: Block, round_key: Block) Block {
107 pub fn decryptLast(block: Block, round_key: Block) callconv(.Inline) Block {
108108 const src = &block.repr;
109109
110110 const t0 = block.repr[0];
......@@ -126,7 +126,7 @@ pub const Block = struct {
126126 }
127127
128128 /// Apply the bitwise XOR operation to the content of two blocks.
129 pub inline fn xorBlocks(block1: Block, block2: Block) Block {
129 pub fn xorBlocks(block1: Block, block2: Block) callconv(.Inline) Block {
130130 var x: BlockVec = undefined;
131131 comptime var i = 0;
132132 inline while (i < 4) : (i += 1) {
......@@ -136,7 +136,7 @@ pub const Block = struct {
136136 }
137137
138138 /// Apply the bitwise AND operation to the content of two blocks.
139 pub inline fn andBlocks(block1: Block, block2: Block) Block {
139 pub fn andBlocks(block1: Block, block2: Block) callconv(.Inline) Block {
140140 var x: BlockVec = undefined;
141141 comptime var i = 0;
142142 inline while (i < 4) : (i += 1) {
......@@ -146,7 +146,7 @@ pub const Block = struct {
146146 }
147147
148148 /// Apply the bitwise OR operation to the content of two blocks.
149 pub inline fn orBlocks(block1: Block, block2: Block) Block {
149 pub fn orBlocks(block1: Block, block2: Block) callconv(.Inline) Block {
150150 var x: BlockVec = undefined;
151151 comptime var i = 0;
152152 inline while (i < 4) : (i += 1) {
lib/std/crypto/blake3.zig+3-3
......@@ -66,7 +66,7 @@ const CompressVectorized = struct {
6666 const Lane = Vector(4, u32);
6767 const Rows = [4]Lane;
6868
69 inline fn g(comptime even: bool, rows: *Rows, m: Lane) void {
69 fn g(comptime even: bool, rows: *Rows, m: Lane) callconv(.Inline) void {
7070 rows[0] +%= rows[1] +% m;
7171 rows[3] ^= rows[0];
7272 rows[3] = math.rotr(Lane, rows[3], if (even) 8 else 16);
......@@ -75,13 +75,13 @@ const CompressVectorized = struct {
7575 rows[1] = math.rotr(Lane, rows[1], if (even) 7 else 12);
7676 }
7777
78 inline fn diagonalize(rows: *Rows) void {
78 fn diagonalize(rows: *Rows) callconv(.Inline) void {
7979 rows[0] = @shuffle(u32, rows[0], undefined, [_]i32{ 3, 0, 1, 2 });
8080 rows[3] = @shuffle(u32, rows[3], undefined, [_]i32{ 2, 3, 0, 1 });
8181 rows[2] = @shuffle(u32, rows[2], undefined, [_]i32{ 1, 2, 3, 0 });
8282 }
8383
84 inline fn undiagonalize(rows: *Rows) void {
84 fn undiagonalize(rows: *Rows) callconv(.Inline) void {
8585 rows[0] = @shuffle(u32, rows[0], undefined, [_]i32{ 1, 2, 3, 0 });
8686 rows[3] = @shuffle(u32, rows[3], undefined, [_]i32{ 2, 3, 0, 1 });
8787 rows[2] = @shuffle(u32, rows[2], undefined, [_]i32{ 3, 0, 1, 2 });
lib/std/crypto/chacha20.zig+6-6
......@@ -35,7 +35,7 @@ const ChaCha20VecImpl = struct {
3535 };
3636 }
3737
38 inline fn chacha20Core(x: *BlockVec, input: BlockVec) void {
38 fn chacha20Core(x: *BlockVec, input: BlockVec) callconv(.Inline) void {
3939 x.* = input;
4040
4141 var r: usize = 0;
......@@ -80,7 +80,7 @@ const ChaCha20VecImpl = struct {
8080 }
8181 }
8282
83 inline fn hashToBytes(out: *[64]u8, x: BlockVec) void {
83 fn hashToBytes(out: *[64]u8, x: BlockVec) callconv(.Inline) void {
8484 var i: usize = 0;
8585 while (i < 4) : (i += 1) {
8686 mem.writeIntLittle(u32, out[16 * i + 0 ..][0..4], x[i][0]);
......@@ -90,7 +90,7 @@ const ChaCha20VecImpl = struct {
9090 }
9191 }
9292
93 inline fn contextFeedback(x: *BlockVec, ctx: BlockVec) void {
93 fn contextFeedback(x: *BlockVec, ctx: BlockVec) callconv(.Inline) void {
9494 x[0] +%= ctx[0];
9595 x[1] +%= ctx[1];
9696 x[2] +%= ctx[2];
......@@ -190,7 +190,7 @@ const ChaCha20NonVecImpl = struct {
190190 };
191191 }
192192
193 inline fn chacha20Core(x: *BlockVec, input: BlockVec) void {
193 fn chacha20Core(x: *BlockVec, input: BlockVec) callconv(.Inline) void {
194194 x.* = input;
195195
196196 const rounds = comptime [_]QuarterRound{
......@@ -219,7 +219,7 @@ const ChaCha20NonVecImpl = struct {
219219 }
220220 }
221221
222 inline fn hashToBytes(out: *[64]u8, x: BlockVec) void {
222 fn hashToBytes(out: *[64]u8, x: BlockVec) callconv(.Inline) void {
223223 var i: usize = 0;
224224 while (i < 4) : (i += 1) {
225225 mem.writeIntLittle(u32, out[16 * i + 0 ..][0..4], x[i * 4 + 0]);
......@@ -229,7 +229,7 @@ const ChaCha20NonVecImpl = struct {
229229 }
230230 }
231231
232 inline fn contextFeedback(x: *BlockVec, ctx: BlockVec) void {
232 fn contextFeedback(x: *BlockVec, ctx: BlockVec) callconv(.Inline) void {
233233 var i: usize = 0;
234234 while (i < 16) : (i += 1) {
235235 x[i] +%= ctx[i];
lib/std/crypto/ghash.zig+2-2
......@@ -95,7 +95,7 @@ pub const Ghash = struct {
9595 }
9696 }
9797
98 inline fn clmul_pclmul(x: u64, y: u64) u64 {
98 fn clmul_pclmul(x: u64, y: u64) callconv(.Inline) u64 {
9999 const Vector = std.meta.Vector;
100100 const product = asm (
101101 \\ vpclmulqdq $0x00, %[x], %[y], %[out]
......@@ -106,7 +106,7 @@ pub const Ghash = struct {
106106 return product[0];
107107 }
108108
109 inline fn clmul_pmull(x: u64, y: u64) u64 {
109 fn clmul_pmull(x: u64, y: u64) callconv(.Inline) u64 {
110110 const Vector = std.meta.Vector;
111111 const product = asm (
112112 \\ pmull %[out].1q, %[x].1d, %[y].1d
lib/std/crypto/gimli.zig+2-2
......@@ -48,7 +48,7 @@ pub const State = struct {
4848 return mem.asBytes(&self.data);
4949 }
5050
51 inline fn endianSwap(self: *Self) void {
51 fn endianSwap(self: *Self) callconv(.Inline) void {
5252 for (self.data) |*w| {
5353 w.* = mem.littleToNative(u32, w.*);
5454 }
......@@ -116,7 +116,7 @@ pub const State = struct {
116116
117117 const Lane = Vector(4, u32);
118118
119 inline fn shift(x: Lane, comptime n: comptime_int) Lane {
119 fn shift(x: Lane, comptime n: comptime_int) callconv(.Inline) Lane {
120120 return x << @splat(4, @as(u5, n));
121121 }
122122
lib/std/crypto/salsa20.zig+3-3
......@@ -37,7 +37,7 @@ const Salsa20VecImpl = struct {
3737 };
3838 }
3939
40 inline fn salsa20Core(x: *BlockVec, input: BlockVec, comptime feedback: bool) void {
40 fn salsa20Core(x: *BlockVec, input: BlockVec, comptime feedback: bool) callconv(.Inline) void {
4141 const n1n2n3n0 = Lane{ input[3][1], input[3][2], input[3][3], input[3][0] };
4242 const n1n2 = Half{ n1n2n3n0[0], n1n2n3n0[1] };
4343 const n3n0 = Half{ n1n2n3n0[2], n1n2n3n0[3] };
......@@ -211,7 +211,7 @@ const Salsa20NonVecImpl = struct {
211211 d: u6,
212212 };
213213
214 inline fn Rp(a: usize, b: usize, c: usize, d: u6) QuarterRound {
214 fn Rp(a: usize, b: usize, c: usize, d: u6) callconv(.Inline) QuarterRound {
215215 return QuarterRound{
216216 .a = a,
217217 .b = b,
......@@ -220,7 +220,7 @@ const Salsa20NonVecImpl = struct {
220220 };
221221 }
222222
223 inline fn salsa20Core(x: *BlockVec, input: BlockVec, comptime feedback: bool) void {
223 fn salsa20Core(x: *BlockVec, input: BlockVec, comptime feedback: bool) callconv(.Inline) void {
224224 const arx_steps = comptime [_]QuarterRound{
225225 Rp(4, 0, 12, 7), Rp(8, 4, 0, 9), Rp(12, 8, 4, 13), Rp(0, 12, 8, 18),
226226 Rp(9, 5, 1, 7), Rp(13, 9, 5, 9), Rp(1, 13, 9, 13), Rp(5, 1, 13, 18),
lib/std/elf.zig+8-8
......@@ -720,10 +720,10 @@ pub const Elf32_Rel = extern struct {
720720 r_offset: Elf32_Addr,
721721 r_info: Elf32_Word,
722722
723 pub inline fn r_sym(self: @This()) u24 {
723 pub fn r_sym(self: @This()) callconv(.Inline) u24 {
724724 return @truncate(u24, self.r_info >> 8);
725725 }
726 pub inline fn r_type(self: @This()) u8 {
726 pub fn r_type(self: @This()) callconv(.Inline) u8 {
727727 return @truncate(u8, self.r_info & 0xff);
728728 }
729729};
......@@ -731,10 +731,10 @@ pub const Elf64_Rel = extern struct {
731731 r_offset: Elf64_Addr,
732732 r_info: Elf64_Xword,
733733
734 pub inline fn r_sym(self: @This()) u32 {
734 pub fn r_sym(self: @This()) callconv(.Inline) u32 {
735735 return @truncate(u32, self.r_info >> 32);
736736 }
737 pub inline fn r_type(self: @This()) u32 {
737 pub fn r_type(self: @This()) callconv(.Inline) u32 {
738738 return @truncate(u32, self.r_info & 0xffffffff);
739739 }
740740};
......@@ -743,10 +743,10 @@ pub const Elf32_Rela = extern struct {
743743 r_info: Elf32_Word,
744744 r_addend: Elf32_Sword,
745745
746 pub inline fn r_sym(self: @This()) u24 {
746 pub fn r_sym(self: @This()) callconv(.Inline) u24 {
747747 return @truncate(u24, self.r_info >> 8);
748748 }
749 pub inline fn r_type(self: @This()) u8 {
749 pub fn r_type(self: @This()) callconv(.Inline) u8 {
750750 return @truncate(u8, self.r_info & 0xff);
751751 }
752752};
......@@ -755,10 +755,10 @@ pub const Elf64_Rela = extern struct {
755755 r_info: Elf64_Xword,
756756 r_addend: Elf64_Sxword,
757757
758 pub inline fn r_sym(self: @This()) u32 {
758 pub fn r_sym(self: @This()) callconv(.Inline) u32 {
759759 return @truncate(u32, self.r_info >> 32);
760760 }
761 pub inline fn r_type(self: @This()) u32 {
761 pub fn r_type(self: @This()) callconv(.Inline) u32 {
762762 return @truncate(u32, self.r_info & 0xffffffff);
763763 }
764764};
lib/std/fmt/parse_float.zig+4-4
......@@ -52,21 +52,21 @@ const Z96 = struct {
5252 d2: u32,
5353
5454 // d = s >> 1
55 inline fn shiftRight1(d: *Z96, s: Z96) void {
55 fn shiftRight1(d: *Z96, s: Z96) callconv(.Inline) void {
5656 d.d0 = (s.d0 >> 1) | ((s.d1 & 1) << 31);
5757 d.d1 = (s.d1 >> 1) | ((s.d2 & 1) << 31);
5858 d.d2 = s.d2 >> 1;
5959 }
6060
6161 // d = s << 1
62 inline fn shiftLeft1(d: *Z96, s: Z96) void {
62 fn shiftLeft1(d: *Z96, s: Z96) callconv(.Inline) void {
6363 d.d2 = (s.d2 << 1) | ((s.d1 & (1 << 31)) >> 31);
6464 d.d1 = (s.d1 << 1) | ((s.d0 & (1 << 31)) >> 31);
6565 d.d0 = s.d0 << 1;
6666 }
6767
6868 // d += s
69 inline fn add(d: *Z96, s: Z96) void {
69 fn add(d: *Z96, s: Z96) callconv(.Inline) void {
7070 var w = @as(u64, d.d0) + @as(u64, s.d0);
7171 d.d0 = @truncate(u32, w);
7272
......@@ -80,7 +80,7 @@ const Z96 = struct {
8080 }
8181
8282 // d -= s
83 inline fn sub(d: *Z96, s: Z96) void {
83 fn sub(d: *Z96, s: Z96) callconv(.Inline) void {
8484 var w = @as(u64, d.d0) -% @as(u64, s.d0);
8585 d.d0 = @truncate(u32, w);
8686
lib/std/hash/cityhash.zig+1-1
......@@ -6,7 +6,7 @@
66const std = @import("std");
77const builtin = @import("builtin");
88
9inline fn offsetPtr(ptr: [*]const u8, offset: usize) [*]const u8 {
9fn offsetPtr(ptr: [*]const u8, offset: usize) callconv(.Inline) [*]const u8 {
1010 // ptr + offset doesn't work at comptime so we need this instead.
1111 return @ptrCast([*]const u8, &ptr[offset]);
1212}
lib/std/os/bits/freebsd.zig+4-4
......@@ -815,16 +815,16 @@ pub const sigval = extern union {
815815pub const _SIG_WORDS = 4;
816816pub const _SIG_MAXSIG = 128;
817817
818pub inline fn _SIG_IDX(sig: usize) usize {
818pub fn _SIG_IDX(sig: usize) callconv(.Inline) usize {
819819 return sig - 1;
820820}
821pub inline fn _SIG_WORD(sig: usize) usize {
821pub fn _SIG_WORD(sig: usize) callconv(.Inline) usize {
822822 return_SIG_IDX(sig) >> 5;
823823}
824pub inline fn _SIG_BIT(sig: usize) usize {
824pub fn _SIG_BIT(sig: usize) callconv(.Inline) usize {
825825 return 1 << (_SIG_IDX(sig) & 31);
826826}
827pub inline fn _SIG_VALID(sig: usize) usize {
827pub fn _SIG_VALID(sig: usize) callconv(.Inline) usize {
828828 return sig <= _SIG_MAXSIG and sig > 0;
829829}
830830
lib/std/os/bits/netbsd.zig+4-4
......@@ -796,16 +796,16 @@ pub const _ksiginfo = extern struct {
796796pub const _SIG_WORDS = 4;
797797pub const _SIG_MAXSIG = 128;
798798
799pub inline fn _SIG_IDX(sig: usize) usize {
799pub fn _SIG_IDX(sig: usize) callconv(.Inline) usize {
800800 return sig - 1;
801801}
802pub inline fn _SIG_WORD(sig: usize) usize {
802pub fn _SIG_WORD(sig: usize) callconv(.Inline) usize {
803803 return_SIG_IDX(sig) >> 5;
804804}
805pub inline fn _SIG_BIT(sig: usize) usize {
805pub fn _SIG_BIT(sig: usize) callconv(.Inline) usize {
806806 return 1 << (_SIG_IDX(sig) & 31);
807807}
808pub inline fn _SIG_VALID(sig: usize) usize {
808pub fn _SIG_VALID(sig: usize) callconv(.Inline) usize {
809809 return sig <= _SIG_MAXSIG and sig > 0;
810810}
811811
lib/std/os/linux.zig+1-1
......@@ -126,7 +126,7 @@ pub fn fork() usize {
126126/// It is advised to avoid this function and use clone instead, because
127127/// the compiler is not aware of how vfork affects control flow and you may
128128/// see different results in optimized builds.
129pub inline fn vfork() usize {
129pub fn vfork() callconv(.Inline) usize {
130130 return @call(.{ .modifier = .always_inline }, syscall0, .{.vfork});
131131}
132132
lib/std/os/linux/tls.zig+1-1
......@@ -300,7 +300,7 @@ fn initTLS() void {
300300 };
301301}
302302
303inline fn alignPtrCast(comptime T: type, ptr: [*]u8) *T {
303fn alignPtrCast(comptime T: type, ptr: [*]u8) callconv(.Inline) *T {
304304 return @ptrCast(*T, @alignCast(@alignOf(*T), ptr));
305305}
306306
lib/std/os/windows.zig+1-1
......@@ -1669,7 +1669,7 @@ pub fn wToPrefixedFileW(s: []const u16) !PathSpace {
16691669 return path_space;
16701670}
16711671
1672inline fn MAKELANGID(p: c_ushort, s: c_ushort) LANGID {
1672fn MAKELANGID(p: c_ushort, s: c_ushort) callconv(.Inline) LANGID {
16731673 return (s << 10) | p;
16741674}
16751675
lib/std/start.zig+2-2
......@@ -262,7 +262,7 @@ const bad_main_ret = "expected return type of main to be 'void', '!void', 'noret
262262
263263// This is marked inline because for some reason LLVM in release mode fails to inline it,
264264// and we want fewer call frames in stack traces.
265inline fn initEventLoopAndCallMain() u8 {
265fn initEventLoopAndCallMain() callconv(.Inline) u8 {
266266 if (std.event.Loop.instance) |loop| {
267267 if (!@hasDecl(root, "event_loop")) {
268268 loop.init() catch |err| {
......@@ -291,7 +291,7 @@ inline fn initEventLoopAndCallMain() u8 {
291291// and we want fewer call frames in stack traces.
292292// TODO This function is duplicated from initEventLoopAndCallMain instead of using generics
293293// because it is working around stage1 compiler bugs.
294inline fn initEventLoopAndCallWinMain() std.os.windows.INT {
294fn initEventLoopAndCallWinMain() callconv(.Inline) std.os.windows.INT {
295295 if (std.event.Loop.instance) |loop| {
296296 if (!@hasDecl(root, "event_loop")) {
297297 loop.init() catch |err| {
lib/std/zig/parser_test.zig+3-3
......@@ -2355,17 +2355,17 @@ test "zig fmt: functions" {
23552355 \\extern fn puts(s: *const u8) c_int;
23562356 \\extern "c" fn puts(s: *const u8) c_int;
23572357 \\export fn puts(s: *const u8) c_int;
2358 \\inline fn puts(s: *const u8) c_int;
2358 \\fn puts(s: *const u8) callconv(.Inline) c_int;
23592359 \\noinline fn puts(s: *const u8) c_int;
23602360 \\pub extern fn puts(s: *const u8) c_int;
23612361 \\pub extern "c" fn puts(s: *const u8) c_int;
23622362 \\pub export fn puts(s: *const u8) c_int;
2363 \\pub inline fn puts(s: *const u8) c_int;
2363 \\pub fn puts(s: *const u8) callconv(.Inline) c_int;
23642364 \\pub noinline fn puts(s: *const u8) c_int;
23652365 \\pub extern fn puts(s: *const u8) align(2 + 2) c_int;
23662366 \\pub extern "c" fn puts(s: *const u8) align(2 + 2) c_int;
23672367 \\pub export fn puts(s: *const u8) align(2 + 2) c_int;
2368 \\pub inline fn puts(s: *const u8) align(2 + 2) c_int;
2368 \\pub fn puts(s: *const u8) align(2 + 2) callconv(.Inline) c_int;
23692369 \\pub noinline fn puts(s: *const u8) align(2 + 2) c_int;
23702370 \\
23712371 );
lib/std/zig/system/x86.zig+2-2
......@@ -19,11 +19,11 @@ fn setFeature(cpu: *Target.Cpu, feature: Target.x86.Feature, enabled: bool) void
1919 if (enabled) cpu.features.addFeature(idx) else cpu.features.removeFeature(idx);
2020}
2121
22inline fn bit(input: u32, offset: u5) bool {
22fn bit(input: u32, offset: u5) callconv(.Inline) bool {
2323 return (input >> offset) & 1 != 0;
2424}
2525
26inline fn hasMask(input: u32, mask: u32) bool {
26fn hasMask(input: u32, mask: u32) callconv(.Inline) bool {
2727 return (input & mask) == mask;
2828}
2929
src/link/MachO.zig+1-1
......@@ -2366,7 +2366,7 @@ fn allocatedSizeLinkedit(self: *MachO, start: u64) u64 {
23662366 return min_pos - start;
23672367}
23682368
2369inline fn checkForCollision(start: u64, end: u64, off: u64, size: u64) ?u64 {
2369fn checkForCollision(start: u64, end: u64, off: u64, size: u64) callconv(.Inline) ?u64 {
23702370 const increased_size = padToIdeal(size);
23712371 const test_end = off + increased_size;
23722372 if (end > off and start < test_end) {
src/tracy.zig+1-1
......@@ -31,7 +31,7 @@ pub const Ctx = if (enable) ___tracy_c_zone_context else struct {
3131 pub fn end(self: Ctx) void {}
3232};
3333
34pub inline fn trace(comptime src: std.builtin.SourceLocation) Ctx {
34pub fn trace(comptime src: std.builtin.SourceLocation) callconv(.Inline) Ctx {
3535 if (!enable) return .{};
3636
3737 const loc: ___tracy_source_location_data = .{
test/cli.zig+1-1
......@@ -113,7 +113,7 @@ fn testGodboltApi(zig_exe: []const u8, dir_path: []const u8) anyerror!void {
113113 \\ return num * num;
114114 \\}
115115 \\extern fn zig_panic() noreturn;
116 \\pub inline fn panic(msg: []const u8, error_return_trace: ?*@import("builtin").StackTrace) noreturn {
116 \\pub fn panic(msg: []const u8, error_return_trace: ?*@import("builtin").StackTrace) callconv(.Inline) noreturn {
117117 \\ zig_panic();
118118 \\}
119119 );
test/compile_errors.zig+6-6
......@@ -1648,7 +1648,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
16481648 \\ @call(.{ .modifier = .compile_time }, baz, .{});
16491649 \\}
16501650 \\fn foo() void {}
1651 \\inline fn bar() void {}
1651 \\fn bar() callconv(.Inline) void {}
16521652 \\fn baz1() void {}
16531653 \\fn baz2() void {}
16541654 , &[_][]const u8{
......@@ -3944,7 +3944,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
39443944 \\export fn entry() void {
39453945 \\ var a = b;
39463946 \\}
3947 \\inline fn b() void { }
3947 \\fn b() callconv(.Inline) void { }
39483948 , &[_][]const u8{
39493949 "tmp.zig:2:5: error: functions marked inline must be stored in const or comptime var",
39503950 "tmp.zig:4:1: note: declared here",
......@@ -6782,11 +6782,11 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
67826782 // \\export fn foo() void {
67836783 // \\ bar();
67846784 // \\}
6785 // \\inline fn bar() void {
6785 // \\fn bar() callconv(.Inline) void {
67866786 // \\ baz();
67876787 // \\ quux();
67886788 // \\}
6789 // \\inline fn baz() void {
6789 // \\fn baz() callconv(.Inline) void {
67906790 // \\ bar();
67916791 // \\ quux();
67926792 // \\}
......@@ -6799,7 +6799,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
67996799 // \\export fn foo() void {
68006800 // \\ quux(@ptrToInt(bar));
68016801 // \\}
6802 // \\inline fn bar() void { }
6802 // \\fn bar() callconv(.Inline) void { }
68036803 // \\extern fn quux(usize) void;
68046804 //, &[_][]const u8{
68056805 // "tmp.zig:4:1: error: unable to inline function",
......@@ -7207,7 +7207,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void {
72077207 \\export fn entry() void {
72087208 \\ foo();
72097209 \\}
7210 \\inline fn foo() void {
7210 \\fn foo() callconv(.Inline) void {
72117211 \\ @setAlignStack(16);
72127212 \\}
72137213 , &[_][]const u8{
test/stage1/behavior/fn.zig+1-1
......@@ -113,7 +113,7 @@ test "assign inline fn to const variable" {
113113 a();
114114}
115115
116inline fn inlineFn() void {}
116fn inlineFn() callconv(.Inline) void {}
117117
118118test "pass by non-copying value" {
119119 expect(addPointCoords(Point{ .x = 1, .y = 2 }) == 3);
test/stage2/cbe.zig+1-1
......@@ -179,7 +179,7 @@ pub fn addCases(ctx: *TestContext) !void {
179179 \\ return y - 1;
180180 \\}
181181 \\
182 \\inline fn rec(n: usize) usize {
182 \\fn rec(n: usize) callconv(.Inline) usize {
183183 \\ if (n <= 1) return n;
184184 \\ return rec(n - 1);
185185 \\}
test/stage2/test.zig+5-5
......@@ -255,7 +255,7 @@ pub fn addCases(ctx: *TestContext) !void {
255255 \\ exit(y - 6);
256256 \\}
257257 \\
258 \\inline fn add(a: usize, b: usize, c: usize) usize {
258 \\fn add(a: usize, b: usize, c: usize) callconv(.Inline) usize {
259259 \\ return a + b + c;
260260 \\}
261261 \\
......@@ -1228,7 +1228,7 @@ pub fn addCases(ctx: *TestContext) !void {
12281228 \\ exit(y - 6);
12291229 \\}
12301230 \\
1231 \\inline fn add(a: usize, b: usize, c: usize) usize {
1231 \\fn add(a: usize, b: usize, c: usize) callconv(.Inline) usize {
12321232 \\ if (a == 10) @compileError("bad");
12331233 \\ return a + b + c;
12341234 \\}
......@@ -1251,7 +1251,7 @@ pub fn addCases(ctx: *TestContext) !void {
12511251 \\ exit(y - 6);
12521252 \\}
12531253 \\
1254 \\inline fn add(a: usize, b: usize, c: usize) usize {
1254 \\fn add(a: usize, b: usize, c: usize) callconv(.Inline) usize {
12551255 \\ if (a == 10) @compileError("bad");
12561256 \\ return a + b + c;
12571257 \\}
......@@ -1277,7 +1277,7 @@ pub fn addCases(ctx: *TestContext) !void {
12771277 \\ exit(y - 21);
12781278 \\}
12791279 \\
1280 \\inline fn fibonacci(n: usize) usize {
1280 \\fn fibonacci(n: usize) callconv(.Inline) usize {
12811281 \\ if (n <= 2) return n;
12821282 \\ return fibonacci(n - 2) + fibonacci(n - 1);
12831283 \\}
......@@ -1300,7 +1300,7 @@ pub fn addCases(ctx: *TestContext) !void {
13001300 \\ exit(y - 21);
13011301 \\}
13021302 \\
1303 \\inline fn fibonacci(n: usize) usize {
1303 \\fn fibonacci(n: usize) callconv(.Inline) usize {
13041304 \\ if (n <= 2) return n;
13051305 \\ return fibonacci(n - 2) + fibonacci(n - 1);
13061306 \\}
test/translate_c.zig+16-16
......@@ -43,7 +43,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
4343 ,
4444 \\pub const VALUE = ((((1 + (2 * 3)) + (4 * 5)) + 6) << 7) | @boolToInt(8 == 9);
4545 ,
46 \\pub inline fn _AL_READ3BYTES(p: anytype) @TypeOf(((@import("std").meta.cast([*c]u8, p)).* | (((@import("std").meta.cast([*c]u8, p)) + 1).* << 8)) | (((@import("std").meta.cast([*c]u8, p)) + 2).* << 16)) {
46 \\pub fn _AL_READ3BYTES(p: anytype) callconv(.Inline) @TypeOf(((@import("std").meta.cast([*c]u8, p)).* | (((@import("std").meta.cast([*c]u8, p)) + 1).* << 8)) | (((@import("std").meta.cast([*c]u8, p)) + 2).* << 16)) {
4747 \\ return ((@import("std").meta.cast([*c]u8, p)).* | (((@import("std").meta.cast([*c]u8, p)) + 1).* << 8)) | (((@import("std").meta.cast([*c]u8, p)) + 2).* << 16);
4848 \\}
4949 });
......@@ -116,7 +116,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
116116 \\};
117117 \\pub const Color = struct_Color;
118118 ,
119 \\pub inline fn CLITERAL(type_1: anytype) @TypeOf(type_1) {
119 \\pub fn CLITERAL(type_1: anytype) callconv(.Inline) @TypeOf(type_1) {
120120 \\ return type_1;
121121 \\}
122122 ,
......@@ -148,7 +148,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
148148 cases.add("correct semicolon after infixop",
149149 \\#define __ferror_unlocked_body(_fp) (((_fp)->_flags & _IO_ERR_SEEN) != 0)
150150 , &[_][]const u8{
151 \\pub inline fn __ferror_unlocked_body(_fp: anytype) @TypeOf(((_fp.*._flags) & _IO_ERR_SEEN) != 0) {
151 \\pub fn __ferror_unlocked_body(_fp: anytype) callconv(.Inline) @TypeOf(((_fp.*._flags) & _IO_ERR_SEEN) != 0) {
152152 \\ return ((_fp.*._flags) & _IO_ERR_SEEN) != 0;
153153 \\}
154154 });
......@@ -157,7 +157,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
157157 \\#define FOO(x) ((x >= 0) + (x >= 0))
158158 \\#define BAR 1 && 2 > 4
159159 , &[_][]const u8{
160 \\pub inline fn FOO(x: anytype) @TypeOf(@boolToInt(x >= 0) + @boolToInt(x >= 0)) {
160 \\pub fn FOO(x: anytype) callconv(.Inline) @TypeOf(@boolToInt(x >= 0) + @boolToInt(x >= 0)) {
161161 \\ return @boolToInt(x >= 0) + @boolToInt(x >= 0);
162162 \\}
163163 ,
......@@ -208,7 +208,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
208208 \\ break :blk bar;
209209 \\};
210210 ,
211 \\pub inline fn bar(x: anytype) @TypeOf(baz(1, 2)) {
211 \\pub fn bar(x: anytype) callconv(.Inline) @TypeOf(baz(1, 2)) {
212212 \\ return blk: {
213213 \\ _ = &x;
214214 \\ _ = 3;
......@@ -1590,13 +1590,13 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
15901590 , &[_][]const u8{
15911591 \\pub extern var fn_ptr: ?fn () callconv(.C) void;
15921592 ,
1593 \\pub inline fn foo() void {
1593 \\pub fn foo() callconv(.Inline) void {
15941594 \\ return fn_ptr.?();
15951595 \\}
15961596 ,
15971597 \\pub extern var fn_ptr2: ?fn (c_int, f32) callconv(.C) u8;
15981598 ,
1599 \\pub inline fn bar(arg_1: c_int, arg_2: f32) u8 {
1599 \\pub fn bar(arg_1: c_int, arg_2: f32) callconv(.Inline) u8 {
16001600 \\ return fn_ptr2.?(arg_1, arg_2);
16011601 \\}
16021602 });
......@@ -1629,7 +1629,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
16291629 ,
16301630 \\pub const glClearPFN = PFNGLCLEARPROC;
16311631 ,
1632 \\pub inline fn glClearUnion(arg_2: GLbitfield) void {
1632 \\pub fn glClearUnion(arg_2: GLbitfield) callconv(.Inline) void {
16331633 \\ return glProcs.gl.Clear.?(arg_2);
16341634 \\}
16351635 ,
......@@ -1650,15 +1650,15 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
16501650 , &[_][]const u8{
16511651 \\pub extern var c: c_int;
16521652 ,
1653 \\pub inline fn BASIC(c_1: anytype) @TypeOf(c_1 * 2) {
1653 \\pub fn BASIC(c_1: anytype) callconv(.Inline) @TypeOf(c_1 * 2) {
16541654 \\ return c_1 * 2;
16551655 \\}
16561656 ,
1657 \\pub inline fn FOO(L: anytype, b: anytype) @TypeOf(L + b) {
1657 \\pub fn FOO(L: anytype, b: anytype) callconv(.Inline) @TypeOf(L + b) {
16581658 \\ return L + b;
16591659 \\}
16601660 ,
1661 \\pub inline fn BAR() @TypeOf(c * c) {
1661 \\pub fn BAR() callconv(.Inline) @TypeOf(c * c) {
16621662 \\ return c * c;
16631663 \\}
16641664 });
......@@ -2298,7 +2298,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
22982298 cases.add("macro call",
22992299 \\#define CALL(arg) bar(arg)
23002300 , &[_][]const u8{
2301 \\pub inline fn CALL(arg: anytype) @TypeOf(bar(arg)) {
2301 \\pub fn CALL(arg: anytype) callconv(.Inline) @TypeOf(bar(arg)) {
23022302 \\ return bar(arg);
23032303 \\}
23042304 });
......@@ -2860,7 +2860,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
28602860 \\#define BAR (void*) a
28612861 \\#define BAZ (uint32_t)(2)
28622862 , &[_][]const u8{
2863 \\pub inline fn FOO(bar: anytype) @TypeOf(baz((@import("std").meta.cast(?*c_void, baz)))) {
2863 \\pub fn FOO(bar: anytype) callconv(.Inline) @TypeOf(baz((@import("std").meta.cast(?*c_void, baz)))) {
28642864 \\ return baz((@import("std").meta.cast(?*c_void, baz)));
28652865 \\}
28662866 ,
......@@ -2902,11 +2902,11 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
29022902 \\#define MIN(a, b) ((b) < (a) ? (b) : (a))
29032903 \\#define MAX(a, b) ((b) > (a) ? (b) : (a))
29042904 , &[_][]const u8{
2905 \\pub inline fn MIN(a: anytype, b: anytype) @TypeOf(if (b < a) b else a) {
2905 \\pub fn MIN(a: anytype, b: anytype) callconv(.Inline) @TypeOf(if (b < a) b else a) {
29062906 \\ return if (b < a) b else a;
29072907 \\}
29082908 ,
2909 \\pub inline fn MAX(a: anytype, b: anytype) @TypeOf(if (b > a) b else a) {
2909 \\pub fn MAX(a: anytype, b: anytype) callconv(.Inline) @TypeOf(if (b > a) b else a) {
29102910 \\ return if (b > a) b else a;
29112911 \\}
29122912 });
......@@ -3094,7 +3094,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
30943094 \\#define DefaultScreen(dpy) (((_XPrivDisplay)(dpy))->default_screen)
30953095 \\
30963096 , &[_][]const u8{
3097 \\pub inline fn DefaultScreen(dpy: anytype) @TypeOf((@import("std").meta.cast(_XPrivDisplay, dpy)).*.default_screen) {
3097 \\pub fn DefaultScreen(dpy: anytype) callconv(.Inline) @TypeOf((@import("std").meta.cast(_XPrivDisplay, dpy)).*.default_screen) {
30983098 \\ return (@import("std").meta.cast(_XPrivDisplay, dpy)).*.default_screen;
30993099 \\}
31003100 });