From f491cd35df2ee62ed55a82ba70dc280f50984213 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 30 Apr 2013 15:57:40 +0200 Subject: [PATCH] Make constants constant --- src/group.h | 2 +- src/impl/ecmult.h | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/group.h b/src/group.h index cc6cc17..7dd9a9d 100644 --- a/src/group.h +++ b/src/group.h @@ -29,7 +29,7 @@ typedef struct { secp256k1_num_t lambda, a1b2, b1, a2; } secp256k1_ge_consts_t; -static secp256k1_ge_consts_t *secp256k1_ge_consts = NULL; +static const secp256k1_ge_consts_t *secp256k1_ge_consts = NULL; /** Initialize the group module. */ void static secp256k1_ge_start(void); diff --git a/src/impl/ecmult.h b/src/impl/ecmult.h index 0261a27..0828488 100644 --- a/src/impl/ecmult.h +++ b/src/impl/ecmult.h @@ -66,7 +66,7 @@ typedef struct { secp256k1_ge_t fin; // -(sum(prec[j][0], j=0..63)) } secp256k1_ecmult_consts_t; -static secp256k1_ecmult_consts_t *secp256k1_ecmult_consts = NULL; +static const secp256k1_ecmult_consts_t *secp256k1_ecmult_consts = NULL; static void secp256k1_ecmult_start(void) { if (secp256k1_ecmult_consts != NULL) @@ -109,7 +109,8 @@ static void secp256k1_ecmult_stop(void) { if (secp256k1_ecmult_consts == NULL) return; - free(secp256k1_ecmult_consts); + secp256k1_ecmult_consts_t *c = (secp256k1_ecmult_consts_t*)secp256k1_ecmult_consts; + free(c); secp256k1_ecmult_consts = NULL; }