Anonymous
8/11/2025, 9:32:04 AM
No.106221238
>>106220451
One verbose way would be to make the function take in a struct, then use the C99 struct literal syntax. (And then hope your compiler optimizes the overhead out)
struct arg { u16 hi, lo; };
u32 u16u16_2_u32(arg a) { ... }
// Usage
u32 foo = make_u32_from_two_u16((arg) { .hi=420, .lo=69 });
If Swift has one feature done right, it is named arguments.
One verbose way would be to make the function take in a struct, then use the C99 struct literal syntax. (And then hope your compiler optimizes the overhead out)
struct arg { u16 hi, lo; };
u32 u16u16_2_u32(arg a) { ... }
// Usage
u32 foo = make_u32_from_two_u16((arg) { .hi=420, .lo=69 });
If Swift has one feature done right, it is named arguments.