fusee/sept: update for gcc10

This commit is contained in:
Michael Scire 2020-05-07 18:49:46 -07:00
parent 232203f4c0
commit c72614f768
8 changed files with 50 additions and 24 deletions

View file

@ -23,6 +23,9 @@ FATFS sd_fs;
static bool g_sd_mounted = false; static bool g_sd_mounted = false;
static bool g_sd_initialized = false; static bool g_sd_initialized = false;
static bool g_ahb_redirect_enabled = false; static bool g_ahb_redirect_enabled = false;
sdmmc_t g_sd_sdmmc;
sdmmc_device_t g_sd_device;
bool mount_sd(void) bool mount_sd(void)
{ {

View file

@ -23,8 +23,8 @@
#include "sdmmc/sdmmc.h" #include "sdmmc/sdmmc.h"
#include "utils.h" #include "utils.h"
sdmmc_t g_sd_sdmmc; extern sdmmc_t g_sd_sdmmc;
sdmmc_device_t g_sd_device; extern sdmmc_device_t g_sd_device;
bool mount_sd(void); bool mount_sd(void);
void unmount_sd(void); void unmount_sd(void);

View file

@ -70,7 +70,10 @@ static char* find_chars_or_comment(const char* s, const char* chars)
/* Version of strncpy that ensures dest (size bytes) is null-terminated. */ /* Version of strncpy that ensures dest (size bytes) is null-terminated. */
static char* strncpy0(char* dest, const char* src, size_t size) static char* strncpy0(char* dest, const char* src, size_t size)
{ {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(dest, src, size - 1); strncpy(dest, src, size - 1);
#pragma GCC diagnostic pop
dest[size - 1] = '\0'; dest[size - 1] = '\0';
return dest; return dest;
} }

View file

@ -70,7 +70,10 @@ static char* find_chars_or_comment(const char* s, const char* chars)
/* Version of strncpy that ensures dest (size bytes) is null-terminated. */ /* Version of strncpy that ensures dest (size bytes) is null-terminated. */
static char* strncpy0(char* dest, const char* src, size_t size) static char* strncpy0(char* dest, const char* src, size_t size)
{ {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(dest, src, size - 1); strncpy(dest, src, size - 1);
#pragma GCC diagnostic pop
dest[size - 1] = '\0'; dest[size - 1] = '\0';
return dest; return dest;
} }

View file

@ -119,10 +119,16 @@ static int emummc_ini_handler(void *user, const char *section, const char *name,
} else if (strcmp(name, EMUMMC_ID_KEY) == 0) { } else if (strcmp(name, EMUMMC_ID_KEY) == 0) {
sscanf(value, "%lx", &emummc_cfg->id); sscanf(value, "%lx", &emummc_cfg->id);
} else if (strcmp(name, EMUMMC_PATH_KEY) == 0) { } else if (strcmp(name, EMUMMC_PATH_KEY) == 0) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(emummc_cfg->path, value, sizeof(emummc_cfg->path) - 1); strncpy(emummc_cfg->path, value, sizeof(emummc_cfg->path) - 1);
#pragma GCC diagnostic pop
emummc_cfg->path[sizeof(emummc_cfg->path) - 1] = '\0'; emummc_cfg->path[sizeof(emummc_cfg->path) - 1] = '\0';
} else if (strcmp(name, EMUMMC_NINTENDO_PATH_KEY) == 0) { } else if (strcmp(name, EMUMMC_NINTENDO_PATH_KEY) == 0) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(emummc_cfg->nintendo_path, value, sizeof(emummc_cfg->nintendo_path) - 1); strncpy(emummc_cfg->nintendo_path, value, sizeof(emummc_cfg->nintendo_path) - 1);
#pragma GCC diagnostic pop
emummc_cfg->nintendo_path[sizeof(emummc_cfg->nintendo_path) - 1] = '\0'; emummc_cfg->nintendo_path[sizeof(emummc_cfg->nintendo_path) - 1] = '\0';
} else { } else {
return 0; return 0;
@ -356,7 +362,10 @@ static bool nxboot_configure_emummc(exo_emummc_config_t *exo_emummc_config) {
/* Initialize values from emummc config. */ /* Initialize values from emummc config. */
exo_emummc_config->base_cfg.id = emummc_cfg.id; exo_emummc_config->base_cfg.id = emummc_cfg.id;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(exo_emummc_config->emu_dir_path, emummc_cfg.nintendo_path, sizeof(exo_emummc_config->emu_dir_path)); strncpy(exo_emummc_config->emu_dir_path, emummc_cfg.nintendo_path, sizeof(exo_emummc_config->emu_dir_path));
#pragma GCC diagnostic pop
exo_emummc_config->emu_dir_path[sizeof(exo_emummc_config->emu_dir_path) - 1] = '\0'; exo_emummc_config->emu_dir_path[sizeof(exo_emummc_config->emu_dir_path) - 1] = '\0';
if (emummc_cfg.enabled) { if (emummc_cfg.enabled) {
@ -370,7 +379,10 @@ static bool nxboot_configure_emummc(exo_emummc_config_t *exo_emummc_config) {
} }
} else if (is_valid_folder(emummc_cfg.path)) { } else if (is_valid_folder(emummc_cfg.path)) {
exo_emummc_config->base_cfg.type = EMUMMC_TYPE_FILES; exo_emummc_config->base_cfg.type = EMUMMC_TYPE_FILES;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(exo_emummc_config->file_cfg.path, emummc_cfg.path, sizeof(exo_emummc_config->file_cfg.path)); strncpy(exo_emummc_config->file_cfg.path, emummc_cfg.path, sizeof(exo_emummc_config->file_cfg.path));
#pragma GCC diagnostic pop
exo_emummc_config->file_cfg.path[sizeof(exo_emummc_config->file_cfg.path) - 1] = '\0'; exo_emummc_config->file_cfg.path[sizeof(exo_emummc_config->file_cfg.path) - 1] = '\0';
int num_parts = 0; int num_parts = 0;

View file

@ -23,6 +23,8 @@ FATFS sd_fs;
static bool g_sd_mounted = false; static bool g_sd_mounted = false;
static bool g_sd_initialized = false; static bool g_sd_initialized = false;
static bool g_ahb_redirect_enabled = false; static bool g_ahb_redirect_enabled = false;
sdmmc_t g_sd_sdmmc;
sdmmc_device_t g_sd_device;
bool mount_sd(void) bool mount_sd(void)
{ {

View file

@ -23,8 +23,8 @@
#include "sdmmc/sdmmc.h" #include "sdmmc/sdmmc.h"
#include "utils.h" #include "utils.h"
sdmmc_t g_sd_sdmmc; extern sdmmc_t g_sd_sdmmc;
sdmmc_device_t g_sd_device; extern sdmmc_device_t g_sd_device;
bool mount_sd(void); bool mount_sd(void);
void unmount_sd(void); void unmount_sd(void);

View file

@ -70,7 +70,10 @@ static char* find_chars_or_comment(const char* s, const char* chars)
/* Version of strncpy that ensures dest (size bytes) is null-terminated. */ /* Version of strncpy that ensures dest (size bytes) is null-terminated. */
static char* strncpy0(char* dest, const char* src, size_t size) static char* strncpy0(char* dest, const char* src, size_t size)
{ {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy(dest, src, size - 1); strncpy(dest, src, size - 1);
#pragma GCC diagnostic pop
dest[size - 1] = '\0'; dest[size - 1] = '\0';
return dest; return dest;
} }