From: Elliot Lee Date: Wed, 22 Mar 2000 21:41:45 +0000 (+0000) Subject: gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two X-Git-Tag: GLIB_1_3_1~72 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=916d4db104dc6d5c33323aa72eea41ccc9a3817a;p=platform%2Fupstream%2Fglib.git gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more than 4G apart. --- diff --git a/ChangeLog b/ChangeLog index e1dac4c..808d05a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2000-03-22 Elliot Lee + * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more + than 4G apart. + 2000-03-22 Tor Lillqvist * gutils.c: Move Win32-only includes after inclusion of glib.h, so diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index e1dac4c..808d05a 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,7 @@ +2000-03-22 Elliot Lee + * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more + than 4G apart. + 2000-03-22 Tor Lillqvist * gutils.c: Move Win32-only includes after inclusion of glib.h, so diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index e1dac4c..808d05a 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,7 @@ +2000-03-22 Elliot Lee + * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more + than 4G apart. + 2000-03-22 Tor Lillqvist * gutils.c: Move Win32-only includes after inclusion of glib.h, so diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index e1dac4c..808d05a 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,7 @@ +2000-03-22 Elliot Lee + * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more + than 4G apart. + 2000-03-22 Tor Lillqvist * gutils.c: Move Win32-only includes after inclusion of glib.h, so diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index e1dac4c..808d05a 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,7 @@ +2000-03-22 Elliot Lee + * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more + than 4G apart. + 2000-03-22 Tor Lillqvist * gutils.c: Move Win32-only includes after inclusion of glib.h, so diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index e1dac4c..808d05a 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,7 @@ +2000-03-22 Elliot Lee + * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more + than 4G apart. + 2000-03-22 Tor Lillqvist * gutils.c: Move Win32-only includes after inclusion of glib.h, so diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index e1dac4c..808d05a 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,7 @@ +2000-03-22 Elliot Lee + * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more + than 4G apart. + 2000-03-22 Tor Lillqvist * gutils.c: Move Win32-only includes after inclusion of glib.h, so diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index e1dac4c..808d05a 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,7 @@ +2000-03-22 Elliot Lee + * gmem.c (g_mem_chunk_area_compare): Fix 64-bitness bug in comparing two pointers more + than 4G apart. + 2000-03-22 Tor Lillqvist * gutils.c: Move Win32-only includes after inclusion of glib.h, so diff --git a/glib/gmem.c b/glib/gmem.c index a29cb6d..de0a4ed 100644 --- a/glib/gmem.c +++ b/glib/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 diff --git a/gmem.c b/gmem.c index a29cb6d..de0a4ed 100644 --- 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