[gimp] Initialize variables that are not initialized to silence warnings.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Initialize variables that are not initialized to silence warnings.
- Date: Wed, 23 Mar 2022 23:09:01 +0000 (UTC)
commit 3dfb3647d4a2c35ddf2059f9f2d0b90968c0ab98
Author: sonia habtiche <habtichesonia2000 gmail com>
Date: Wed Mar 23 23:08:59 2022 +0000
Initialize variables that are not initialized to silence warnings.
Committer's (Jehan) note: with clang version 12.0.0 on macOS Big Sur,
it seems that warnings such as the following are outputted:
> plug-ins/file-psd/psd-load.c:447:32: warning: variable 'block_len' is uninitialized when used here
[-Wuninitialized]
> block_len = GUINT32_FROM_BE (block_len);
> plug-ins/file-psd/psd-load.c:2312:34: note: initialize the variable 'comp_mode' to silence this warning
> guint16 comp_mode;
plug-ins/file-psd/psd-load.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c
index a72fe688ce..985217195c 100644
--- a/plug-ins/file-psd/psd-load.c
+++ b/plug-ins/file-psd/psd-load.c
@@ -434,8 +434,8 @@ read_color_mode_block (PSDimage *img_a,
GInputStream *input,
GError **error)
{
- static guchar cmap[] = { 0, 0, 0, 255, 255, 255 };
- guint32 block_len;
+ 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;
@@ -522,7 +522,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)
@@ -2309,7 +2309,7 @@ add_merged_image (GimpImage *image,
PSDchannel chn_a[MAX_CHANNELS];
gchar *alpha_name;
guchar *pixels;
- guint16 comp_mode;
+ guint16 comp_mode = 0;
guint16 base_channels;
guint16 extra_channels;
guint16 total_channels;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]