There's nothing quite like having a nice conversation with yourself, is there?
On Fri, May 15, 2009 at 1:52 PM, Jerry James <james(a)xemacs.org> wrote:
So here's a concrete proposal. Please give me your reaction to
this
patch. It looks like we have several other places in the codebase
that need a similar treatment for us to compile safely with alias
analysis turned on:
I had to compile another kernel. :-)
This patch eliminates ALL gcc warnings about breaches of alias
analysis ettiquette the way I have my XEmacs configured. Those on
other platforms or using different configuration options may encounter
other places that need to be fixed. It may uglify the code a bit
(although I don't really think that it does; in fact, I generally
detest the macro soup I have to swim in when I go through our code).
diff -r c064d7197712 src/console-impl.h
--- a/src/console-impl.h Sat Apr 18 03:24:48 2009 +0900
+++ b/src/console-impl.h Fri May 15 14:20:28 2009 -0600
@@ -469,11 +469,11 @@
return con;
}
# define CONSOLE_TYPE_DATA(con, type) \
- (*(struct type##_console **) \
- &(error_check_console_type (con, Q##type))->console_data)
+ ((struct type##_console *) \
+ (error_check_console_type (con, Q##type))->console_data)
#else
# define CONSOLE_TYPE_DATA(con, type) \
- (*(struct type##_console **) &((con)->console_data))
+ ((struct type##_console *) ((con)->console_data))
#endif
#define CHECK_CONSOLE_TYPE(x, type) do { \
diff -r c064d7197712 src/console-stream.c
--- a/src/console-stream.c Sat Apr 18 03:24:48 2009 +0900
+++ b/src/console-stream.c Fri May 15 14:20:28 2009 -0600
@@ -72,12 +72,12 @@
struct stream_console *stream_con;
#ifdef NEW_GC
- if (CONSOLE_STREAM_DATA (con) == NULL)
- CONSOLE_STREAM_DATA (con) = alloc_lrecord_type (struct stream_console,
- &lrecord_stream_console);
+ if (con->console_data == NULL)
+ con->console_data = alloc_lrecord_type (struct stream_console,
+ &lrecord_stream_console);
#else /* not NEW_GC */
- if (CONSOLE_STREAM_DATA (con) == NULL)
- CONSOLE_STREAM_DATA (con) = xnew_and_zero (struct stream_console);
+ if (con->console_data == NULL)
+ con->console_data = xnew_and_zero (struct stream_console);
#endif /* not NEW_GC */
stream_con = CONSOLE_STREAM_DATA (con);
@@ -140,7 +140,7 @@
#ifndef NEW_GC
xfree (stream_con, struct stream_console *);
#endif /* not NEW_GC */
- CONSOLE_STREAM_DATA (con) = NULL;
+ con->console_data = NULL;
}
}
diff -r c064d7197712 src/console-tty.c
--- a/src/console-tty.c Sat Apr 18 03:24:48 2009 +0900
+++ b/src/console-tty.c Fri May 15 14:20:28 2009 -0600
@@ -77,10 +77,10 @@
{
/* zero out all slots except the lisp ones ... */
#ifdef NEW_GC
- CONSOLE_TTY_DATA (con) = alloc_lrecord_type (struct tty_console,
- &lrecord_tty_console);
+ con->console_data = alloc_lrecord_type (struct tty_console,
+ &lrecord_tty_console);
#else /* not NEW_GC */
- CONSOLE_TTY_DATA (con) = xnew_and_zero (struct tty_console);
+ con->console_data = xnew_and_zero (struct tty_console);
#endif /* not NEW_GC */
CONSOLE_TTY_DATA (con)->terminal_type = Qnil;
CONSOLE_TTY_DATA (con)->instream = Qnil;
@@ -222,7 +222,7 @@
#ifndef NEW_GC
xfree (tty_con, struct tty_console *);
#endif /* not NEW_GC */
- CONSOLE_TTY_DATA (con) = NULL;
+ con->console_data = NULL;
}
}
diff -r c064d7197712 src/faces.c
--- a/src/faces.c Sat Apr 18 03:24:48 2009 +0900
+++ b/src/faces.c Fri May 15 14:20:28 2009 -0600
@@ -1544,8 +1544,8 @@
}
cachel->display_table = Qunbound;
cachel->background_pixmap = Qunbound;
- FACE_CACHEL_FONT_SPECIFIED (cachel)->size = sizeof(cachel->font_specified);
- FACE_CACHEL_FONT_UPDATED (cachel)->size = sizeof(cachel->font_updated);
+ cachel->font_specified.size = sizeof(cachel->font_specified);
+ cachel->font_updated.size = sizeof(cachel->font_updated);
}
/* Retrieve the index to a cachel for window W that corresponds to
@@ -1628,7 +1628,7 @@
struct face_cachel *cachel = Dynarr_atp (w->face_cachels, elt);
cachel->updated = 0;
- memset(FACE_CACHEL_FONT_UPDATED(cachel)->bits, 0,
+ memset(&cachel->font_updated.bits, 0,
BIT_VECTOR_LONG_STORAGE (NUM_LEADING_BYTES));
}
}
diff -r c064d7197712 src/glyphs-x.c
--- a/src/glyphs-x.c Sat Apr 18 03:24:48 2009 +0900
+++ b/src/glyphs-x.c Fri May 15 14:20:28 2009 -0600
@@ -408,7 +408,7 @@
/* We can release the callbacks again. */
ungcpro_popup_callbacks (IMAGE_INSTANCE_X_WIDGET_LWID (p));
- IMAGE_INSTANCE_X_WIDGET_ID (p) = 0;
+ IMAGE_INSTANCE_SUBWINDOW_ID (p) = 0;
IMAGE_INSTANCE_X_CLIPWIDGET (p) = 0;
}
}
diff -r c064d7197712 src/glyphs-x.h
--- a/src/glyphs-x.h Sat Apr 18 03:24:48 2009 +0900
+++ b/src/glyphs-x.h Fri May 15 14:20:28 2009 -0600
@@ -124,9 +124,9 @@
#define IMAGE_INSTANCE_X_CLIPWIDGET(i) \
(X_SUBWINDOW_INSTANCE_DATA (i)->data.wid.clip_window)
#define IMAGE_INSTANCE_X_SUBWINDOW_ID(i) \
- (* (Window *) & IMAGE_INSTANCE_SUBWINDOW_ID (i))
+ ((Window) IMAGE_INSTANCE_SUBWINDOW_ID (i))
#define IMAGE_INSTANCE_X_WIDGET_ID(i) \
- (* (Widget *) & IMAGE_INSTANCE_SUBWINDOW_ID (i))
+ ((Widget) IMAGE_INSTANCE_SUBWINDOW_ID (i))
#define XIMAGE_INSTANCE_X_SUBWINDOW_PARENT(i) \
IMAGE_INSTANCE_X_SUBWINDOW_PARENT (XIMAGE_INSTANCE (i))
--
Jerry "Let's reimplement XEmacs in Ruby" James
http://www.jamezone.org/
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta