mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 08:30:16 +00:00
Convert this one to an out parameter, to match state_manager_pop.
This commit is contained in:
parent
30ebb55602
commit
ef8d2ceb0f
@ -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);
|
||||
}
|
||||
|
10
rewind.c
10
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->capacity<sizeof(size_t)+state->maxcompsize) return false;
|
||||
if (state->capacity<sizeof(size_t)+state->maxcompsize) 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)
|
||||
|
4
rewind.h
4
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
|
||||
|
Loading…
Reference in New Issue
Block a user