From ef8d2ceb0f1e4292d606b80f9946fd6b0a5a7828 Mon Sep 17 00:00:00 2001 From: Alcaro Date: Fri, 21 Feb 2014 21:42:05 +0100 Subject: [PATCH] Convert this one to an out parameter, to match state_manager_pop. --- retroarch.c | 6 ++++-- rewind.c | 10 +++++----- rewind.h | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/retroarch.c b/retroarch.c index 8d7a7689c8..2a3571b22b 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1548,7 +1548,8 @@ void rarch_init_rewind(void) if (!g_extern.state_manager) RARCH_WARN("Failed to init rewind buffer. Rewinding will be disabled.\n"); - void *state=state_manager_push_where(g_extern.state_manager); + void *state; + state_manager_push_where(g_extern.state_manager, &state); pretro_serialize(state, g_extern.state_size); state_manager_push_do(g_extern.state_manager); } @@ -2186,7 +2187,8 @@ static void check_rewind(void) if (cnt == 0) #endif { - void *state=state_manager_push_where(g_extern.state_manager); + void *state; + state_manager_push_where(g_extern.state_manager, &state); pretro_serialize(state, g_extern.state_size); state_manager_push_do(g_extern.state_manager); } diff --git a/rewind.c b/rewind.c index 86082aedb4..ed189761e1 100644 --- a/rewind.c +++ b/rewind.c @@ -213,7 +213,7 @@ bool state_manager_pop(state_manager_t *state, void **data) return true; } -void *state_manager_push_where(state_manager_t *state) +void state_manager_push_where(state_manager_t *state, void **data) { //We need to ensure we have an uncompressed copy of the last pushed state, or we could // end up applying a 'patch' to wrong savestate, and that'd blow up rather quickly. @@ -226,14 +226,14 @@ void *state_manager_push_where(state_manager_t *state) } } - return state->nextblock; + *data=state->nextblock; } -bool state_manager_push_do(state_manager_t *state) +void state_manager_push_do(state_manager_t *state) { if (state->thisblock_valid) { - if (state->capacitymaxcompsize) return false; + if (state->capacitymaxcompsize) return; recheckcapacity:; size_t headpos = (state->head-state->data); @@ -368,7 +368,7 @@ bool state_manager_push_do(state_manager_t *state) state->entries++; - return true; + return; } void state_manager_capacity(state_manager_t *state, unsigned int * entries, size_t * bytes, bool * full) diff --git a/rewind.h b/rewind.h index 1000024f15..74f66e8081 100644 --- a/rewind.h +++ b/rewind.h @@ -24,8 +24,8 @@ typedef struct state_manager state_manager_t; state_manager_t *state_manager_new(size_t state_size, size_t buffer_size); void state_manager_free(state_manager_t *state); bool state_manager_pop(state_manager_t *state, void **data); -void *state_manager_push_where(state_manager_t *state); -bool state_manager_push_do(state_manager_t *state); +void state_manager_push_where(state_manager_t *state, void **data); +void state_manager_push_do(state_manager_t *state); void state_manager_capacity(state_manager_t *state, unsigned int *entries, size_t *bytes, bool *full); #endif