From 50bbf1bcddd1daa90ee56c3ea16e6c59a4d915ac Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sun, 27 Jul 2025 22:54:44 +0900 Subject: [PATCH] mruby-bigint: remove unnecessary forward prototypes Remove forward declarations for functions where definitions appear before usage: - mpz_mul_sliding_window - mpz_realloc, mpz_clear, mpz_move Keep necessary forward declarations for Barrett reduction functions that are used before their definitions. Co-authored-by: Claude --- mrbgems/mruby-bigint/core/bigint.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/mrbgems/mruby-bigint/core/bigint.c b/mrbgems/mruby-bigint/core/bigint.c index cccf7d1cd..01aae4f26 100644 --- a/mrbgems/mruby-bigint/core/bigint.c +++ b/mrbgems/mruby-bigint/core/bigint.c @@ -40,9 +40,6 @@ typedef struct mpz_context { mpz_pool_t *pool; /* NULL for heap-only operations */ } mpz_ctx_t; -/* Forward declarations */ -static int mpz_mul_sliding_window(mpz_ctx_t *ctx, mpz_t *result, mpz_t *first, mpz_t *second); - /* Convenience macros for context creation */ #define MPZ_CTX_HEAP(mrb_ptr) ((mpz_ctx_t){.mrb = (mrb_ptr), .pool = NULL}) #define MPZ_CTX_POOL(mrb_ptr, pool_ptr) ((mpz_ctx_t){.mrb = (mrb_ptr), .pool = (pool_ptr)}) @@ -60,7 +57,6 @@ static int mpz_mul_sliding_window(mpz_ctx_t *ctx, mpz_t *result, mpz_t *first, m pool_name##_storage.active = 0; \ } while(0) - /* Pool allocation functions */ static mp_limb* pool_alloc(mpz_pool_t *pool, size_t limbs) @@ -197,7 +193,6 @@ mpz_set(mpz_ctx_t *ctx, mpz_t *y, mpz_t *x) y->sn = x->sn; } - static void mpz_init_set(mpz_ctx_t *ctx, mpz_t *s, mpz_t *t) { @@ -307,10 +302,6 @@ mpz_move(mpz_ctx_t *ctx, mpz_t *y, mpz_t *x) x->sz = 0; } -/* Forward declarations for context-aware functions */ -static void mpz_realloc(mpz_ctx_t *ctx, mpz_t *x, size_t size); -static void mpz_clear(mpz_ctx_t *ctx, mpz_t *s); -static void mpz_move(mpz_ctx_t *ctx, mpz_t *y, mpz_t *x); static size_t digits(mpz_t *x) @@ -432,7 +423,6 @@ zero(mpz_t *x) } } - /* z = x + y */ static void mpz_add(mpz_ctx_t *ctx, mpz_t *zz, mpz_t *x, mpz_t *y)