btcs

bitcoin script parser/evaluator/compiler/decompiler
git clone git://jb55.com/btcs
Log | Files | Refs | README | LICENSE

commit 0eaa8b7342fdd76c99d84362515434467d206771
parent 21379dfb5b5c4d7f0d863d1067e05713484e2635
Author: William Casarin <jb55@jb55.com>
Date:   Thu, 26 Oct 2017 10:29:54 -0700

gcc: fix issues with gcc

Diffstat:
Mop.c | 2++
Mop.h | 5+++--
Mscript.c | 4----
Mstack.h | 2+-
4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/op.c b/op.c @@ -134,6 +134,8 @@ op_from_token(enum opcode_token opcode) { case _OP_PUBKEY: return OP_PUBKEY; case _OP_INVALIDOPCODE: return OP_INVALIDOPCODE; } + + return OP_INVALIDOPCODE; } const char* diff --git a/op.h b/op.h @@ -308,8 +308,9 @@ enum valtype { // UPDATE VAL_TYPE_BITS if you need more valtypes -static const int VAL_TYPE_BITS = 1; -static const int COMPACT_VAL_BITS = (32-VAL_TYPE_BITS-1); +#define VAL_TYPE_BITS 1 +/* static const int COMPACT_VAL_BITS = (32-VAL_TYPE_BITS-1); */ +#define COMPACT_VAL_BITS 30 struct val { u8 is_big : 1; diff --git a/script.c b/script.c @@ -4,10 +4,6 @@ #include "stack.h" #include <stdio.h> -static int stack_end(struct stack *stack) { - return stack_size(stack); -} - void script_add_error(const char *serror) { // TODO: set_error fprintf(stderr, "error: %s\n", serror); diff --git a/stack.h b/stack.h @@ -11,7 +11,7 @@ static const int MAX_STACK_SIZE = 1000; // Maximum number of values on script interpreter stack -static const int DEFAULT_STACK_SIZE = 32; +#define DEFAULT_STACK_SIZE 32 struct stack { void *_data[DEFAULT_STACK_SIZE];