kwo pushed a commit to branch master.

http://git.enlightenment.org/legacy/imlib2.git/commit/?id=c0747f9fc961a539048ade92f1295283b898f205

commit c0747f9fc961a539048ade92f1295283b898f205
Author: Kim Woelders <k...@woelders.dk>
Date:   Wed Mar 16 19:55:41 2016 +0100

    Fix some "variable might be clobbered" warnings.
---
 src/modules/loaders/loader_jpeg.c | 10 +++++++---
 src/modules/loaders/loader_png.c  | 11 ++++++-----
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/modules/loaders/loader_jpeg.c 
b/src/modules/loaders/loader_jpeg.c
index 207864b..72e9034 100644
--- a/src/modules/loaders/loader_jpeg.c
+++ b/src/modules/loaders/loader_jpeg.c
@@ -214,10 +214,10 @@ save(ImlibImage * im, ImlibProgressFunction progress, 
char progress_granularity)
    DATA8              *buf;
    DATA32             *ptr;
    JSAMPROW           *jbuf;
-   int                 y = 0, quality = 75, compression = 2;
+   int                 y, quality, compression;
    ImlibImageTag      *tag;
-   int                 i, j, pl = 0;
-   char                pper = 0;
+   int                 i, j, pl;
+   char                pper;
 
    /* no image data? abort */
    if (!im->data)
@@ -257,6 +257,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char 
progress_granularity)
    /* saver modules */
 
    /* compression */
+   compression = 2;
    tag = __imlib_GetTag(im, "compression");
    if (tag)
      {
@@ -279,6 +280,9 @@ save(ImlibImage * im, ImlibProgressFunction progress, char 
progress_granularity)
       quality = 100;
 
    /* set up jepg compression parameters */
+   y = 0;
+   pl = 0;
+   pper = 0;
    jpeg_set_defaults(&cinfo);
    jpeg_set_quality(&cinfo, quality, TRUE);
    jpeg_start_compress(&cinfo, TRUE);
diff --git a/src/modules/loaders/loader_png.c b/src/modules/loaders/loader_png.c
index 7d67a5d..31f81b2 100644
--- a/src/modules/loaders/loader_png.c
+++ b/src/modules/loaders/loader_png.c
@@ -18,7 +18,7 @@ load(ImlibImage * im, ImlibProgressFunction progress,
 {
    png_uint_32         w32, h32;
    int                 w, h;
-   char                hasa = 0;
+   char                hasa;
    FILE               *f;
    png_structp         png_ptr = NULL;
    png_infop           info_ptr = NULL;
@@ -31,7 +31,9 @@ load(ImlibImage * im, ImlibProgressFunction progress,
    f = fopen(im->real_file, "rb");
    if (!f)
       return 0;
+
    /* read header */
+   hasa = 0;
    if (!im->data)
      {
         unsigned char       buf[PNG_BYTES_TO_CHECK];
@@ -243,10 +245,8 @@ save(ImlibImage * im, ImlibProgressFunction progress, char 
progress_granularity)
    png_infop           info_ptr;
    DATA32             *ptr;
    int                 x, y, j, interlace;
-   png_bytep           row_ptr, data = NULL;
+   png_bytep           row_ptr, data;
    png_color_8         sig_bit;
-   int                 pl = 0;
-   char                pper = 0;
    ImlibImageTag      *tag;
    int                 quality = 75, compression = 3, num_passes = 1, pass;
 
@@ -286,6 +286,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char 
progress_granularity)
 #endif
      }
 
+   data = NULL;
    png_init_io(png_ptr, f);
    if (im->flags & F_HAS_ALPHA)
      {
@@ -374,7 +375,7 @@ save(ImlibImage * im, ImlibProgressFunction progress, char 
progress_granularity)
              if (progress)
                {
                   char                per;
-                  int                 l;
+                  int                 l, pl = 0, pper = 0;
 
                   per = 100 * (pass + y / (float)im->h) / num_passes;
                   if ((per - pper) >= progress_granularity)

-- 


Reply via email to