diff options
author | Justus Winter <[email protected]> | 2017-03-29 16:05:33 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2017-04-10 12:57:30 +0000 |
commit | a1ad5d6a30cf72d9b7e7bb449985dc69d5e01c4b (patch) | |
tree | da8d383c744d35379149f8f426f837d161535063 /tests/gpgscm/scheme.c | |
parent | gpgscm: Add and use opcode for reversing a list in place. (diff) | |
download | gnupg-a1ad5d6a30cf72d9b7e7bb449985dc69d5e01c4b.tar.gz gnupg-a1ad5d6a30cf72d9b7e7bb449985dc69d5e01c4b.zip |
gpgscm: Make tags mandatory.
* tests/gpgscm/opdefines.h: Make tags mandatory.
* tests/gpgscm/scheme.c: Likewise.
* tests/gpgscm/scheme.h: Likewise.
--
Tags provide a constant-time lookup mechanism for almost every object.
This is useful for the interpreter itself, and the code for tags is
tiny.
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to '')
-rw-r--r-- | tests/gpgscm/scheme.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c index f3a99fde9..fa089a065 100644 --- a/tests/gpgscm/scheme.c +++ b/tests/gpgscm/scheme.c @@ -671,8 +671,6 @@ copy_value(scheme *sc, pointer dst, pointer src) /* Tags are like property lists, but can be attached to arbitrary * values. */ -#if USE_TAGS - static pointer mk_tagged_value(scheme *sc, pointer v, pointer tag_car, pointer tag_cdr) { @@ -709,14 +707,6 @@ get_tag(scheme *sc, pointer v) return sc->NIL; } -#else - -#define mk_tagged_value(SC, X, A, B) (X) -#define has_tag(V) 0 -#define get_tag(SC, V) (SC)->NIL - -#endif - /* Low-level allocator. @@ -4718,7 +4708,6 @@ static pointer opexe_0(scheme *sc, enum scheme_opcodes op) { s_return(sc, get_property(sc, car(sc->args), cadr(sc->args))); #endif /* USE_PLIST */ -#if USE_TAGS CASE(OP_TAG_VALUE): { /* not exposed */ /* This tags sc->value with car(sc->args). Useful to tag * results of opcode evaluations. */ @@ -4738,7 +4727,6 @@ static pointer opexe_0(scheme *sc, enum scheme_opcodes op) { CASE(OP_GET_TAG): /* get-tag */ s_return(sc, get_tag(sc, car(sc->args))); -#endif /* USE_TAGS */ CASE(OP_QUIT): /* quit */ if(is_pair(sc->args)) { @@ -4927,12 +4915,12 @@ static pointer opexe_0(scheme *sc, enum scheme_opcodes op) { } else if (sc->tok == TOK_DOT) { Error_0(sc,"syntax error: illegal dot expression"); } else { -#if USE_TAGS && SHOW_ERROR_LINE +#if SHOW_ERROR_LINE pointer filename; pointer lineno; #endif sc->nesting_stack[sc->file_i]++; -#if USE_TAGS && SHOW_ERROR_LINE +#if SHOW_ERROR_LINE filename = sc->load_stack[sc->file_i].filename; lineno = sc->load_stack[sc->file_i].curr_line; |