diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-24 07:02:14 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-09-24 07:02:14 (GMT) |
commit | 5b12d145d9da9f260abb7e80098fba993b2ea58b (patch) | |
tree | 96bf7b8ed084d9aba8a5c20b8d70b0b9412dce69 | |
parent | 454614a38dfb1db1931eb58c16e3c8eb4f3c10b8 (diff) | |
download | tk-5b12d145d9da9f260abb7e80098fba993b2ea58b.zip tk-5b12d145d9da9f260abb7e80098fba993b2ea58b.tar.gz tk-5b12d145d9da9f260abb7e80098fba993b2ea58b.tar.bz2 |
The UnixSysTray part builds without libnotify. Eliminate some gcc warnings
-rw-r--r-- | unix/tkUnixInit.c | 2 | ||||
-rw-r--r-- | unix/tkUnixInt.h | 3 | ||||
-rw-r--r-- | unix/tkUnixSysTray.c | 26 |
3 files changed, 13 insertions, 18 deletions
diff --git a/unix/tkUnixInit.c b/unix/tkUnixInit.c index 3478f5a..ea3f2c8 100644 --- a/unix/tkUnixInit.c +++ b/unix/tkUnixInit.c @@ -41,7 +41,7 @@ TkpInit( { TkCreateXEventSource(); GetLibraryPath(interp); - (void)Tktray_Init(interp); + Tktray_Init(interp); (void)SysNotify_Init (interp); return TCL_OK; } diff --git a/unix/tkUnixInt.h b/unix/tkUnixInt.h index 947ce44..7904e79 100644 --- a/unix/tkUnixInt.h +++ b/unix/tkUnixInt.h @@ -24,11 +24,10 @@ #include "tkIntPlatDecls.h" -#ifdef HAVE_LIBNOTIFY MODULE_SCOPE int Tktray_Init (Tcl_Interp* interp); +#ifdef HAVE_LIBNOTIFY MODULE_SCOPE int SysNotify_Init (Tcl_Interp* interp); #else -#define Tktray_Init(interp) TCL_OK #define SysNotify_Init(interp) TCL_OK #endif diff --git a/unix/tkUnixSysTray.c b/unix/tkUnixSysTray.c index 4e5f5ff..743448e 100644 --- a/unix/tkUnixSysTray.c +++ b/unix/tkUnixSysTray.c @@ -15,8 +15,6 @@ #include <tk.h> #include "tkUnixInt.h" -#ifdef HAVE_LIBNOTIFY - /* * Based extensively on the tktray extension package. Here we are removing * non-essential parts of tktray. @@ -355,17 +353,17 @@ static int TrayIconObjectCmd(ClientData cd, Tcl_Interp *interp, return TCL_OK; case XWC_ORIENTATION: if (icon->myManager == None || icon->wrapper == None) { - Tcl_SetResult(interp, "none", TCL_STATIC); + Tcl_SetObjResult(interp, Tcl_NewStringObj("none", -1)); } else { switch(QueryTrayOrientation(icon)) { case 0: - Tcl_SetResult(interp, "horizontal", TCL_STATIC); + Tcl_SetObjResult(interp, Tcl_NewStringObj("horizontal", -1)); break; case 1: - Tcl_SetResult(interp, "vertical", TCL_STATIC); + Tcl_SetObjResult(interp, Tcl_NewStringObj("vertical", -1)); break; default: - Tcl_SetResult(interp, "unknown", TCL_STATIC); + Tcl_SetObjResult(interp, Tcl_NewStringObj("unknown", -1)); break; } } @@ -663,25 +661,25 @@ static Tk_OptionSpec IconOptionSpec[]={ {TK_OPTION_STRING,"-image","image","Image", (char *) NULL, -1, offsetof(DockIcon, imageString), - TK_OPTION_NULL_OK, (ClientData) NULL, + TK_OPTION_NULL_OK, NULL, ICON_CONF_IMAGE | ICON_CONF_REDISPLAY}, {TK_OPTION_STRING,"-class","class","Class", "TrayIcon", -1, offsetof(DockIcon, classString), - 0, (ClientData) NULL, + 0, NULL, ICON_CONF_CLASS}, {TK_OPTION_BOOLEAN,"-docked","docked","Docked", "1", -1, offsetof(DockIcon, docked), - 0, (ClientData) NULL, + 0, NULL, ICON_CONF_XEMBED | ICON_CONF_REDISPLAY}, {TK_OPTION_BOOLEAN,"-shape","shape","Shape", "0", -1, offsetof(DockIcon, useShapeExt), - 0, (ClientData) NULL, + 0, NULL, ICON_CONF_IMAGE | ICON_CONF_REDISPLAY}, {TK_OPTION_BOOLEAN,"-visible","visible","Visible", "1", -1, offsetof(DockIcon, visible), - 0, (ClientData) NULL, + 0, NULL, ICON_CONF_XEMBED | ICON_CONF_REDISPLAY}, - {TK_OPTION_END} + {TK_OPTION_END, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0} }; /* @@ -1576,7 +1574,7 @@ static int TrayIconCreateCmd(ClientData cd, Tcl_Interp *interp, icon = (DockIcon*)attemptckalloc(sizeof(DockIcon)); if (!icon) { - Tcl_SetResult(interp, "running out of memory", TCL_STATIC); + Tcl_SetObjResult(interp, Tcl_NewStringObj("running out of memory", -1)); goto handleErrors; } memset(icon,0,sizeof(*icon)); @@ -1696,8 +1694,6 @@ int Tktray_Init ( Tcl_Interp* interp ) return TCL_OK; } -#endif /* HAVE_LIBNOTIFY */ - /* * Local Variables: * mode: objc |