Re: Buglet in gdk-pixbuf



on 11/13/01 5:45 AM, degger fhm edu wrote:

> In 
> static void
> rgb888amsb (GdkImage    *image,
>           guchar      *pixels,
>           int          rowstride,
>           int          x1,
>           int          y1,
>           int          x2,
>           int          y2,
>           GdkColormap *colormap)
> which can be found in gdk/gdkpixbuf-drawable.c:1102
> 
> there's a line (1147)
> *o++ = (*s << 8) | 0xff; /* untested */
> which gives the compiler warning:
> gdkpixbuf-drawable.c:1147: warning: overflow in implicit constant conversion
> 
> which is obviously correct since both o and s are guint8's. Also what
> value would one expect from left-shifting a guint8 value by 8 and then
> or-ing with 0xff except than 0xff?
> Could it be that o and s are supposed to be an guint32 thusly working on
> the full RGBA at once by left-shifting all by one component and setting
> A to 255?

One problem is that the ifdef LITTLE in this function don't match each
other. The first half of the first two ifdefs matches the second half of the
third ifdef. The fix is almost certainly to reverse the two halves of the
third ifdef.

    -- Darin




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