From e2b6630b6576456e6b45fd7bcead62af16e04a8c Mon Sep 17 00:00:00 2001 From: William Joye Date: Thu, 16 Jun 2016 13:55:05 -0400 Subject: minor changes --- src/tkbltStubLib.C | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/tkbltStubLib.C b/src/tkbltStubLib.C index b4180f3..e973063 100644 --- a/src/tkbltStubLib.C +++ b/src/tkbltStubLib.C @@ -4,18 +4,12 @@ #include -void *tkbltStubsPtr; +ClientData tkbltStubsPtr =NULL; -CONST char * -Tkblt_InitStubs(Tcl_Interp *interp, CONST char *version, int exact) +const char* Tkblt_InitStubs(Tcl_Interp* interp, const char* version, int exact) { - CONST char *result; + const char* actualVersion = + Tcl_PkgRequireEx(interp, "tkblt", version, exact, &tkbltStubsPtr); - result = Tcl_PkgRequireEx(interp, "tkblt", version, exact, - (ClientData *) &tkbltStubsPtr); - if (!result || !tkbltStubsPtr) { - return (char *) NULL; - } - - return result; + return (actualVersion && tkbltStubsPtr) ? actualVersion : NULL; } -- cgit v0.12