Explorar el Código

Fixes for gcc12

Thanks @Willy-JL !
for fixing 13 apps in this commit,
other apps fixed by me
MX hace 1 año
padre
commit
d56740dde4
Se han modificado 2 ficheros con 5 adiciones y 5 borrados
  1. 3 3
      helpers/flipchess_file.c
  2. 2 2
      sam/stm32_sam.cpp

+ 3 - 3
helpers/flipchess_file.c

@@ -16,10 +16,10 @@
 bool flipchess_has_file(const FlipChessFile file_type, const char* file_name, const bool remove) {
     bool ret = false;
     const char* path;
+    char path_buf[FILE_MAX_PATH_LEN] = {0};
     if(file_type == FlipChessFileBoard) {
         path = FLIPCHESS_BOARD_PATH;
     } else {
-        char path_buf[FILE_MAX_PATH_LEN] = {0};
         strcpy(path_buf, FLIPCHESS_APP_BASE_FOLDER); // 22
         strcpy(path_buf + strlen(path_buf), "/");
         strcpy(path_buf + strlen(path_buf), file_name);
@@ -40,10 +40,10 @@ bool flipchess_has_file(const FlipChessFile file_type, const char* file_name, co
 bool flipchess_load_file(char* contents, const FlipChessFile file_type, const char* file_name) {
     bool ret = false;
     const char* path;
+    char path_buf[FILE_MAX_PATH_LEN] = {0};
     if(file_type == FlipChessFileBoard) {
         path = FLIPCHESS_BOARD_PATH;
     } else {
-        char path_buf[FILE_MAX_PATH_LEN] = {0};
         strcpy(path_buf, FLIPCHESS_APP_BASE_FOLDER); // 22
         strcpy(path_buf + strlen(path_buf), "/");
         strcpy(path_buf + strlen(path_buf), file_name);
@@ -99,11 +99,11 @@ bool flipchess_save_file(
     bool ret = false;
     const char* path;
     const char* path_bak;
+    char path_buf[FILE_MAX_PATH_LEN] = {0};
     if(file_type == FlipChessFileBoard) {
         path = FLIPCHESS_BOARD_PATH;
         path_bak = FLIPCHESS_BOARD_PATH_BAK;
     } else {
-        char path_buf[FILE_MAX_PATH_LEN] = {0};
         strcpy(path_buf, FLIPCHESS_APP_BASE_FOLDER); // 22
         strcpy(path_buf + strlen(path_buf), "/");
         strcpy(path_buf + strlen(path_buf), file_name);

+ 2 - 2
sam/stm32_sam.cpp

@@ -4510,7 +4510,7 @@ void STM32SAM::AdjustLengths() {
                 mem56 = flags[index];
 
             // not a consonant
-            if((flags[index] & 64) == 0) {
+            if((mem56 & 64) == 0) {
                 // RX or LX?
                 if((index == 18) || (index == 19)) // 'RX' & 'LX'
                 {
@@ -4519,7 +4519,7 @@ void STM32SAM::AdjustLengths() {
                     index = phonemeindex[X];
 
                     // next phoneme a consonant?
-                    if((flags[index] & 64) != 0) {
+                    if((mem56 & 64) != 0) {
                         // RULE: <VOWEL> RX | LX <CONSONANT>
 
                         // decrease length of vowel by 1 frame