summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-ras.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@fenrus.demon.nl>1999-12-08 21:37:17 +0000
committerArjan van de Ven <arjan@src.gnome.org>1999-12-08 21:37:17 +0000
commit880f5ade6b0f63556d59eb76c458ce6d8fd47d73 (patch)
tree3c79e7752fa3a6b0d25b628b82482eb9b659ac38 /gdk-pixbuf/io-ras.c
parentc6f25c2de84d01246024342621ed70d6a0f8756d (diff)
downloadgtk+-880f5ade6b0f63556d59eb76c458ce6d8fd47d73.tar.gz
Fixed the red/green/red bug on two occasions. Changed from the custom
1999-12-08 Arjan van de Ven <arjan@fenrus.demon.nl> * 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.
Diffstat (limited to 'gdk-pixbuf/io-ras.c')
-rw-r--r--gdk-pixbuf/io-ras.c22
1 files changed, 6 insertions, 16 deletions
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 */