[Pkg-gnupg-commit] [gnupg2] 32/132: gpgscm: Merge 'opexe_6'.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed May 17 03:07:39 UTC 2017


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch experimental
in repository gnupg2.

commit ddf444828b9b3f75d964473a2c0e77f75f094cf4
Author: Justus Winter <justus at g10code.com>
Date:   Wed Mar 29 14:05:22 2017 +0200

    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 <justus at g10code.com>
---
 tests/gpgscm/opdefines.h | 12 ++++++------
 tests/gpgscm/scheme.c    | 24 +++++-------------------
 2 files changed, 11 insertions(+), 25 deletions(-)

diff --git a/tests/gpgscm/opdefines.h b/tests/gpgscm/opdefines.h
index 9cb723a..1a5076b 100644
--- a/tests/gpgscm/opdefines.h
+++ b/tests/gpgscm/opdefines.h
@@ -196,11 +196,11 @@
     _OP_DEF(opexe_0, 0,                                0,  0,       0,                               OP_P0LIST           )
     _OP_DEF(opexe_0, 0,                                0,  0,       0,                               OP_P1LIST           )
     _OP_DEF(opexe_0, 0,                                0,  0,       0,                               OP_PVECFROM         )
-    _OP_DEF(opexe_6, "length",                         1,  1,       TST_LIST,                        OP_LIST_LENGTH      )
-    _OP_DEF(opexe_6, "assq",                           2,  2,       TST_NONE,                        OP_ASSQ             )
-    _OP_DEF(opexe_6, "get-closure-code",               1,  1,       TST_NONE,                        OP_GET_CLOSURE      )
-    _OP_DEF(opexe_6, "closure?",                       1,  1,       TST_NONE,                        OP_CLOSUREP         )
-    _OP_DEF(opexe_6, "macro?",                         1,  1,       TST_NONE,                        OP_MACROP           )
-    _OP_DEF(opexe_6, "*vm-history*",                   0,  0,       TST_NONE,                        OP_VM_HISTORY       )
+    _OP_DEF(opexe_0, "length",                         1,  1,       TST_LIST,                        OP_LIST_LENGTH      )
+    _OP_DEF(opexe_0, "assq",                           2,  2,       TST_NONE,                        OP_ASSQ             )
+    _OP_DEF(opexe_0, "get-closure-code",               1,  1,       TST_NONE,                        OP_GET_CLOSURE      )
+    _OP_DEF(opexe_0, "closure?",                       1,  1,       TST_NONE,                        OP_CLOSUREP         )
+    _OP_DEF(opexe_0, "macro?",                         1,  1,       TST_NONE,                        OP_MACROP           )
+    _OP_DEF(opexe_0, "*vm-history*",                   0,  0,       TST_NONE,                        OP_VM_HISTORY       )
 
 #undef _OP_DEF
diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index 917f46b..f90ac3f 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)) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git



More information about the Pkg-gnupg-commit mailing list