summaryrefslogtreecommitdiffstats
path: root/unix/tclXtNotify.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-03-05 10:32:38 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-03-05 10:32:38 (GMT)
commit75e8b346e2193f1c524cbbb741583e6ab4dfc417 (patch)
treeb176ac82c867eb9f5b5e441afd6e1314491cc14f /unix/tclXtNotify.c
parentb2f5cb2b5926675920e0bf8d12c39ee6e91ac1e0 (diff)
downloadtcl-75e8b346e2193f1c524cbbb741583e6ab4dfc417.zip
tcl-75e8b346e2193f1c524cbbb741583e6ab4dfc417.tar.gz
tcl-75e8b346e2193f1c524cbbb741583e6ab4dfc417.tar.bz2
Add "const" to Tcl_SetNotifier() argument. Should have been part of TIP #27, looooooong ago. This simplifier tclXtNotify.c a lot.
Diffstat (limited to 'unix/tclXtNotify.c')
-rw-r--r--unix/tclXtNotify.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/unix/tclXtNotify.c b/unix/tclXtNotify.c
index 0210cd3..45bda3e 100644
--- a/unix/tclXtNotify.c
+++ b/unix/tclXtNotify.c
@@ -181,7 +181,13 @@ TclSetAppContext(
void
InitNotifier(void)
{
- Tcl_NotifierProcs np;
+ static const Tcl_NotifierProcs np =
+ SetTimer,
+ WaitForEvent,
+ CreateFileHandler,
+ DeleteFileHandler,
+ NULL, NULL, NULL, NULL
+ };
/*
* Only reinitialize if we are not in exit handling. The notifier can get
@@ -193,11 +199,6 @@ InitNotifier(void)
return;
}
- memset(&np, 0, sizeof(np));
- np.createFileHandlerProc = CreateFileHandler;
- np.deleteFileHandlerProc = DeleteFileHandler;
- np.setTimerProc = SetTimer;
- np.waitForEventProc = WaitForEvent;
Tcl_SetNotifier(&np);
/*