diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-06-12 21:29:21 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-06-12 21:29:21 +0200 |
commit | 699f283ca77c5685c9dc610805312215eef9babc (patch) | |
tree | 8c7dcc9854d8dc476c28904d9093e77d926f2604 /src/mintdb/perf_taler_mintdb_interpreter.c | |
parent | 5c01da52b1309607311b0b2e608e5de3a77b7ffe (diff) | |
parent | 6c440e0cec9b1faa0ae819e85f9974fddd38b9c2 (diff) | |
download | exchange-699f283ca77c5685c9dc610805312215eef9babc.tar.gz exchange-699f283ca77c5685c9dc610805312215eef9babc.tar.bz2 exchange-699f283ca77c5685c9dc610805312215eef9babc.zip |
Merge branch 'master' of git+ssh://git.taler.net/var/git/mint
Diffstat (limited to 'src/mintdb/perf_taler_mintdb_interpreter.c')
-rw-r--r-- | src/mintdb/perf_taler_mintdb_interpreter.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/mintdb/perf_taler_mintdb_interpreter.c b/src/mintdb/perf_taler_mintdb_interpreter.c index 8efe0a771..ac2ea1e6e 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.c +++ b/src/mintdb/perf_taler_mintdb_interpreter.c @@ -135,7 +135,7 @@ static int cmd_clean (struct PERF_TALER_MINTDB_Cmd cmd[]) { int i = 0; - for (i=0; PERF_TALER_MINTDB_CMD_END != cmd[i].command; i++) + for (i = 0; PERF_TALER_MINTDB_CMD_END != cmd[i].command; i++) { switch (cmd[i].command) { @@ -152,15 +152,12 @@ cmd_clean (struct PERF_TALER_MINTDB_Cmd cmd[]) cmd[i].details.save_array.data_saved = NULL; } - case PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT: - PERF_TALER_MINTDB_deposit_free (cmd[i].exposed.deposit); - break; - case PERF_TALER_MINTDB_CMD_LOAD_ARRAY: GNUNET_free (cmd[i].details.load_array.permutation); break; default: + data_free (&cmd[i].exposed, cmd[i].exposed_type); break; } @@ -178,15 +175,17 @@ interpret_end_loop (struct PERF_TALER_MINTDB_interpreter_state *state) { int jump = cmd_find (state->cmd, state->cmd[state->i].details.end_loop.label_loop); + + state->cmd[jump].details.loop.curr_iteration++; // If the loop is not finished if (state->cmd[jump].details.loop.max_iterations > state->cmd[jump].details.loop.curr_iteration) { // jump back to the start - state->i = jump -1; + state->i = jump; }else{ // Reset the loop counter and continue running - state->cmd[jump].details.loop.curr_iteration = -1; + state->cmd[jump].details.loop.curr_iteration = 0; } // Cleaning up the memory in the loop int j; @@ -216,8 +215,11 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) case PERF_TALER_MINTDB_CMD_END: return GNUNET_YES; + case PERF_TALER_MINTDB_CMD_DEBUG: + printf("%s\n", state->cmd[state->i].label); + break; + case PERF_TALER_MINTDB_CMD_LOOP: - state->cmd[state->i].details.loop.curr_iteration++; break; case PERF_TALER_MINTDB_CMD_END_LOOP: |