diff --git a/intl/msg_hash_de.c b/intl/msg_hash_de.c index a687e4fad7..47b5c1e087 100644 --- a/intl/msg_hash_de.c +++ b/intl/msg_hash_de.c @@ -15,9 +15,9 @@ #include "../msg_hash.h" -const char *msg_hash_to_str_de(uint32_t hash) +const char *msg_hash_to_str_de(enum msg_hash_enums msg) { - switch (hash) + switch (msg) { case 0: default: diff --git a/intl/msg_hash_eo.c b/intl/msg_hash_eo.c index caaee85ef9..f31cba720a 100644 --- a/intl/msg_hash_eo.c +++ b/intl/msg_hash_eo.c @@ -15,9 +15,9 @@ #include "../msg_hash.h" -const char *msg_hash_to_str_eo(uint32_t hash) +const char *msg_hash_to_str_eo(enum msg_hash_enums msg) { - switch (hash) + switch (msg) { case 0: default: diff --git a/intl/msg_hash_es.c b/intl/msg_hash_es.c index 7844ded498..0dd6340600 100644 --- a/intl/msg_hash_es.c +++ b/intl/msg_hash_es.c @@ -28,9 +28,9 @@ /* DO NOT REMOVE THIS. If it causes build failure, it's because you saved the file as UTF-8. Read the above comment. */ extern const char force_iso_8859_1[sizeof("äÄöÖßüÜ")==7+1 ? 1 : -1]; -const char *msg_hash_to_str_es(uint32_t hash) +const char *msg_hash_to_str_es(enum msg_hash_enums msg) { - switch (hash) + switch (msg) { case MSG_PROGRAM: return "RetroArch"; diff --git a/intl/msg_hash_fr.c b/intl/msg_hash_fr.c index 01d1719bf0..8a2d9292f8 100644 --- a/intl/msg_hash_fr.c +++ b/intl/msg_hash_fr.c @@ -28,9 +28,9 @@ /* DO NOT REMOVE THIS. If it causes build failure, it's because you saved the file as UTF-8. Read the above comment. */ extern const char force_iso_8859_1[sizeof("äÄöÖßüÜ")==7+1 ? 1 : -1]; -const char *msg_hash_to_str_fr(uint32_t hash) +const char *msg_hash_to_str_fr(enum msg_hash_enums msg) { - switch (hash) + switch (msg) { case MSG_PROGRAM: return "RetroArch"; diff --git a/intl/msg_hash_it.c b/intl/msg_hash_it.c index 8a47519e05..03b3d2cb0e 100644 --- a/intl/msg_hash_it.c +++ b/intl/msg_hash_it.c @@ -15,9 +15,9 @@ #include "../msg_hash.h" -const char *msg_hash_to_str_it(uint32_t hash) +const char *msg_hash_to_str_it(enum msg_hash_enums msg) { - switch (hash) + switch (msg) { case 0: default: diff --git a/intl/msg_hash_nl.c b/intl/msg_hash_nl.c index 1ddf742ab6..96f1db94ec 100644 --- a/intl/msg_hash_nl.c +++ b/intl/msg_hash_nl.c @@ -15,9 +15,9 @@ #include "../msg_hash.h" -const char *msg_hash_to_str_nl(uint32_t hash) +const char *msg_hash_to_str_nl(enum msg_hash_enums msg) { - switch (hash) + switch (msg) { case 0: default: diff --git a/intl/msg_hash_pl.c b/intl/msg_hash_pl.c index 20b781c09b..b0e998cee2 100644 --- a/intl/msg_hash_pl.c +++ b/intl/msg_hash_pl.c @@ -15,9 +15,9 @@ #include "../msg_hash.h" -const char *msg_hash_to_str_pl(uint32_t hash) +const char *msg_hash_to_str_pl(enum msg_hash_enums msg) { - switch (hash) + switch (msg) { case MSG_PROGRAM: return "RetroArch"; diff --git a/intl/msg_hash_pt.c b/intl/msg_hash_pt.c index 854746b298..3f01c89366 100644 --- a/intl/msg_hash_pt.c +++ b/intl/msg_hash_pt.c @@ -15,9 +15,9 @@ #include "../msg_hash.h" -const char *msg_hash_to_str_pt(uint32_t hash) +const char *msg_hash_to_str_pt(enum msg_hash_enums msg) { - switch (hash) + switch (msg) { case MSG_UNKNOWN: return "Desconhecido"; diff --git a/intl/msg_hash_ru.c b/intl/msg_hash_ru.c index 934a66a5e1..665fa82750 100644 --- a/intl/msg_hash_ru.c +++ b/intl/msg_hash_ru.c @@ -16,9 +16,9 @@ #include "../msg_hash.h" -const char *msg_hash_to_str_ru(uint32_t hash) +const char *msg_hash_to_str_ru(enum msg_hash_enums msg) { - switch (hash) + switch (msg) { case MSG_PROGRAM: return "RetroArch"; diff --git a/intl/msg_hash_us.c b/intl/msg_hash_us.c index 5c331af928..f4580c74b3 100644 --- a/intl/msg_hash_us.c +++ b/intl/msg_hash_us.c @@ -15,9 +15,9 @@ #include "../msg_hash.h" -const char *msg_hash_to_str_us(uint32_t hash) +const char *msg_hash_to_str_us(enum msg_hash_enums msg) { - switch (hash) + switch (msg) { case MSG_PROGRAM: return "RetroArch"; diff --git a/msg_hash.c b/msg_hash.c index 06ef0994bb..f3c7be7161 100644 --- a/msg_hash.c +++ b/msg_hash.c @@ -22,7 +22,7 @@ #include "configuration.h" -const char *msg_hash_to_str(uint32_t hash) +const char *msg_hash_to_str(enum msg_hash_enums msg) { const char *ret = NULL; settings_t *settings = config_get_ptr(); @@ -34,32 +34,32 @@ const char *msg_hash_to_str(uint32_t hash) switch (settings->user_language) { case RETRO_LANGUAGE_FRENCH: - ret = msg_hash_to_str_fr(hash); + ret = msg_hash_to_str_fr(msg); break; case RETRO_LANGUAGE_GERMAN: - ret = msg_hash_to_str_de(hash); + ret = msg_hash_to_str_de(msg); break; case RETRO_LANGUAGE_SPANISH: - ret = msg_hash_to_str_es(hash); + ret = msg_hash_to_str_es(msg); break; case RETRO_LANGUAGE_ITALIAN: - ret = msg_hash_to_str_it(hash); + ret = msg_hash_to_str_it(msg); break; case RETRO_LANGUAGE_PORTUGUESE: - ret = msg_hash_to_str_pt(hash); + ret = msg_hash_to_str_pt(msg); break; case RETRO_LANGUAGE_DUTCH: - ret = msg_hash_to_str_nl(hash); + ret = msg_hash_to_str_nl(msg); break; case RETRO_LANGUAGE_ESPERANTO: - ret = msg_hash_to_str_eo(hash); + ret = msg_hash_to_str_eo(msg); break; case RETRO_LANGUAGE_POLISH: - ret = msg_hash_to_str_pl(hash); + ret = msg_hash_to_str_pl(msg); break; case RETRO_LANGUAGE_RUSSIAN: #ifdef HAVE_UTF8 - ret = msg_hash_to_str_ru(hash); + ret = msg_hash_to_str_ru(msg); #endif break; default: @@ -71,7 +71,7 @@ const char *msg_hash_to_str(uint32_t hash) return ret; end: - return msg_hash_to_str_us(hash); + return msg_hash_to_str_us(msg); } uint32_t msg_hash_calculate(const char *s) diff --git a/msg_hash.h b/msg_hash.h index 03a11f6b4d..8624c67317 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -22,171 +22,124 @@ #include -#define MSG_UNKNOWN 0x3a834e55U -#define MSG_PROGRAM 0xc339565dU -#define MSG_FOUND_SHADER 0x817f42b7U - -#define MSG_LOADING_HISTORY_FILE 0x865210d3U -#define MSG_SRAM_WILL_NOT_BE_SAVED 0x16f17d61U - -#define MSG_RECEIVED 0xfe0c06acU - -#define MSG_LOADING_CONTENT_FILE 0x236398dcU - -#define MSG_USING_LIBRETRO_DUMMY_CORE_RECORDING_SKIPPED 0x9e8a1febU -#define MSG_RECORDING_TERMINATED_DUE_TO_RESIZE 0x361a07feU -#define MSG_FAILED_TO_START_RECORDING 0x90c3e2d5U - -#define MSG_REWIND_INIT 0xf7732001U -#define MSG_REWIND_INIT_FAILED 0x9c1db0a6U -#define MSG_REWIND_INIT_FAILED_THREADED_AUDIO 0x359001b6U -#define MSG_REWIND_INIT_FAILED_NO_SAVESTATES 0x979b9cc3U - -#define MSG_LIBRETRO_ABI_BREAK 0xf02cccd7U - -#define MSG_NETPLAY_FAILED 0x61ee3426U -#define MSG_NETPLAY_FAILED_MOVIE_PLAYBACK_HAS_STARTED 0xb1e5dbfcU - -#define MSG_DETECTED_VIEWPORT_OF 0xdf7002baU -#define MSG_RECORDING_TO 0x189fd324U -#define MSG_HW_RENDERED_MUST_USE_POSTSHADED_RECORDING 0x7f9f7659U -#define MSG_VIEWPORT_SIZE_CALCULATION_FAILED 0x9da84911U - -#define MSG_AUTOSAVE_FAILED 0x9a02d8d1U - -#define MSG_MOVIE_RECORD_STOPPED 0xbc7832c1U -#define MSG_MOVIE_PLAYBACK_ENDED 0xbeadce2aU - -#define MSG_TAKING_SCREENSHOT 0xdcfda0e0U -#define MSG_FAILED_TO_TAKE_SCREENSHOT 0x7a480a2dU - -#define MSG_CUSTOM_TIMING_GIVEN 0x259c95dfU - -#define MSG_SAVING_STATE 0xe4f3eb4dU -#define MSG_LOADING_STATE 0x68d8d483U -#define MSG_FAILED_TO_SAVE_STATE_TO 0xcc005f3cU -#define MSG_FAILED_TO_SAVE_SRAM 0x0f72de6cU -#define MSG_STATE_SIZE 0x27b67400U - -#define MSG_FAILED_TO_LOAD_CONTENT 0x0186e5a5U -#define MSG_COULD_NOT_READ_CONTENT_FILE 0x2dc7f4a0U -#define MSG_SAVED_SUCCESSFULLY_TO 0x9f59a7deU - -#define MSG_BYTES 0x0f30b64cU - -#define MSG_BLOCKING_SRAM_OVERWRITE 0x1f91d486U - -#define MSG_UNRECOGNIZED_COMMAND 0x946b8a50U - -#define MSG_SENDING_COMMAND 0x562cf28bU - -#define MSG_RESTARTING_RECORDING_DUE_TO_DRIVER_REINIT 0x5aa753b8U - -#define MSG_REWINDING 0xccbeec2cU -#define MSG_SLOW_MOTION_REWIND 0x385adb27U -#define MSG_SLOW_MOTION 0x744c437fU -#define MSG_REWIND_REACHED_END 0x4f1aab8fU -#define MSG_FAILED_TO_START_MOVIE_RECORD 0x61221776U - -#define MSG_CHEEVOS_HARDCORE_MODE_ENABLE 0x0d212ca9U - -#define MSG_STATE_SLOT 0x27b67f67U -#define MSG_STARTING_MOVIE_RECORD_TO 0x6a7e0d50U -#define MSG_FAILED_TO_START_MOVIE_RECORD 0x61221776U - -#define MSG_FAILED_TO_APPLY_SHADER 0x2094eb67U -#define MSG_APPLYING_SHADER 0x35599b7fU -#define MSG_SHADER 0x1bb1211cU - -#define MSG_REDIRECTING_SAVESTATE_TO 0x8d98f7a6U -#define MSG_REDIRECTING_SAVEFILE_TO 0x868c54a5U -#define MSG_REDIRECTING_CHEATFILE_TO 0xd5f1b27bU - -#define MSG_SCANNING 0x4c547516U -#define MSG_SCANNING_OF_DIRECTORY_FINISHED 0x399632a7U - -#define MSG_COULD_NOT_PROCESS_ZIP_FILE 0xc18c89bbU - -#define MSG_LOADED_STATE_FROM_SLOT 0xadb48582U - -#define MSG_REMOVING_TEMPORARY_CONTENT_FILE 0x7121c9e7U -#define MSG_FAILED_TO_REMOVE_TEMPORARY_FILE 0xb6707b1aU - -#define MSG_STARTING_MOVIE_PLAYBACK 0x96e545b6U - -#define MSG_APPENDED_DISK 0x814ea0f0U - -#define MSG_SKIPPING_SRAM_LOAD 0x88d4c8dbU - -#define MSG_CONFIG_DIRECTORY_NOT_SET 0xcd45252aU - -#define MSG_SAVED_STATE_TO_SLOT 0xe1e3dc3bU - -#define MSG_CORE_DOES_NOT_SUPPORT_SAVESTATES 0xd50adf46U -#define MSG_FAILED_TO_LOAD_STATE 0x91f348ebU - -#define MSG_FAILED_TO_LOAD_UNDO 0xb6e2fc55U -#define MSG_FAILED_TO_SAVE_UNDO 0xf2e29478U - -#define MSG_RESET 0x10474288U - -#define MSG_AUDIO_MUTED 0xfa0c3bd5U -#define MSG_AUDIO_UNMUTED 0x0512bab8U -#define MSG_FAILED_TO_UNMUTE_AUDIO 0xf698763aU - -#define MSG_FAILED_TO_LOAD_OVERLAY 0xacf201ecU - -#define MSG_PAUSED 0x143e3307U -#define MSG_UNPAUSED 0x95aede0aU - -#define MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS 0x6ba5abf9U - -#define MSG_GRAB_MOUSE_STATE 0x893a7329U - -#define MSG_FAILED_TO_LOAD_MOVIE_FILE 0x9455a5a9U - -#define MSG_FAILED_TO 0x768f6dacU - -#define MSG_SAVING_RAM_TYPE 0x9cd21d2dU - -#define MSG_TO 0x005979a8U - -#define MSG_VIRTUAL_DISK_TRAY 0x4aa37f15U -#define MSG_REMOVED_DISK_FROM_TRAY 0xf26a9653U - -#define MSG_FAILED_TO_REMOVE_DISK_FROM_TRAY 0xc1c9a655U - -#define MSG_GOT_INVALID_DISK_INDEX 0xb138dd76U - -#define MSG_TASK_FAILED 0xb23ed64aU -#define MSG_DOWNLOADING 0x465305dbU -#define MSG_EXTRACTING 0x25a4c19eU +enum msg_hash_enums +{ + MSG_UNKNOWN = 0, + MSG_PROGRAM, + MSG_FOUND_SHADER, + MSG_LOADING_HISTORY_FILE, + MSG_SRAM_WILL_NOT_BE_SAVED, + MSG_RECEIVED, + MSG_LOADING_CONTENT_FILE, + MSG_USING_LIBRETRO_DUMMY_CORE_RECORDING_SKIPPED, + MSG_RECORDING_TERMINATED_DUE_TO_RESIZE, + MSG_FAILED_TO_START_RECORDING, + MSG_REWIND_INIT, + MSG_REWIND_INIT_FAILED, + MSG_REWIND_INIT_FAILED_THREADED_AUDIO, + MSG_REWIND_INIT_FAILED_NO_SAVESTATES, + MSG_LIBRETRO_ABI_BREAK, + MSG_NETPLAY_FAILED, + MSG_NETPLAY_FAILED_MOVIE_PLAYBACK_HAS_STARTED, + MSG_DETECTED_VIEWPORT_OF, + MSG_RECORDING_TO, + MSG_HW_RENDERED_MUST_USE_POSTSHADED_RECORDING, + MSG_VIEWPORT_SIZE_CALCULATION_FAILED, + MSG_AUTOSAVE_FAILED, + MSG_MOVIE_RECORD_STOPPED, + MSG_MOVIE_PLAYBACK_ENDED, + MSG_TAKING_SCREENSHOT, + MSG_FAILED_TO_TAKE_SCREENSHOT, + MSG_CUSTOM_TIMING_GIVEN, + MSG_SAVING_STATE, + MSG_LOADING_STATE, + MSG_FAILED_TO_SAVE_STATE_TO, + MSG_FAILED_TO_SAVE_SRAM, + MSG_STATE_SIZE, + MSG_FAILED_TO_LOAD_CONTENT, + MSG_COULD_NOT_READ_CONTENT_FILE, + MSG_SAVED_SUCCESSFULLY_TO, + MSG_BYTES, + MSG_BLOCKING_SRAM_OVERWRITE, + MSG_UNRECOGNIZED_COMMAND, + MSG_SENDING_COMMAND, + MSG_RESTARTING_RECORDING_DUE_TO_DRIVER_REINIT, + MSG_REWINDING, + MSG_SLOW_MOTION_REWIND, + MSG_SLOW_MOTION, + MSG_REWIND_REACHED_END, + MSG_FAILED_TO_START_MOVIE_RECORD, + MSG_CHEEVOS_HARDCORE_MODE_ENABLE, + MSG_STATE_SLOT, + MSG_STARTING_MOVIE_RECORD_TO, + MSG_FAILED_TO_APPLY_SHADER, + MSG_APPLYING_SHADER, + MSG_SHADER, + MSG_REDIRECTING_SAVESTATE_TO, + MSG_REDIRECTING_SAVEFILE_TO, + MSG_REDIRECTING_CHEATFILE_TO, + MSG_SCANNING, + MSG_SCANNING_OF_DIRECTORY_FINISHED, + MSG_COULD_NOT_PROCESS_ZIP_FILE, + MSG_LOADED_STATE_FROM_SLOT, + MSG_REMOVING_TEMPORARY_CONTENT_FILE, + MSG_FAILED_TO_REMOVE_TEMPORARY_FILE, + MSG_STARTING_MOVIE_PLAYBACK, + MSG_APPENDED_DISK, + MSG_SKIPPING_SRAM_LOAD, + MSG_CONFIG_DIRECTORY_NOT_SET, + MSG_SAVED_STATE_TO_SLOT, + MSG_CORE_DOES_NOT_SUPPORT_SAVESTATES, + MSG_FAILED_TO_LOAD_STATE, + MSG_FAILED_TO_LOAD_UNDO, + MSG_FAILED_TO_SAVE_UNDO, + MSG_RESET, + MSG_AUDIO_MUTED, + MSG_AUDIO_UNMUTED, + MSG_FAILED_TO_UNMUTE_AUDIO, + MSG_FAILED_TO_LOAD_OVERLAY, + MSG_PAUSED, + MSG_UNPAUSED, + MSG_CORE_DOES_NOT_SUPPORT_DISK_OPTIONS, + MSG_GRAB_MOUSE_STATE, + MSG_FAILED_TO_LOAD_MOVIE_FILE, + MSG_FAILED_TO, + MSG_SAVING_RAM_TYPE, + MSG_TO, + MSG_VIRTUAL_DISK_TRAY, + MSG_REMOVED_DISK_FROM_TRAY, + MSG_FAILED_TO_REMOVE_DISK_FROM_TRAY, + MSG_GOT_INVALID_DISK_INDEX, + MSG_TASK_FAILED, + MSG_DOWNLOADING, + MSG_EXTRACTING +}; RETRO_BEGIN_DECLS -const char *msg_hash_to_str(uint32_t hash); +const char *msg_hash_to_str(enum msg_hash_enums msg); -const char *msg_hash_to_str_fr(uint32_t hash); +const char *msg_hash_to_str_fr(enum msg_hash_enums msg); #ifdef HAVE_UTF8 -const char *msg_hash_to_str_ru(uint32_t hash); +const char *msg_hash_to_str_ru(enum msg_hash_enums msg); #endif -const char *msg_hash_to_str_de(uint32_t hash); +const char *msg_hash_to_str_de(enum msg_hash_enums msg); -const char *msg_hash_to_str_es(uint32_t hash); +const char *msg_hash_to_str_es(enum msg_hash_enums msg); -const char *msg_hash_to_str_eo(uint32_t hash); +const char *msg_hash_to_str_eo(enum msg_hash_enums msg); -const char *msg_hash_to_str_it(uint32_t hash); +const char *msg_hash_to_str_it(enum msg_hash_enums msg); -const char *msg_hash_to_str_pt(uint32_t hash); +const char *msg_hash_to_str_pt(enum msg_hash_enums msg); -const char *msg_hash_to_str_pl(uint32_t hash); +const char *msg_hash_to_str_pl(enum msg_hash_enums msg); -const char *msg_hash_to_str_nl(uint32_t hash); +const char *msg_hash_to_str_nl(enum msg_hash_enums msg); -const char *msg_hash_to_str_us(uint32_t hash); +const char *msg_hash_to_str_us(enum msg_hash_enums msg); uint32_t msg_hash_calculate(const char *s);