summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--ChangeLog9
-rw-r--r--generic/tkListbox.c4
-rw-r--r--unix/tkUnixEvent.c23
3 files changed, 24 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 23f5e8a..b5da4ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-12-16 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkListbox.c: Fix gcc warning: ignoring return value of ‘strtol’,
+ declared with attribute warn_unused_result
+ * unix/tkUnixEvent.c: Fix gcc warning: dereferencing pointer ‘xgePtr’ does
+ break strict-aliasing rules
+
+
+
2009-12-15 Don Porter <dgp@users.sourceforge.net>
* generic/tkConfig.c: Added another dimension of refCounting to the
diff --git a/generic/tkListbox.c b/generic/tkListbox.c
index f97dd4c..bd2400e 100644
--- a/generic/tkListbox.c
+++ b/generic/tkListbox.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkListbox.c,v 1.55 2009/02/03 23:55:47 nijtmans Exp $
+ * RCS: @(#) $Id: tkListbox.c,v 1.56 2009/12/16 21:12:24 nijtmans Exp $
*/
#include "default.h"
@@ -2742,7 +2742,7 @@ GetListboxIndex(
char *end;
start = stringRep + 1;
- strtol(start, &end, 0);
+ y = strtol(start, &end, 0);
if ((start == end) || (*end != ',')) {
Tcl_AppendResult(interp, "bad listbox index \"", stringRep,
"\": must be active, anchor, end, @x,y, or a number",
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);
}
}