Hi,
there's a problem with gc_cache_eql:
--- gccache-gtk.c~ Tue Feb 6 00:12:44 2001
+++ gccache-gtk.c Tue Feb 6 00:15:53 2001
@@ -114,7 +114,11 @@
gc_cache_eql (const void *arg1, const void *arg2)
{
/* See comment in gc_cache_hash */
- return !memcmp (arg1, arg2, sizeof (struct gcv_and_mask));
+ const struct gcv_and_mask *gcvm1 = (const struct gcv_and_mask *) arg1;
+ const struct gcv_and_mask *gcvm2 = (const struct gcv_and_mask *) arg2;
+
+ return !memcmp(&gcvm1->gcv, &gcvm2->gcv, sizeof(gcvm1->gcv))
+ && gcvm1->mask == gcvm2->mask;
}
struct gc_cache *
@@ -139,7 +143,7 @@
rest = cache->head;
while (rest)
{
- gdk_gc_destroy(rest->gc);
+ gdk_gc_destroy(rest->gc);
next = rest->next;
xfree (rest);
rest = next;
@@ -230,7 +234,7 @@
cache->head = cell->next;
cache->head->prev = 0;
if (cache->tail == cell) cache->tail = 0; /* only one */
- gdk_gc_destroy (cell->gc);
+ gdk_gc_destroy (cell->gc);
cache->delete_count++;
#ifdef GCCACHE_HASH
remhash (&cell->gcvm, cache->table);
Otherwise memcmp will barf at padding garbage between the struct
members. (Very wise decision of the C committee not to allow struct
comparisons, I must say. *sigh*)
Perhaps other places with memcmp should be checked for this problem,
too. The xgccache for example has the same problem, only there seems
to be no padding ocurring, hiding that.
Well, after fixing that xemacs-gtk seems to work ok :)
Falk
uname -a: Linux borkum 2.2.14 #1 Tue May 30 01:00:41 CEST 2000 alpha unknown
./configure '--with-gtk'
XEmacs 21.2-b42 "Poseidon" configured for `alphapca56-unknown-linux'.
Compilation / Installation:
Source code location: /usr/local/src/xemacs-21.2-gtk
Installation prefix: /usr/local
Operating system description file: `s/linux.h'
Machine description file: `m/alpha.h'
Compiler: gcc -g -O3 -Wall -Wno-switch -Wpointer-arith -Winline
-Wmissing-prototypes -Wshadow
Relocating allocator for buffers: no
GNU version of malloc: yes
- Using Doug Lea's new malloc from the GNU C Library.
Window System:
Using GTK menubars.
Using GTK scrollbars.
Using GTK dialog boxes.
Using GTK native widgets.
TTY:
Compiling in support for ncurses.
Compiling in support for GPM (General Purpose Mouse).
Images:
Compiling in support for GIF images (builtin).
Compiling in support for XPM images.
Compiling in support for PNG images.
Compiling in support for JPEG images.
Compiling in support for TIFF images.
Compiling in support for X-Face message headers.
Sound:
Compiling in support for sound (native).
Compiling in support for ESD (Enlightened Sound Daemon).
Databases:
Compiling in support for Berkeley database.
Internationalization:
Mail:
Compiling in support for "dot-locking" mail spool file locking method.
Other Features:
Compiling in support for dynamic shared object modules.
Compiling in support for extra debugging code.
WARNING: ---------------------------------------------------------
WARNING: Compiling in support for runtime error checking.
WARNING: XEmacs will run noticeably more slowly as a result.
WARNING: Error checking is on by default for XEmacs beta releases.
WARNING: ---------------------------------------------------------
Show replies by date
Falk Hueffner <falk.hueffner(a)student.uni-tuebingen.de> writes:
Hi,
there's a problem with gc_cache_eql:
Applied - will check it in this afternoon. Thanks!
-bp