C89_BUILD fixes

This commit is contained in:
twinaphex 2016-06-23 07:40:51 +02:00
parent dee7533d65
commit a6bfc6240f
3 changed files with 17 additions and 17 deletions

View File

@ -2088,9 +2088,9 @@ bool command_event(enum event_command cmd, void *data)
break;
case CMD_EVENT_CORE_DEINIT:
{
struct retro_hw_render_callback *hwr = NULL;
content_reset_savestate_backups();
struct retro_hw_render_callback *hwr =
video_driver_get_hw_context();
hwr = video_driver_get_hw_context();
command_event_deinit_core(true);
if (hwr)

View File

@ -1912,14 +1912,16 @@ static void frontend_linux_exitspawn(char *core_path, size_t core_path_size)
static uint64_t frontend_linux_get_mem_total(void)
{
FILE* data = fopen("/proc/meminfo", "r");
char line[256];
uint64_t total = 0;
FILE * data = fopen("/proc/meminfo", "r");
if (!data)
return 0;
char line[256];
uint64_t total = 0;
while (fgets(line, sizeof(line), data)) {
if (sscanf(line, "MemTotal: " STRING_REP_ULONG " kB", &total) == 1) {
while (fgets(line, sizeof(line), data))
{
if (sscanf(line, "MemTotal: " STRING_REP_ULONG " kB", &total) == 1)
{
fclose(data);
total *= 1024;
return total;
@ -1932,16 +1934,15 @@ static uint64_t frontend_linux_get_mem_total(void)
static uint64_t frontend_linux_get_mem_used(void)
{
FILE* data = fopen("/proc/meminfo", "r");
if (!data)
return 0;
char line[256];
uint64_t total = 0;
uint64_t freemem = 0;
uint64_t buffers = 0;
uint64_t cached = 0;
FILE* data = fopen("/proc/meminfo", "r");
if (!data)
return 0;
char line[256];
while (fgets(line, sizeof(line), data))
{
if (sscanf(line, "MemTotal: " STRING_REP_ULONG " kB", &total) == 1)

View File

@ -68,14 +68,13 @@ struct sram_block
bool content_undo_load_state()
{
unsigned i;
//ssize_t size;
retro_ctx_serialize_info_t serial_info;
size_t temp_data_size;
void* temp_data = NULL;
unsigned num_blocks = 0;
//void *buf = NULL;
struct sram_block *blocks = NULL;
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
//bool ret = filestream_read_file(path, &buf, &size);
RARCH_LOG("%s: \"%s\".\n",
msg_hash_to_str(MSG_LOADING_STATE),
@ -138,8 +137,8 @@ bool content_undo_load_state()
}
/* We need to make a temporary copy of the buffer, to allow the swap below */
void* temp_data = malloc(undo_load_buf.size);
size_t temp_data_size = undo_load_buf.size;
temp_data = malloc(undo_load_buf.size);
temp_data_size = undo_load_buf.size;
memcpy(temp_data, undo_load_buf.data, undo_load_buf.size);
serial_info.data_const = temp_data;