summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authornijtmans <nijtmans>2009-12-16 21:12:24 (GMT)
committernijtmans <nijtmans>2009-12-16 21:12:24 (GMT)
commitb1cb69cfd445d8dc85bd5de8dae3ef0384f586c9 (patch)
treea06e16c0bac8331162b14c8159e517f93bdfe50d /unix
parent4234ced65ff4cea56909cbbbc71affb96a37abb7 (diff)
downloadtk-b1cb69cfd445d8dc85bd5de8dae3ef0384f586c9.zip
tk-b1cb69cfd445d8dc85bd5de8dae3ef0384f586c9.tar.gz
tk-b1cb69cfd445d8dc85bd5de8dae3ef0384f586c9.tar.bz2
Fix gcc warning: ignoring return value of ‘strtol’,
declared with attribute warn_unused_result Fix gcc warning: dereferencing pointer ‘xgePtr’ does break strict-aliasing rules
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixEvent.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c
index 292af66..d572d42 100644
--- a/unix/tkUnixEvent.c
+++ b/unix/tkUnixEvent.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixEvent.c,v 1.31 2008/10/22 16:30:16 das Exp $
+ * RCS: @(#) $Id: tkUnixEvent.c,v 1.32 2009/12/16 21:12:25 nijtmans Exp $
*/
#include "tkUnixInt.h"
@@ -276,7 +276,12 @@ static void
TransferXEventsToTcl(
Display *display)
{
- XEvent event;
+ union {
+ XEvent x;
+#ifdef GenericEvent
+ xGenericEvent xge;
+#endif
+ } event;
/*
* Transfer events from the X event queue to the Tk event queue after XIM
@@ -286,21 +291,19 @@ TransferXEventsToTcl(
*/
while (QLength(display) > 0) {
- XNextEvent(display, &event);
+ XNextEvent(display, &event.x);
#ifdef GenericEvent
- if (event.type == GenericEvent) {
- xGenericEvent *xgePtr = (xGenericEvent *) &event;
-
+ if (event.x.type == GenericEvent) {
Tcl_Panic("Wild GenericEvent; panic! (extension=%d,evtype=%d)",
- xgePtr->extension, xgePtr->evtype);
+ event.xge.extension, event.xge.evtype);
}
#endif
- if (event.type != KeyPress && event.type != KeyRelease) {
- if (XFilterEvent(&event, None)) {
+ if (event.x.type != KeyPress && event.x.type != KeyRelease) {
+ if (XFilterEvent(&event.x, None)) {
continue;
}
}
- Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
+ Tk_QueueWindowEvent(&event.x, TCL_QUEUE_TAIL);
}
}