diff --git a/src/modules/Image/encodings/_xpm.c b/src/modules/Image/encodings/_xpm.c index e234b476968d15943d0745b3d10e9e91c95fd0b6..822c53cc9023008f0371e779abc9f77de29f49f2 100644 --- a/src/modules/Image/encodings/_xpm.c +++ b/src/modules/Image/encodings/_xpm.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: _xpm.c,v 1.9 1999/10/26 22:54:03 marcus Exp $"); +RCSID("$Id: _xpm.c,v 1.10 2000/03/27 07:42:35 hubbe Exp $"); #include "image_machine.h" @@ -256,7 +256,8 @@ void f__xpm_write_rows( INT32 args ) adst++; } else { dst++; - adst->r = adst->g = (adst++)->b = color.alpha; + adst->r = adst->g = adst->b = color.alpha; + adst++; } } } diff --git a/src/modules/Image/encodings/psd.c b/src/modules/Image/encodings/psd.c index ca848d5fc4983d01c98892f68eef806f8c906a71..be04eda46309026a2bc4a31472729d8a8458e173 100644 --- a/src/modules/Image/encodings/psd.c +++ b/src/modules/Image/encodings/psd.c @@ -1,5 +1,5 @@ #include "global.h" -RCSID("$Id: psd.c,v 1.14 2000/02/03 19:01:29 grubba Exp $"); +RCSID("$Id: psd.c,v 1.15 2000/03/27 07:42:35 hubbe Exp $"); #include "image_machine.h" @@ -386,7 +386,10 @@ static void f_decode_image_channel( INT32 args ) io = clone_object( image_program, 2 ); dst = ((struct image *)get_storage(io,image_program))->img; for(y=0; y<w*h; y++) - dst->r = dst->g = (dst++)->b = *(source++); + { + dst->r = dst->g = dst->b = *(source++); + dst++; + } pop_n_elems(args); push_object( io ); } @@ -458,7 +461,10 @@ static void f_decode_image_data( INT32 args ) *dst++; } else - dst->r = dst->g = (dst++)->b = *(source++); + { + dst->r = dst->g = dst->b = *(source++); + dst++; + } break; } } diff --git a/src/modules/Image/encodings/tga.c b/src/modules/Image/encodings/tga.c index 76aa1ee8ba1d378a8c21d2bb08492ec828e03cf2..83e80aa1b7085bf31a95ebe6d453ca9b1a56a55d 100644 --- a/src/modules/Image/encodings/tga.c +++ b/src/modules/Image/encodings/tga.c @@ -1,6 +1,6 @@ /* - * $Id: tga.c,v 1.11 2000/03/10 04:53:16 per Exp $ + * $Id: tga.c,v 1.12 2000/03/27 07:42:35 hubbe Exp $ * * Targa codec for pike. Based on the tga plugin for gimp. * @@ -77,7 +77,7 @@ #include "image.h" #include "colortable.h" -RCSID("$Id: tga.c,v 1.11 2000/03/10 04:53:16 per Exp $"); +RCSID("$Id: tga.c,v 1.12 2000/03/27 07:42:35 hubbe Exp $"); #ifndef MIN # define MIN(X,Y) ((X)<(Y)?(X):(Y)) @@ -664,7 +664,8 @@ static struct image_alpha ReadImage(struct buffer *fp, struct tga_header *hdr) (id++)->r = cmap[cmapind++]; if(pelbytes>3) { - ad->r = ad->g = (ad++)->b = cmap[cmapind]; + ad->r = ad->g = ad->b = cmap[cmapind]; + ad++; } sd++; } @@ -673,10 +674,12 @@ static struct image_alpha ReadImage(struct buffer *fp, struct tga_header *hdr) for(y = 0; y<height; y++) for(x = 0; x<width; x++) { - id->r = id->g = (id++)->b = *(sd++); + id->r = id->g = id->b = *(sd++); + id++; if(abpp) { - ad->r = ad->g = (ad++)->b = *(sd++); + ad->r = ad->g = ad->b = *(sd++); + ad++; } } break; @@ -690,7 +693,10 @@ static struct image_alpha ReadImage(struct buffer *fp, struct tga_header *hdr) if(abpp) { if( !really_no_alpha ) - ad->r = ad->g = (ad++)->b = *sd; + { + ad->r = ad->g = ad->b = *sd; + add++; + } sd++; } } @@ -828,7 +834,8 @@ static struct buffer save_tga(struct image *img, struct image *alpha, *(p++) = is->b; *(p++) = is->g; *(p++) = (is++)->r; - *(p++) = ((int)as->r+(int)as->g*2+(as++)->b)/4; + *(p++) = ((int)as->r+(int)as->g*2+as->b)/4; + as++; } } else { p = data = malloc( width*height*3 ); diff --git a/src/modules/Image/encodings/x.c b/src/modules/Image/encodings/x.c index f476866acdb47c95814c36301844463f79b561a9..b8ef6e068d13463acbfe15170ff075d1a8144821 100644 --- a/src/modules/Image/encodings/x.c +++ b/src/modules/Image/encodings/x.c @@ -1,9 +1,9 @@ -/* $Id: x.c,v 1.25 1999/10/19 16:07:34 marcus Exp $ */ +/* $Id: x.c,v 1.26 2000/03/27 07:42:35 hubbe Exp $ */ /* **! module Image **! note -**! $Id: x.c,v 1.25 1999/10/19 16:07:34 marcus Exp $ +**! $Id: x.c,v 1.26 2000/03/27 07:42:35 hubbe Exp $ **! submodule X **! **! This submodule handles encoding and decoding of @@ -29,7 +29,7 @@ #include <winsock.h> #endif -RCSID("$Id: x.c,v 1.25 1999/10/19 16:07:34 marcus Exp $"); +RCSID("$Id: x.c,v 1.26 2000/03/27 07:42:35 hubbe Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -349,8 +349,8 @@ static void image_x_encode_truecolor(INT32 args) } break; case 1: - while (x--) *(d++)=swap_bits[*d]; - break; + while (x--) { *d=swap_bits[*d]; d++; } /* Hope this is correct - Hubbe */ + break; } } diff --git a/src/modules/_Image_TIFF/image_tiff.c b/src/modules/_Image_TIFF/image_tiff.c index 521a23c4a0882146c8cee3107eafc4f0dd1ec53f..64a6e38ed1f6071d870e8405b1f889c561b38623 100644 --- a/src/modules/_Image_TIFF/image_tiff.c +++ b/src/modules/_Image_TIFF/image_tiff.c @@ -13,7 +13,7 @@ #ifdef HAVE_LIBTIFF -RCSID("$Id: image_tiff.c,v 1.12 2000/02/01 23:53:00 hubbe Exp $"); +RCSID("$Id: image_tiff.c,v 1.13 2000/03/27 07:42:57 hubbe Exp $"); #include "global.h" #include "machine.h" @@ -275,7 +275,10 @@ void low_image_tiff_encode( struct buffer *buf, *(b++)=is->g; *(b++)=(is++)->b; if(as) - *(b++)=(as->r + as->g*2 + (as++)->b)/4; + { + *(b++)=(as->r + as->g*2 + as->b)/4; + as++; + } } if(TIFFWriteScanline(tif, buffer, y, 0) < 0) { @@ -348,7 +351,10 @@ void low_image_tiff_decode( struct buffer *buf, di->g = (p>>8) & 255; (di++)->b = (p>>16) & 255; if(!image_only) - da->r = da->g = (da++)->b = (p>>24) & 255; + { + da->r = da->g = da->b = (p>>24) & 255; + da++; + } s++; } free(raster);