diff --git a/command.c b/command.c index 46a3e51a9c..768fa2b77b 100644 --- a/command.c +++ b/command.c @@ -264,23 +264,26 @@ static bool command_read_ram(const char *arg) { cheevos_var_t var; unsigned i; - char *reply = NULL; - const uint8_t * data = NULL; - char *reply_at = NULL; - unsigned int nbytes = 0; + char *reply = NULL; + const uint8_t * data = NULL; + char *reply_at = NULL; + unsigned int nbytes = 0; unsigned int alloc_size = 0; - int addr = -1; + int addr = -1; if (sscanf(arg, "%x %d", &addr, &nbytes) != 2) return true; - alloc_size = 40 + nbytes * 3; //We alloc more than needed, saving 20 bytes is not really relevant - reply = (char*) malloc(alloc_size); - reply[0] = '\0'; - reply_at = reply + sprintf(reply, SMY_CMD_STR " %x", addr); - var.value = addr; + alloc_size = 40 + nbytes * 3; /* We alloc more than needed, saving 20 bytes is not really relevant */ + reply = (char*) malloc(alloc_size); + reply[0] = '\0'; + reply_at = reply + sprintf(reply, SMY_CMD_STR " %x", addr); + + var.value = addr; + cheevos_var_patch_addr(&var, cheevos_get_console()); - data = cheevos_var_get_memory(&var); + + data = cheevos_var_get_memory(&var); if (data) { diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index 1b4bcbb2b2..b87b5fba04 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -922,7 +922,7 @@ void fill_pathname_join_delim(char *out_path, const char *dir, const char *path, const char delim, size_t size) { size_t copied; - // behavior of strlcpy is undefined if dst and src overlap + /* behavior of strlcpy is undefined if dst and src overlap */ if (out_path == dir) copied = strlen(dir); else diff --git a/managers/cheat_manager.h b/managers/cheat_manager.h index 163002ae8c..ce795d9cc0 100644 --- a/managers/cheat_manager.h +++ b/managers/cheat_manager.h @@ -52,7 +52,7 @@ enum cheat_search_type CHEAT_SEARCH_TYPE_EQ, CHEAT_SEARCH_TYPE_NEQ, CHEAT_SEARCH_TYPE_EQPLUS, - CHEAT_SEARCH_TYPE_EQMINUS, + CHEAT_SEARCH_TYPE_EQMINUS }; enum cheat_match_action_type @@ -113,19 +113,19 @@ struct item_cheat * 1 : 11110000 */ unsigned int address_mask ; - //Whether to apply the cheat based on big-endian console memory or not + /* Whether to apply the cheat based on big-endian console memory or not */ bool big_endian ; unsigned int rumble_type ; unsigned int rumble_value ; unsigned int rumble_prev_value ; unsigned int rumble_initialized ; - unsigned int rumble_port ; //0-15 for specific port, anything else means "all ports" - unsigned int rumble_primary_strength ; //0-65535 - unsigned int rumble_primary_duration ; //in milliseconds - retro_time_t rumble_primary_end_time ; //clock value for when rumbling should stop - unsigned int rumble_secondary_strength ; //0-65535 - unsigned int rumble_secondary_duration ; //in milliseconds - retro_time_t rumble_secondary_end_time ; //clock value for when rumbling should stop + unsigned int rumble_port ; /* 0-15 for specific port, anything else means "all ports" */ + unsigned int rumble_primary_strength ; /* 0-65535 */ + unsigned int rumble_primary_duration ; /* in milliseconds */ + retro_time_t rumble_primary_end_time ; /* clock value for when rumbling should stop */ + unsigned int rumble_secondary_strength ; /* 0-65535 */ + unsigned int rumble_secondary_duration ; /* in milliseconds */ + retro_time_t rumble_secondary_end_time ; /* clock value for when rumbling should stop */ }; struct cheat_manager diff --git a/retroarch.c b/retroarch.c index 89ba805e9e..6ec4ddf508 100644 --- a/retroarch.c +++ b/retroarch.c @@ -2713,16 +2713,17 @@ static enum runloop_state runloop_check_state( } else { - if ( global->menu.prev_action == action && global->menu.noop_press_time < 200000) //250ms + if ( global->menu.prev_action == action && + global->menu.noop_press_time < 200000) /* 250ms */ { - global->menu.action_start_time = global->menu.prev_start_time ; + global->menu.action_start_time = global->menu.prev_start_time ; global->menu.action_press_time = cpu_features_get_time_usec() - global->menu.action_start_time; } else { - global->menu.prev_start_time = cpu_features_get_time_usec() ; - global->menu.prev_action = action ; - global->menu.action_press_time = 0 ; + global->menu.prev_start_time = cpu_features_get_time_usec() ; + global->menu.prev_action = action; + global->menu.action_press_time = 0; } } }