Re: [PATCH] ANSI C correctness + warning fixes



On 2 Oct 2000 otaylor fresnel labs redhat com wrote:

> ============
> --- gdk-pixbuf/pixops/timescale.c	2000/07/22 23:50:19	1.5
> +++ gdk-pixbuf/pixops/timescale.c	2000/09/29 15:14:27
> @@ -181,8 +181,8 @@ int main (int argc, char **argv)
>  		start_timing ();
>  		for (i = 0; i < ITERS; i++)
>  		  {
> -		    pixops_scale (dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
> -				  src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
> +		    pixops_scale ((guchar *)dest_buf, 0, 0, dest_width, dest_height, dest_rowstride, dest_channels, dest_has_alpha,
> +				  (guchar *)src_buf, src_width, src_height, src_rowstride, src_channels, src_has_alpha,
>  				  (double)dest_width / src_width, (double)dest_height / src_height,
>  				  filter_level);
> =============
> 
> Just another example of where introducing casts is the wrong thing
> to do. You should instead change dest_buf and src_buf to be guchar.

minor nitpick ;)
these should be guint8* instead of guchar*, since conceptually, we're
operating on a byte array rather than a string.

> 
> Regards,
>                                         Owen
> 

---
ciaoTJ





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]