Skip to content

Commit

Permalink
C89 build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Apr 25, 2018
1 parent be43272 commit 0418a44
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libretro.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ static void update_input(void)

static void extract_basename(char *buf, const char *path, size_t size)
{
char *ext = NULL;
const char *base = strrchr(path, '/');
if (!base)
base = strrchr(path, '\\');
Expand All @@ -245,7 +246,7 @@ static void extract_basename(char *buf, const char *path, size_t size)
strncpy(buf, base, size - 1);
buf[size - 1] = '\0';

char *ext = strrchr(buf, '.');
ext = strrchr(buf, '.');
if (ext)
*ext = '\0';
}
Expand Down Expand Up @@ -313,7 +314,9 @@ void retro_cheat_set(unsigned index, bool enabled, const char *code)

bool retro_load_game(const struct retro_game_info *info)
{
char slash;
unsigned i;
const char *save_dir = NULL;
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_XRGB8888;

struct retro_input_descriptor desc[] = {
Expand Down Expand Up @@ -382,15 +385,13 @@ bool retro_load_game(const struct retro_game_info *info)

// Get eeprom path info
// > Handle Windows nonsense...
char slash;
#if defined(_WIN32)
slash = '\\';
#else
slash = '/';
#endif
// > Get save path
vjs.EEPROMPath[0] = '\0';
const char *save_dir = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY, &save_dir) && save_dir)
{
if (strlen(save_dir) > 0)
Expand Down

0 comments on commit 0418a44

Please sign in to comment.