forked from old/legacy-imlib2
Fix some "variable might be clobbered" warnings.
This commit is contained in:
parent
078fadde02
commit
c0747f9fc9
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue