Avoid new gcc-11 warning about mismatched array bounds.
authorSebastian Rasmussen <[email protected]>
Fri, 9 Jul 2021 14:46:34 +0000 (16:46 +0200)
committerSebastian Rasmussen <[email protected]>
Fri, 9 Jul 2021 23:58:33 +0000 (01:58 +0200)
gcc-11 introduced -Warray-parameter that produces the warnings
this commit fixes.

platform/gl/gl-app.h
platform/gl/gl-file.c
source/fitz/string.c

index ec132826ab5aa3cc8052d3f945d0a0ac38253e4a..26c17ff60931c0b5d95afdce7cda4b1f55be6769 100644 (file)
@@ -213,9 +213,9 @@ int ui_popup_item_aux(const char *title, int flags);
 void ui_popup_end(void);
 
 void ui_init_open_file(const char *dir, int (*filter)(const char *fn));
-int ui_open_file(char filename[], const char *label);
+int ui_open_file(char *filename, const char *label);
 void ui_init_save_file(const char *path, int (*filter)(const char *fn));
-int ui_save_file(char filename[], void (*extra_panel)(void), const char *label);
+int ui_save_file(char *filename, void (*extra_panel)(void), const char *label);
 
 void ui_show_warning_dialog(const char *fmt, ...);
 void ui_show_error_dialog(const char *fmt, ...);
index 5b82577a7782e8e2d9b57ace7238ac3ab4f4f5f1..cca3da8215996a0fd67f23eabe679564bef1000a 100644 (file)
@@ -302,7 +302,7 @@ void ui_init_open_file(const char *dir, int (*filter)(const char *fn))
        load_dir(dir);
 }
 
-int ui_open_file(char filename[PATH_MAX], const char *label)
+int ui_open_file(char *filename, const char *label)
 {
        static int last_click_time = 0;
        static int last_click_sel = -1;
@@ -456,7 +456,7 @@ static int ui_save_file_confirm(char *filename)
        return rv;
 }
 
-int ui_save_file(char filename[PATH_MAX], void (*extra_panel)(void), const char *label)
+int ui_save_file(char *filename, void (*extra_panel)(void), const char *label)
 {
        int i, rv = 0;
 
index 2918c3f16d766a75d02c48a010615878c563fe59..3388e713e93b87b410324ae62e3401cf05aab937 100644 (file)
@@ -137,7 +137,7 @@ fz_dirname(char *dir, const char *path, size_t n)
 
 #ifdef _WIN32
 
-char *fz_realpath(const char *path, char buf[PATH_MAX])
+char *fz_realpath(const char *path, char *buf)
 {
        wchar_t wpath[PATH_MAX];
        wchar_t wbuf[PATH_MAX];
@@ -156,7 +156,7 @@ char *fz_realpath(const char *path, char buf[PATH_MAX])
 
 #else
 
-char *fz_realpath(const char *path, char buf[PATH_MAX])
+char *fz_realpath(const char *path, char *buf)
 {
        return realpath(path, buf);
 }