From cfce376f585e0cd0231e95843617f75bd65b6c07 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 28 Dec 2025 17:27:05 -0500 Subject: Change autoformatter to no longer allow single-line functions --- src/stdlib/bigint.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/stdlib/bigint.h') 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 -- cgit v1.2.3