Avoid more aggressive gcc-11 warning about accessing undersized arrays.
authorSebastian Rasmussen <[email protected]>
Fri, 9 Jul 2021 11:07:09 +0000 (13:07 +0200)
committerSebastian Rasmussen <[email protected]>
Fri, 9 Jul 2021 23:58:33 +0000 (01:58 +0200)
Starting from gcc-11 -Wstringop-overflow now produces the warnings
this commit fixes.

source/fitz/color-icc-create.c
source/fitz/color-imp.h
source/pdf/pdf-appearance.c

index d10ab10d89970d3216e50e1ace71f163e5decc9b..5c200fa2a849ec1072c753765e60483b4540f9ec 100644 (file)
@@ -317,7 +317,7 @@ fz_buffer *
 fz_new_icc_data_from_cal(fz_context *ctx,
        float wp[3],
        float bp[3],
-       float gamma[3],
+       float *gamma,
        float matrix[9],
        int n)
 {
index 13fab7a008dda92ccf1f5663f2b93cf75d33dca7..79c0fdecc8dabdfeba6a0c651a9e9ce94954c581 100644 (file)
@@ -12,7 +12,7 @@ typedef struct fz_color_converter fz_color_converter;
 /*
        Create ICC profile from PDF calGray and calRGB definitions
 */
-fz_buffer *fz_new_icc_data_from_cal(fz_context *ctx, float wp[3], float bp[3], float gamma[3], float matrix[9], int n);
+fz_buffer *fz_new_icc_data_from_cal(fz_context *ctx, float wp[3], float bp[3], float *gamma, float matrix[9], int n);
 
 /*
        Opaque type for a link (transform) generated between ICC
index 1c716edf092dd52c14ec8fd4b70a9a589a6cd663..52f128da61d5f4291d9c87b4f6aea5aee6b1181e 100644 (file)
@@ -1480,7 +1480,7 @@ static const char *full_font_name(const char **name)
 static void
 write_variable_text(fz_context *ctx, pdf_annot *annot, fz_buffer *buf, pdf_obj **res,
        fz_text_language lang, const char *text,
-       const char *fontname, float size, int n, float color[4], int q,
+       const char *fontname, float size, int n, float *color, int q,
        float w, float h, float padding, float baseline, float lineheight,
        int multiline, int comb, int adjust_baseline)
 {
@@ -2006,7 +2006,7 @@ pdf_write_appearance(fz_context *ctx, pdf_annot *annot, fz_buffer *buf,
 }
 
 static pdf_obj *draw_push_button(fz_context *ctx, pdf_annot *annot, fz_rect bbox, fz_matrix matrix, float w, float h,
-       const char *caption, const char *font, float size, int n, float color[4],
+       const char *caption, const char *font, float size, int n, float *color,
        int down)
 {
        pdf_obj *ap, *res = NULL;