From e68b876e8317ae8a070b26f271859eac592a4fcc Mon Sep 17 00:00:00 2001 From: sonia habtiche Date: Tue, 8 Mar 2022 22:03:06 +0000 Subject: [PATCH 1/8] Initialize variables that are not initialized to silence warnings. --- plug-ins/file-psd/psd-load.c | 54 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c index a72fe688cef..a73c89a009c 100644 --- a/plug-ins/file-psd/psd-load.c +++ b/plug-ins/file-psd/psd-load.c @@ -435,7 +435,7 @@ read_color_mode_block (PSDimage *img_a, GError **error) { static guchar cmap[] = { 0, 0, 0, 255, 255, 255 }; - guint32 block_len; + guint32 block_len = 0; img_a->color_map_entries = 0; img_a->color_map_len = 0; @@ -522,8 +522,8 @@ read_image_resource_block (PSDimage *img_a, GInputStream *input, GError **error) { - guint64 block_len; - guint64 block_end; + guint64 block_len = 0; + guint64 block_end = 0; if (psd_read (input, &block_len, 4, error) < 4) { @@ -563,12 +563,12 @@ read_layer_info (PSDimage *img_a, GError **error) { PSDlayer **lyr_a = NULL; - guint64 block_len; - guint64 block_rem; - gint32 read_len; - gint32 write_len; - gint lidx; /* Layer index */ - gint cidx; /* Channel index */ + guint64 block_len = 0; + guint64 block_rem = 0; + gint32 read_len = 0; + gint32 write_len = 0; + gint lidx = 0; /* Layer index */ + gint cidx = 0; /* Channel index */ IFDBG(1) g_debug ("Reading layer info at offset %" G_GOFFSET_FORMAT, PSD_TELL(input)); @@ -1070,8 +1070,8 @@ read_layer_block (PSDimage *img_a, GError **error) { PSDlayer **lyr_a = NULL; - guint64 block_len; - guint64 block_end; + guint64 block_len = 0; + guint64 block_end = 0; gint block_len_size = (img_a->version == 1 ? 4 : 8); if (! psd_read_len (input, &block_len, img_a->version, error)) @@ -1566,8 +1566,8 @@ read_RLE_channel (PSDimage *img_a, { gint rle_count_size = (img_a->version == 1 ? 2 : 4); gint rle_row_size = lyr_chn->rows * rle_count_size; - guint32 *rle_pack_len; - gint rowi; + guint32 *rle_pack_len = 0; + gint rowi = 0; IFDBG(4) g_debug ("RLE channel length %" G_GSIZE_FORMAT ", RLE length data: %d, " @@ -2309,21 +2309,21 @@ add_merged_image (GimpImage *image, PSDchannel chn_a[MAX_CHANNELS]; gchar *alpha_name; guchar *pixels; - guint16 comp_mode; - guint16 base_channels; - guint16 extra_channels; - guint16 total_channels; - guint16 bps; + guint16 comp_mode = 0; + guint16 base_channels = 0; + guint16 extra_channels = 0; + guint16 total_channels = 0; + guint16 bps = 0; guint32 *rle_pack_len[MAX_CHANNELS]; - guint32 alpha_id; - gint32 layer_size; + guint32 alpha_id = 0; + gint32 layer_size = 0; GimpLayer *layer = NULL; GimpChannel *channel = NULL; - gint16 alpha_opacity; - gint cidx; /* Channel index */ - gint rowi; /* Row index */ - gint offset; - gint i; + gint16 alpha_opacity = 0; + gint cidx = 0; /* Channel index */ + gint rowi = 0; /* Row index */ + gint offset = 0; + gint i = 0; gboolean alpha_visible; gboolean alpha_channel = FALSE; gboolean original_mode_CMYK = FALSE; @@ -2398,8 +2398,8 @@ add_merged_image (GimpImage *image, img_a->num_layers == 0 || extra_channels > 0) { - guint32 block_len; - guint32 block_start; + guint32 block_len = 0; + guint32 block_start = 0; block_start = img_a->merged_image_start; block_len = img_a->merged_image_len; -- GitLab From 43f4c537184f5f1cf66fbfa1a118946fe85bd197 Mon Sep 17 00:00:00 2001 From: sonia habtiche Date: Thu, 10 Mar 2022 10:02:39 +0000 Subject: [PATCH 2/8] sign alignment = --- plug-ins/file-psd/psd-load.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c index a73c89a009c..39eaba7ab42 100644 --- a/plug-ins/file-psd/psd-load.c +++ b/plug-ins/file-psd/psd-load.c @@ -435,7 +435,7 @@ read_color_mode_block (PSDimage *img_a, GError **error) { static guchar cmap[] = { 0, 0, 0, 255, 255, 255 }; - guint32 block_len = 0; + guint32 block_len = 0; img_a->color_map_entries = 0; img_a->color_map_len = 0; @@ -565,10 +565,10 @@ read_layer_info (PSDimage *img_a, PSDlayer **lyr_a = NULL; guint64 block_len = 0; guint64 block_rem = 0; - gint32 read_len = 0; + gint32 read_len = 0; gint32 write_len = 0; - gint lidx = 0; /* Layer index */ - gint cidx = 0; /* Channel index */ + gint lidx = 0; /* Layer index */ + gint cidx = 0; /* Channel index */ IFDBG(1) g_debug ("Reading layer info at offset %" G_GOFFSET_FORMAT, PSD_TELL(input)); @@ -1567,7 +1567,7 @@ read_RLE_channel (PSDimage *img_a, gint rle_count_size = (img_a->version == 1 ? 2 : 4); gint rle_row_size = lyr_chn->rows * rle_count_size; guint32 *rle_pack_len = 0; - gint rowi = 0; + gint rowi = 0; IFDBG(4) g_debug ("RLE channel length %" G_GSIZE_FORMAT ", RLE length data: %d, " @@ -2309,21 +2309,21 @@ add_merged_image (GimpImage *image, PSDchannel chn_a[MAX_CHANNELS]; gchar *alpha_name; guchar *pixels; - guint16 comp_mode = 0; - guint16 base_channels = 0; + guint16 comp_mode = 0; + guint16 base_channels = 0; guint16 extra_channels = 0; guint16 total_channels = 0; - guint16 bps = 0; + guint16 bps = 0; guint32 *rle_pack_len[MAX_CHANNELS]; - guint32 alpha_id = 0; + guint32 alpha_id = 0; gint32 layer_size = 0; GimpLayer *layer = NULL; GimpChannel *channel = NULL; gint16 alpha_opacity = 0; - gint cidx = 0; /* Channel index */ - gint rowi = 0; /* Row index */ - gint offset = 0; - gint i = 0; + gint cidx = 0; /* Channel index */ + gint rowi = 0; /* Row index */ + gint offset = 0; + gint i = 0; gboolean alpha_visible; gboolean alpha_channel = FALSE; gboolean original_mode_CMYK = FALSE; @@ -2398,7 +2398,7 @@ add_merged_image (GimpImage *image, img_a->num_layers == 0 || extra_channels > 0) { - guint32 block_len = 0; + guint32 block_len = 0; guint32 block_start = 0; block_start = img_a->merged_image_start; -- GitLab From bfbdefe5a66dfad38793b73a8b0d1795e84f228a Mon Sep 17 00:00:00 2001 From: sonia habtiche Date: Tue, 15 Mar 2022 08:37:36 +0000 Subject: [PATCH 3/8] alignment fixes --- plug-ins/file-psd/psd-load.c | 50 ++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c index 39eaba7ab42..a768b75eb1b 100644 --- a/plug-ins/file-psd/psd-load.c +++ b/plug-ins/file-psd/psd-load.c @@ -523,7 +523,7 @@ read_image_resource_block (PSDimage *img_a, GError **error) { guint64 block_len = 0; - guint64 block_end = 0; + guint64 block_end; if (psd_read (input, &block_len, 4, error) < 4) { @@ -563,12 +563,12 @@ read_layer_info (PSDimage *img_a, GError **error) { PSDlayer **lyr_a = NULL; - guint64 block_len = 0; - guint64 block_rem = 0; - gint32 read_len = 0; - gint32 write_len = 0; - gint lidx = 0; /* Layer index */ - gint cidx = 0; /* Channel index */ + guint64 block_len; + guint64 block_rem; + gint32 read_len; + gint32 write_len; + gint lidx; /* Layer index */ + gint cidx; /* Channel index */ IFDBG(1) g_debug ("Reading layer info at offset %" G_GOFFSET_FORMAT, PSD_TELL(input)); @@ -1070,8 +1070,8 @@ read_layer_block (PSDimage *img_a, GError **error) { PSDlayer **lyr_a = NULL; - guint64 block_len = 0; - guint64 block_end = 0; + guint64 block_len; + guint64 block_end; gint block_len_size = (img_a->version == 1 ? 4 : 8); if (! psd_read_len (input, &block_len, img_a->version, error)) @@ -1566,8 +1566,8 @@ read_RLE_channel (PSDimage *img_a, { gint rle_count_size = (img_a->version == 1 ? 2 : 4); gint rle_row_size = lyr_chn->rows * rle_count_size; - guint32 *rle_pack_len = 0; - gint rowi = 0; + guint32 *rle_pack_len; + gint rowi; IFDBG(4) g_debug ("RLE channel length %" G_GSIZE_FORMAT ", RLE length data: %d, " @@ -2309,21 +2309,21 @@ add_merged_image (GimpImage *image, PSDchannel chn_a[MAX_CHANNELS]; gchar *alpha_name; guchar *pixels; - guint16 comp_mode = 0; - guint16 base_channels = 0; - guint16 extra_channels = 0; - guint16 total_channels = 0; - guint16 bps = 0; + guint16 comp_mode = 0; + guint16 base_channels; + guint16 extra_channels; + guint16 total_channels; + guint16 bps; guint32 *rle_pack_len[MAX_CHANNELS]; - guint32 alpha_id = 0; - gint32 layer_size = 0; + guint32 alpha_id; + gint32 layer_size; GimpLayer *layer = NULL; GimpChannel *channel = NULL; - gint16 alpha_opacity = 0; - gint cidx = 0; /* Channel index */ - gint rowi = 0; /* Row index */ - gint offset = 0; - gint i = 0; + gint16 alpha_opacity; + gint cidx; /* Channel index */ + gint rowi; /* Row index */ + gint offset; + gint i; gboolean alpha_visible; gboolean alpha_channel = FALSE; gboolean original_mode_CMYK = FALSE; @@ -2398,8 +2398,8 @@ add_merged_image (GimpImage *image, img_a->num_layers == 0 || extra_channels > 0) { - guint32 block_len = 0; - guint32 block_start = 0; + guint32 block_len; + guint32 block_start; block_start = img_a->merged_image_start; block_len = img_a->merged_image_len; -- GitLab From 5d452516c1e31052b1d768987e51e3306de760ba Mon Sep 17 00:00:00 2001 From: sonia habtiche Date: Sat, 19 Mar 2022 16:08:51 +0000 Subject: [PATCH 4/8] alignment fixes --- plug-ins/file-psd/psd-load.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c index a768b75eb1b..a496a98a547 100644 --- a/plug-ins/file-psd/psd-load.c +++ b/plug-ins/file-psd/psd-load.c @@ -434,11 +434,11 @@ read_color_mode_block (PSDimage *img_a, GInputStream *input, GError **error) { - static guchar cmap[] = { 0, 0, 0, 255, 255, 255 }; - guint32 block_len = 0; + static guchar cmap[] = { 0, 0, 0, 255, 255, 255 }; + guint32 block_len = 0; img_a->color_map_entries = 0; - img_a->color_map_len = 0; + img_a->color_map_len = 0; if (psd_read (input, &block_len, 4, error) < 4) { psd_set_error (error); -- GitLab From 353149923ea1be01c7eb466b7fb000fd6682d157 Mon Sep 17 00:00:00 2001 From: sonia habtiche Date: Tue, 22 Mar 2022 20:37:25 +0000 Subject: [PATCH 5/8] Update psd-load.c --- plug-ins/file-psd/psd-load.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c index a496a98a547..4e0b7bd9ef5 100644 --- a/plug-ins/file-psd/psd-load.c +++ b/plug-ins/file-psd/psd-load.c @@ -434,11 +434,11 @@ read_color_mode_block (PSDimage *img_a, GInputStream *input, GError **error) { - static guchar cmap[] = { 0, 0, 0, 255, 255, 255 }; - guint32 block_len = 0; + static guchar cmap[] = { 0, 0, 0, 255, 255, 255 }; + guint32 block_len = 0; img_a->color_map_entries = 0; - img_a->color_map_len = 0; + img_a->color_map_len = 0; if (psd_read (input, &block_len, 4, error) < 4) { psd_set_error (error); -- GitLab From 6981803bc50480041fe0754cdf75e348027d8b89 Mon Sep 17 00:00:00 2001 From: sonia habtiche Date: Wed, 23 Mar 2022 22:19:25 +0000 Subject: [PATCH 6/8] fixed the last alignment --- plug-ins/file-psd/psd-load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c index 4e0b7bd9ef5..985217195c0 100644 --- a/plug-ins/file-psd/psd-load.c +++ b/plug-ins/file-psd/psd-load.c @@ -434,7 +434,7 @@ read_color_mode_block (PSDimage *img_a, GInputStream *input, GError **error) { - static guchar cmap[] = { 0, 0, 0, 255, 255, 255 }; + static guchar cmap[] = { 0, 0, 0, 255, 255, 255 }; guint32 block_len = 0; img_a->color_map_entries = 0; -- GitLab From 3265146b148b340b12c24190de36f802813b2262 Mon Sep 17 00:00:00 2001 From: sonia Date: Mon, 28 Mar 2022 23:05:47 +0200 Subject: [PATCH 7/8] fix initialized variables. --- plug-ins/file-psd/psd-image-res-load.c | 8 +++---- plug-ins/file-psd/psd-layer-res-load.c | 30 +++++++++++++------------- plug-ins/file-psd/psd-thumb-load.c | 6 +++--- plug-ins/file-tiff/file-tiff-load.c | 8 +++---- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/plug-ins/file-psd/psd-image-res-load.c b/plug-ins/file-psd/psd-image-res-load.c index 86a1f0f6602..05462671ce3 100644 --- a/plug-ins/file-psd/psd-image-res-load.c +++ b/plug-ins/file-psd/psd-image-res-load.c @@ -797,7 +797,7 @@ load_resource_1022 (const PSDimageres *res_a, GError **error) { /* Load quick mask info */ - gboolean quick_mask_empty; /* Quick mask initially empty */ + gboolean quick_mask_empty = 0; /* Quick mask initially empty */ IFDBG(2) g_debug ("Process image resource block: 1022: Quick Mask"); @@ -1337,7 +1337,7 @@ load_resource_1069 (const PSDimageres *res_a, GInputStream *input, GError **error) { - guint16 layer_count; + guint16 layer_count = 0; gint i; IFDBG(2) g_debug ("Process image resource block: 1069: Layer Selection ID(s)"); @@ -1357,7 +1357,7 @@ load_resource_1069 (const PSDimageres *res_a, for (i = 0; i < layer_count; i++) { - guint32 layer_id; + guint32 layer_id = 0; if (psd_read (input, &layer_id, 4, error) < 4) { @@ -1494,7 +1494,7 @@ load_resource_2000 (const PSDimageres *res_a, gint32 x[3]; gint32 y[3]; GimpVectors *vectors = NULL; - gint16 type; + gint16 type = 0; gint16 init_fill; gint16 num_rec; gint16 path_rec; diff --git a/plug-ins/file-psd/psd-layer-res-load.c b/plug-ins/file-psd/psd-layer-res-load.c index 3e36c2733f0..d7eaf08b313 100644 --- a/plug-ins/file-psd/psd-layer-res-load.c +++ b/plug-ins/file-psd/psd-layer-res-load.c @@ -438,17 +438,17 @@ load_resource_ltyp (const PSDlayerres *res_a, GError **error) { /* Load type tool layer */ - gint16 version; - gint16 text_desc_vers; - gint32 desc_version; + gint16 version = 0; + gint16 text_desc_vers = 0; + gint32 desc_version = 0; gint32 read_len; gint32 write_len; - guint64 t_xx; - guint64 t_xy; - guint64 t_yx; - guint64 t_yy; - guint64 t_tx; - guint64 t_ty; + guint64 t_xx = 0; + guint64 t_xy = 0; + guint64 t_yx = 0; + guint64 t_yy = 0; + guint64 t_tx = 0; + guint64 t_ty = 0; gchar *classID; static gboolean msg_flag = FALSE; @@ -589,7 +589,7 @@ load_resource_lsct (const PSDlayerres *res_a, * Type 1: Open folder * Type 2: Closed folder * Type 3: End of most recent group */ - guint32 type; + guint32 type = 0; IFDBG(2) g_debug ("Process layer resource block %.4s: Section divider", res_a->key); if (psd_read (input, &type, 4, error) < 4) @@ -637,7 +637,7 @@ load_resource_lrfx (const PSDlayerres *res_a, GError **error) { gint16 version; - gint16 count; + gint16 count = 0; gchar signature[4]; gchar effectname[4]; gint i; @@ -729,7 +729,7 @@ load_resource_lrfx (const PSDlayerres *res_a, } else if (memcmp (effectname, "oglw", 4) == 0) { - gint32 size; + gint32 size = 0; gint32 ver; gint32 blur; gint32 intensity; @@ -773,7 +773,7 @@ load_resource_lrfx (const PSDlayerres *res_a, } else if (memcmp (effectname, "iglw", 4) == 0) { - gint32 size; + gint32 size = 0; gint32 ver; gint32 blur; gint32 intensity; @@ -831,7 +831,7 @@ load_resource_lrfx (const PSDlayerres *res_a, } else if (memcmp (effectname, "bevl", 4) == 0) { - gint32 size; + gint32 size = 0; gint32 ver; gint32 angle; gint32 strength; @@ -947,7 +947,7 @@ load_resource_lyvr (const PSDlayerres *res_a, GInputStream *input, GError **error) { - gint32 version; + gint32 version = 0; IFDBG(2) g_debug ("Process layer resource block %.4s: layer version", res_a->key); diff --git a/plug-ins/file-psd/psd-thumb-load.c b/plug-ins/file-psd/psd-thumb-load.c index b6cc262dd08..742af49d68b 100644 --- a/plug-ins/file-psd/psd-thumb-load.c +++ b/plug-ins/file-psd/psd-thumb-load.c @@ -157,7 +157,7 @@ read_header_block (PSDimage *img_a, GInputStream *input, GError **error) { - guint16 version; + guint16 version = 0; gchar sig[4]; gchar buf[6]; @@ -209,7 +209,7 @@ read_color_mode_block (PSDimage *img_a, GInputStream *input, GError **error) { - guint64 block_len; + guint64 block_len = 0; guint64 block_start; guint64 block_end; @@ -237,7 +237,7 @@ read_image_resource_block (PSDimage *img_a, GInputStream *input, GError **error) { - guint64 block_len; + guint64 block_len = 0; guint64 block_end; if (psd_read (input, &block_len, 4, error) < 4) diff --git a/plug-ins/file-tiff/file-tiff-load.c b/plug-ins/file-tiff/file-tiff-load.c index c26e7941689..9ef94ec81cb 100644 --- a/plug-ins/file-tiff/file-tiff-load.c +++ b/plug-ins/file-tiff/file-tiff-load.c @@ -1209,10 +1209,10 @@ load_image (GFile *file, /* any resolution info in the file? */ { - gfloat xres = 72.0; - gfloat yres = 72.0; - gushort read_unit; - GimpUnit unit = GIMP_UNIT_PIXEL; /* invalid unit */ + gfloat xres = 72.0; + gfloat yres = 72.0; + gushort read_unit = 0; + GimpUnit unit = GIMP_UNIT_PIXEL; /* invalid unit */ if (TIFFGetField (tif, TIFFTAG_XRESOLUTION, &xres)) { -- GitLab From 164079b93617359da7fc8da5da6a89dc36b9a575 Mon Sep 17 00:00:00 2001 From: sonia Date: Mon, 28 Mar 2022 23:33:55 +0200 Subject: [PATCH 8/8] remove extra parentheses. --- plug-ins/common/file-jp2-load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plug-ins/common/file-jp2-load.c b/plug-ins/common/file-jp2-load.c index 0e271005884..4ffe015f6e5 100644 --- a/plug-ins/common/file-jp2-load.c +++ b/plug-ins/common/file-jp2-load.c @@ -1242,7 +1242,7 @@ load_image (GFile *file, goto out; } } - else if ((image->color_space == OPJ_CLRSPC_CMYK)) + else if (image->color_space == OPJ_CLRSPC_CMYK) { if (! color_cmyk_to_rgb (image)) { -- GitLab