diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-12-28 17:27:05 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-12-28 17:27:05 -0500 |
| commit | cfce376f585e0cd0231e95843617f75bd65b6c07 (patch) | |
| tree | 9457de8bb9b8d0643c83cd5c08182af6a86804b7 /src/stdlib/bigint.h | |
| parent | b80e21ce3d673d981e44a725c62b62563a77db9b (diff) | |
Change autoformatter to no longer allow single-line functions
Diffstat (limited to 'src/stdlib/bigint.h')
| -rw-r--r-- | src/stdlib/bigint.h | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/stdlib/bigint.h b/src/stdlib/bigint.h index 9ce4c800..8c3502bf 100644 --- a/src/stdlib/bigint.h +++ b/src/stdlib/bigint.h @@ -195,18 +195,30 @@ MACROLIKE PUREFUNC Int_t Int$from_num64(double n, bool truncate) { if (!truncate && unlikely(mpz_get_d(result) != n)) fail("Could not convert to an integer without truncation: ", n); return Int$from_mpz(result); } -MACROLIKE PUREFUNC Int_t Int$from_num32(float n, bool truncate) { return Int$from_num64((double)n, truncate); } +MACROLIKE PUREFUNC Int_t Int$from_num32(float n, bool truncate) { + return Int$from_num64((double)n, truncate); +} MACROLIKE Int_t Int$from_int64(int64_t i) { if likely (i >= SMALLEST_SMALL_INT && i <= BIGGEST_SMALL_INT) return (Int_t){.small = (i << 2L) | 1L}; mpz_t result; mpz_init_set_si(result, i); return Int$from_mpz(result); } -MACROLIKE CONSTFUNC Int_t Int$from_int32(Int32_t i) { return Int$from_int64((Int32_t)i); } -MACROLIKE CONSTFUNC Int_t Int$from_int16(Int16_t i) { return I_small(i); } -MACROLIKE CONSTFUNC Int_t Int$from_int8(Int8_t i) { return I_small(i); } -MACROLIKE CONSTFUNC Int_t Int$from_byte(Byte_t b) { return I_small(b); } -MACROLIKE CONSTFUNC Int_t Int$from_bool(Bool_t b) { return I_small(b); } +MACROLIKE CONSTFUNC Int_t Int$from_int32(Int32_t i) { + return Int$from_int64((Int32_t)i); +} +MACROLIKE CONSTFUNC Int_t Int$from_int16(Int16_t i) { + return I_small(i); +} +MACROLIKE CONSTFUNC Int_t Int$from_int8(Int8_t i) { + return I_small(i); +} +MACROLIKE CONSTFUNC Int_t Int$from_byte(Byte_t b) { + return I_small(b); +} +MACROLIKE CONSTFUNC Int_t Int$from_bool(Bool_t b) { + return I_small(b); +} #ifdef __GNUC__ #pragma GCC diagnostic pop |
