aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gpgscm/scheme.c
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-03-29 12:05:22 +0000
committerJustus Winter <[email protected]>2017-04-10 12:57:21 +0000
commitddf444828b9b3f75d964473a2c0e77f75f094cf4 (patch)
treee4971cd30792737eb534a26804c644b3ff97d604 /tests/gpgscm/scheme.c
parentgpgscm: Merge 'opexe_5'. (diff)
downloadgnupg-ddf444828b9b3f75d964473a2c0e77f75f094cf4.tar.gz
gnupg-ddf444828b9b3f75d964473a2c0e77f75f094cf4.zip
gpgscm: Merge 'opexe_6'.
* tests/gpgscm/scheme.c (opexe_6): Merge into 'opexe_0'. * tests/gpgscm/opdefines.h: Adapt. -- Having separate functions to execute opcodes reduces our ability to thread the code and prevents the dispatch_table from being moved to rodata. Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'tests/gpgscm/scheme.c')
-rw-r--r--tests/gpgscm/scheme.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index 917f46bb7..f90ac3f5e 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -438,7 +438,6 @@ static pointer reverse_in_place(scheme *sc, pointer term, pointer list);
static pointer revappend(scheme *sc, pointer a, pointer b);
static void dump_stack_mark(scheme *);
static pointer opexe_0(scheme *sc, enum scheme_opcodes op);
-static pointer opexe_6(scheme *sc, enum scheme_opcodes op);
static void Eval_Cycle(scheme *sc, enum scheme_opcodes op);
static void assign_syntax(scheme *sc, char *name);
static int syntaxnum(pointer p);
@@ -5158,27 +5157,14 @@ static pointer opexe_0(scheme *sc, enum scheme_opcodes op) {
}
}
- default:
- snprintf(sc->strbuff,STRBUFFSIZE,"%d: illegal operator", sc->op);
- Error_0(sc,sc->strbuff);
-
- }
- return sc->T;
-}
-
-static pointer opexe_6(scheme *sc, enum scheme_opcodes op) {
- pointer x, y;
- long v;
-
- switch (op) {
- CASE(OP_LIST_LENGTH): /* length */ /* a.k */
- v=list_length(sc,car(sc->args));
- if(v<0) {
+ CASE(OP_LIST_LENGTH): { /* length */ /* a.k */
+ long l = list_length(sc, car(sc->args));
+ if(l<0) {
Error_1(sc,"length: not a list:",car(sc->args));
}
gc_disable(sc, 1);
- s_return_enable_gc(sc, mk_integer(sc, v));
-
+ s_return_enable_gc(sc, mk_integer(sc, l));
+ }
CASE(OP_ASSQ): /* assq */ /* a.k */
x = car(sc->args);
for (y = cadr(sc->args); is_pair(y); y = cdr(y)) {