From 5ada8e81f9ba039da2469ba694a9b6f5a91a8c87 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 28 May 2026 15:56:36 +0300 Subject: fix: Improve argument checks and constraints --- BigInt.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'BigInt.h') diff --git a/BigInt.h b/BigInt.h index 89cb3ab..db04c5d 100644 --- a/BigInt.h +++ b/BigInt.h @@ -10,7 +10,7 @@ typedef void* BigInt; BigInt B_new(MemoryManager *mm, int value); BigInt B_newstr(MemoryManager *mm, const char* str); BigInt B_newbytes(MemoryManager *mm, usize bytes); -BigInt B_dup(MemoryManager *mm, BigInt bigint); +BigInt B_dup(MemoryManager *mm, const BigInt bigint); BigInt B_newsum(MemoryManager *mm, BigInt a, BigInt b); BigInt B_newsub(MemoryManager *mm, BigInt a, BigInt b); @@ -21,21 +21,21 @@ Result B_free(BigInt *bigint); /* Modify */ -Result B_sum(BigInt *a, BigInt b); -Result B_sub(BigInt *a, BigInt b); +Result B_sum(BigInt *a, const BigInt b); +Result B_sub(BigInt *a, const BigInt b); Result B_compl(BigInt *x); -Result B_bitand(BigInt *x, BigInt *y); -Result B_bitor(BigInt *x, BigInt *y); -Result B_bitxor(BigInt *x, BigInt *y); +Result B_bitand(BigInt *x, const BigInt y); +Result B_bitor(BigInt *x, const BigInt y); +Result B_bitxor(BigInt *x, const BigInt y); Result B_rshift(BigInt *x, usize shift); Result B_lshift(BigInt *x, usize shift); /* Get */ -usize B_bytes(BigInt x); -usize B_bitwidth(BigInt x); -char* B_tostr(MemoryManager *mm, BigInt x); +usize B_bytes(const BigInt x); +usize B_bitwidth(const BigInt x); +char* B_tostr(MemoryManager *mm, const BigInt x); int B_eq(const BigInt x, const BigInt y); int B_not_eq(const BigInt x, const BigInt y); -- cgit v1.2.3