Declare this one constant. Altering it will make further pulls yield garbage.

This commit is contained in:
Alcaro 2014-02-21 21:51:58 +01:00
parent ef8d2ceb0f
commit df4ff9718b
3 changed files with 5 additions and 5 deletions

View File

@ -2160,7 +2160,7 @@ static void check_rewind(void)
if (input_key_pressed_func(RARCH_REWIND))
{
msg_queue_clear(g_extern.msg_queue);
void *buf;
const void *buf;
if (state_manager_pop(g_extern.state_manager, &buf))
{
g_extern.frame_is_reverse = true;

View File

@ -161,7 +161,7 @@ void state_manager_free(state_manager_t *state)
free(state);
}
bool state_manager_pop(state_manager_t *state, void **data)
bool state_manager_pop(state_manager_t *state, const void **data)
{
*data = NULL;
@ -219,8 +219,8 @@ void state_manager_push_where(state_manager_t *state, void **data)
// end up applying a 'patch' to wrong savestate, and that'd blow up rather quickly.
if (!state->thisblock_valid)
{
void *ignore;
if (state_manager_pop(state, &ignore))
const void *ignored;
if (state_manager_pop(state, &ignored))
{
state->thisblock_valid = true;
}

View File

@ -23,7 +23,7 @@ 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);
bool state_manager_pop(state_manager_t *state, const void **data);
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);