gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two
authorElliot Lee <sopwith@src.gnome.org>
Wed, 22 Mar 2000 21:41:45 +0000 (21:41 +0000)
committerElliot Lee <sopwith@src.gnome.org>
Wed, 22 Mar 2000 21:41:45 +0000 (21:41 +0000)
gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two
pointers more than 4G apart.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gmem.c
gmem.c

index e1dac4c..808d05a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-03-22 Elliot Lee <sopwith@redhat.com>
+       * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more
+       than 4G apart.
+
 2000-03-22  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c: Move Win32-only includes after inclusion of glib.h, so
index e1dac4c..808d05a 100644 (file)
@@ -1,3 +1,7 @@
+2000-03-22 Elliot Lee <sopwith@redhat.com>
+       * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more
+       than 4G apart.
+
 2000-03-22  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c: Move Win32-only includes after inclusion of glib.h, so
index e1dac4c..808d05a 100644 (file)
@@ -1,3 +1,7 @@
+2000-03-22 Elliot Lee <sopwith@redhat.com>
+       * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more
+       than 4G apart.
+
 2000-03-22  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c: Move Win32-only includes after inclusion of glib.h, so
index e1dac4c..808d05a 100644 (file)
@@ -1,3 +1,7 @@
+2000-03-22 Elliot Lee <sopwith@redhat.com>
+       * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more
+       than 4G apart.
+
 2000-03-22  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c: Move Win32-only includes after inclusion of glib.h, so
index e1dac4c..808d05a 100644 (file)
@@ -1,3 +1,7 @@
+2000-03-22 Elliot Lee <sopwith@redhat.com>
+       * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more
+       than 4G apart.
+
 2000-03-22  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c: Move Win32-only includes after inclusion of glib.h, so
index e1dac4c..808d05a 100644 (file)
@@ -1,3 +1,7 @@
+2000-03-22 Elliot Lee <sopwith@redhat.com>
+       * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more
+       than 4G apart.
+
 2000-03-22  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c: Move Win32-only includes after inclusion of glib.h, so
index e1dac4c..808d05a 100644 (file)
@@ -1,3 +1,7 @@
+2000-03-22 Elliot Lee <sopwith@redhat.com>
+       * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more
+       than 4G apart.
+
 2000-03-22  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c: Move Win32-only includes after inclusion of glib.h, so
index e1dac4c..808d05a 100644 (file)
@@ -1,3 +1,7 @@
+2000-03-22 Elliot Lee <sopwith@redhat.com>
+       * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more
+       than 4G apart.
+
 2000-03-22  Tor Lillqvist  <tml@iki.fi>
 
        * gutils.c: Move Win32-only includes after inclusion of glib.h, so
index a29cb6d..de0a4ed 100644 (file)
@@ -931,7 +931,11 @@ static gint
 g_mem_chunk_area_compare (GMemArea *a,
                          GMemArea *b)
 {
-  return (a->mem - b->mem);
+  if (a->mem > b->mem)
+       return 1;
+  else if (a->mem < b->mem)
+       return -1;
+  return 0;
 }
 
 static gint
diff --git a/gmem.c b/gmem.c
index a29cb6d..de0a4ed 100644 (file)
--- a/gmem.c
+++ b/gmem.c
@@ -931,7 +931,11 @@ static gint
 g_mem_chunk_area_compare (GMemArea *a,
                          GMemArea *b)
 {
-  return (a->mem - b->mem);
+  if (a->mem > b->mem)
+       return 1;
+  else if (a->mem < b->mem)
+       return -1;
+  return 0;
 }
 
 static gint