From 880f5ade6b0f63556d59eb76c458ce6d8fd47d73 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Wed, 8 Dec 1999 21:37:17 +0000 Subject: [PATCH] Fixed the red/green/red bug on two occasions. Changed from the custom 1999-12-08 Arjan van de Ven * gdk-pixbuf/gdk-pixbuf-drawable.c : Fixed the red/green/red bug on two occasions. * gdk-pixbuf/io-ras.c: Changed from the custom be32_to_cpu function to the generic glib one. --- gdk-pixbuf/ChangeLog | 7 +++++++ gdk-pixbuf/io-ras.c | 22 ++++++---------------- gdk/gdkpixbuf-drawable.c | 4 ++-- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index bfe8c63e15..5d1693a5d9 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,10 @@ +1999-12-08 Arjan van de Ven + + * gdk-pixbuf/gdk-pixbuf-drawable.c : Fixed the red/green/red + bug on two occasions. + * gdk-pixbuf/io-ras.c: Changed from the custom be32_to_cpu + function to the generic glib one. + 1999-12-08 Federico Mena Quintero * gdk-pixbuf/gdk-pixbuf-drawable.c: Fix includes. diff --git a/gdk-pixbuf/io-ras.c b/gdk-pixbuf/io-ras.c index b079152ead..e0b2e41583 100644 --- a/gdk-pixbuf/io-ras.c +++ b/gdk-pixbuf/io-ras.c @@ -63,16 +63,6 @@ struct rasterfile { be32_to_cpu() ?? */ -static unsigned int be32_to_cpu(guint i) -{ - unsigned int i2; - i2 = - ((i & 255) << 24) | (((i >> 8) & 255) << 16) | - (((i >> 16) & 255) << 8) | ((i >> 24) & 255); - return i2; -} - - /* Progressive loading */ struct ras_progressive_state { @@ -142,12 +132,12 @@ GdkPixbuf *image_load(FILE * f) static void RAS2State(struct rasterfile *RAS, struct ras_progressive_state *State) { - State->Header.width = be32_to_cpu(RAS->width); - State->Header.height = be32_to_cpu(RAS->height); - State->Header.depth = be32_to_cpu(RAS->depth); - State->Header.type = be32_to_cpu(RAS->type); - State->Header.maptype = be32_to_cpu(RAS->maptype); - State->Header.maplength = be32_to_cpu(RAS->maplength); + State->Header.width = GUINT32_FROM_BE(RAS->width); + State->Header.height = GUINT32_FROM_BE(RAS->height); + State->Header.depth = GUINT32_FROM_BE(RAS->depth); + State->Header.type = GUINT32_FROM_BE(RAS->type); + State->Header.maptype = GUINT32_FROM_BE(RAS->maptype); + State->Header.maplength = GUINT32_FROM_BE(RAS->maplength); g_assert(State->Header.maplength <= 768); /* Otherwise, we are in trouble */ diff --git a/gdk/gdkpixbuf-drawable.c b/gdk/gdkpixbuf-drawable.c index 735e43ada0..70f1550f86 100644 --- a/gdk/gdkpixbuf-drawable.c +++ b/gdk/gdkpixbuf-drawable.c @@ -127,7 +127,7 @@ rgb1a (GdkImage *image, art_u8 *pixels, int rowstride) remap[xx] = 0xff | colormap->colors[xx].red << 24 | colormap->colors[xx].green << 16 - | colormap->colors[xx].red << 8; + | colormap->colors[xx].blue << 8; #endif } @@ -221,7 +221,7 @@ rgb8a (GdkImage *image, art_u8 *pixels, int rowstride) remap[xx] = 0xff | colormap->colors[xx].red << 24 | colormap->colors[xx].green << 16 - | colormap->colors[xx].red << 8; + | colormap->colors[xx].blue << 8; #endif }