From 703055871b9c9615284dc69dd2dcf07a05b454f5 Mon Sep 17 00:00:00 2001
From: "jan.nijtmans" <nijtmans@users.sourceforge.net>
Date: Fri, 21 May 2021 07:07:21 +0000
Subject: Make all "pkg?" package names lowercase (was: ""Pkg?"), as we now
 recommend lowercase package names. Let's provide good examples then.

---
 tests/load.test       | 22 +++++++++++-----------
 tests/pkgMkIndex.test |  8 ++++----
 tests/unload.test     | 18 +++++++++++-------
 unix/dltest/pkga.c    | 26 ++++++++++++++------------
 unix/dltest/pkgb.c    | 38 +++++++++++++++++---------------------
 unix/dltest/pkgc.c    | 35 +++++++++++++++++++----------------
 unix/dltest/pkgd.c    | 35 +++++++++++++++++++----------------
 unix/dltest/pkge.c    |  9 ++++-----
 unix/dltest/pkgua.c   | 50 ++++++++++++++++++++++++++------------------------
 unix/tclXtTest.c      |  2 +-
 10 files changed, 126 insertions(+), 117 deletions(-)

diff --git a/tests/load.test b/tests/load.test
index f5c08e9..ec43823 100644
--- a/tests/load.test
+++ b/tests/load.test
@@ -5,7 +5,7 @@
 # generates output for errors.  No output means no errors were found.
 #
 # Copyright (c) 1995 Sun Microsystems, Inc.
-# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright (c) 1998-1999 Scriptics Corporation.
 #
 # See the file "license.terms" for information on usage and redistribution
 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -69,13 +69,13 @@ test load-2.1 {basic loading, with guess for package name} \
 interp create -safe child
 test load-2.2 {loading into a safe interpreter, with package name conversion} \
 	[list $dll $loaded] {
-    load [file join $testDir pkgb$ext] pKgB child
+    load [file join $testDir pkgb$ext] Pkgb child
     list [child eval pkgb_sub 44 13] [catch {child eval pkgb_unsafe} msg] $msg \
 	    [catch {pkgb_sub 12 10} msg2] $msg2
 } {31 1 {invalid command name "pkgb_unsafe"} 1 {invalid command name "pkgb_sub"}}
 test load-2.3 {loading with no _Init procedure} -constraints [list $dll $loaded] \
 -body {
-    list [catch {load [file join $testDir pkgc$ext] foo} msg] $msg
+    list [catch {load [file join $testDir pkgc$ext] Foo} msg] $msg
 } -match glob -result {1 {*couldn't find procedure Foo_Init}}
 test load-2.4 {loading with no _SafeInit procedure} [list $dll $loaded] {
     list [catch {load [file join $testDir pkga$ext] {} child} msg] $msg
@@ -83,7 +83,7 @@ test load-2.4 {loading with no _SafeInit procedure} [list $dll $loaded] {
 
 test load-3.1 {error in _Init procedure, same interpreter} \
 	[list $dll $loaded] {
-    list [catch {load [file join $testDir pkge$ext] pkge} msg] \
+    list [catch {load [file join $testDir pkge$ext] Pkge} msg] \
 	    $msg $::errorInfo $::errorCode
 } {1 {couldn't open "non_existent": no such file or directory} {couldn't open "non_existent": no such file or directory
     while executing
@@ -91,14 +91,14 @@ test load-3.1 {error in _Init procedure, same interpreter} \
     invoked from within
 "if 44 {open non_existent}"
     invoked from within
-"load [file join $testDir pkge$ext] pkge"} {POSIX ENOENT {no such file or directory}}}
+"load [file join $testDir pkge$ext] Pkge"} {POSIX ENOENT {no such file or directory}}}
 test load-3.2 {error in _Init procedure, slave interpreter} \
 	[list $dll $loaded] {
     catch {interp delete x}
     interp create x
     set ::errorCode foo
     set ::errorInfo bar
-    set result [list [catch {load [file join $testDir pkge$ext] pkge x} msg] \
+    set result [list [catch {load [file join $testDir pkge$ext] Pkge x} msg] \
 	    $msg $::errorInfo $::errorCode]
     interp delete x
     set result
@@ -108,20 +108,20 @@ test load-3.2 {error in _Init procedure, slave interpreter} \
     invoked from within
 "if 44 {open non_existent}"
     invoked from within
-"load [file join $testDir pkge$ext] pkge x"} {POSIX ENOENT {no such file or directory}}}
+"load [file join $testDir pkge$ext] Pkge x"} {POSIX ENOENT {no such file or directory}}}
 
 test load-4.1 {reloading package into same interpreter} [list $dll $loaded] {
-    list [catch {load [file join $testDir pkga$ext] pkga} msg] $msg
+    list [catch {load [file join $testDir pkga$ext] Pkga} msg] $msg
 } {0 {}}
 test load-4.2 {reloading package into same interpreter} [list $dll $loaded] {
-    list [catch {load [file join $testDir pkga$ext] pkgb} msg] $msg
+    list [catch {load [file join $testDir pkga$ext] Pkgb} msg] $msg
 } [list 1 "file \"[file join $testDir pkga$ext]\" is already loaded for package \"Pkga\""]
 
 test load-5.1 {file name not specified and no static package: pick default} \
 	[list $dll $loaded] {
     catch {interp delete x}
     interp create x
-    load [file join $testDir pkga$ext] pkga
+    load [file join $testDir pkga$ext] Pkga
     load {} pkga x
     set result [info loaded x]
     interp delete x
@@ -175,7 +175,7 @@ test load-8.3 {TclGetLoadedPackages procedure} [list teststaticpkg $dll $loaded]
     list [info loaded {}] [info loaded child]
 } [list [concat [list {{} Double} {{} More} {{} Another} {{} Test} [list [file join $testDir pkga$ext] Pkga]] $alreadyLoaded] [list {{} Test} [list [file join $testDir pkgb$ext] Pkgb]]]
 test load-8.4 {TclGetLoadedPackages procedure} [list $dll $loaded teststaticpkg] {
-    load [file join $testDir pkgb$ext] pkgb
+    load [file join $testDir pkgb$ext] Pkgb
     list [info loaded {}] [lsort [info commands pkgb_*]]
 } [list [concat [list [list [file join $testDir pkgb$ext] Pkgb] {{} Double} {{} More} {{} Another} {{} Test} [list [file join $testDir pkga$ext] Pkga]] $alreadyLoaded] {pkgb_sub pkgb_unsafe}]
 interp delete child
diff --git a/tests/pkgMkIndex.test b/tests/pkgMkIndex.test
index 990bb5f..3387e07 100644
--- a/tests/pkgMkIndex.test
+++ b/tests/pkgMkIndex.test
@@ -5,7 +5,7 @@
 # Sourcing this file into Tcl runs the tests and generates output for
 # errors.  No output means no errors were found.
 #
-# Copyright (c) 1998-1999 by Scriptics Corporation.
+# Copyright (c) 1998-1999 Scriptics Corporation.
 # All rights reserved.
 
 package require tcltest 2
@@ -562,8 +562,8 @@ testConstraint $dll [file exists $x]
 
 if {[testConstraint $dll]} {
     makeFile {
-#  This package provides Pkga, which is also provided by a DLL.
-package provide Pkga 1.0
+#  This package provides pkga, which is also provided by a DLL.
+package provide pkga 1.0
 proc pkga_neq { x } {
     return [expr {! [pkgq_eq $x]}]
 }
@@ -579,7 +579,7 @@ test pkgMkIndex-10.1 {package in DLL and script} [list exec $dll] {
     set cmd [list pkg_mkIndex -lazy $fullPkgPath [file tail $x] pkga.tcl]
     exec [interpreter] << $cmd
     pkgtest::runCreatedIndex {0 {}} -lazy $fullPkgPath pkga[info sharedlibextension] pkga.tcl
-} "0 {{Pkga:1.0 {tclPkgSetup {pkga[info sharedlibextension] load {pkga_eq pkga_quote}} {pkga.tcl source pkga_neq}}}}"
+} "0 {{pkga:1.0 {tclPkgSetup {pkga[info sharedlibextension] load {pkga_eq pkga_quote}} {pkga.tcl source pkga_neq}}}}"
 test pkgMkIndex-10.2 {package in DLL hidden by -load} [list exec $dll] {
     # Do all [load]ing of shared libraries in another process, so 
     # we can delete the file and not get stuck because we're holding
diff --git a/tests/unload.test b/tests/unload.test
index 9e34bce..be96a62 100644
--- a/tests/unload.test
+++ b/tests/unload.test
@@ -5,8 +5,8 @@
 # generates output for errors.  No output means no errors were found.
 #
 # Copyright (c) 1995 Sun Microsystems, Inc.
-# Copyright (c) 1998-1999 by Scriptics Corporation.
-# Copyright (c) 2003-2004 by Georgios Petasis
+# Copyright (c) 1998-1999 Scriptics Corporation.
+# Copyright (c) 2003-2004 Georgios Petasis
 #
 # See the file "license.terms" for information on usage and redistribution
 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -108,14 +108,14 @@ child eval {
 test unload-3.1 {basic loading of non-unloadable package in a safe interpreter, with package name conversion} \
 	[list $dll $loaded] {
     catch {rename pkgb_sub {}}
-    load [file join $testDir pkgb$ext] pKgB child
+    load [file join $testDir pkgb$ext] Pkgb child
     list [child eval pkgb_sub 44 13] [catch {child eval pkgb_unsafe} msg] $msg \
          [catch {pkgb_sub 12 10} msg2] $msg2
 } {31 1 {invalid command name "pkgb_unsafe"} 1 {invalid command name "pkgb_sub"}}
 test unload-3.2 {basic loading of unloadable package in a safe interpreter, with package name conversion} \
 	[list $dll $loaded] {
     list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \
-	    [load [file join $testDir pkgua$ext] pKgUA child] \
+	    [load [file join $testDir pkgua$ext] Pkgua child] \
 	    [child eval pkgua_eq abc def] \
 	    [lsort [child eval info commands pkgua_*]] \
 	    [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}]
@@ -148,7 +148,7 @@ test unload-3.6 {reloading of unloaded package in a safe interpreter, with guess
 test unload-3.7 {basic unloading of re-loaded package from a safe interpreter, with package name conversion} \
 	[list $dll $loaded] {
     list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \
-	    [unload [file join $testDir pkgua$ext] pKgUa child] \
+	    [unload [file join $testDir pkgua$ext] Pkgua child] \
 	    [child eval info commands pkgua_*] \
 	    [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}]
 } {{.. . .} {} {} {.. .. ..}}
@@ -172,7 +172,7 @@ test unload-4.1 {loading of unloadable package in trusted interpreter, with gues
 test unload-4.2 {basic loading of unloadable package in a safe interpreter, with package name conversion} \
 	[list $dll $loaded] {
     list [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \
-	    [load [file join $testDir pkgua$ext] pKgUA child] \
+	    [load [file join $testDir pkgua$ext] Pkgua child] \
 	    [child eval pkgua_eq abc def] \
 	    [lsort [child eval info commands pkgua_*]] \
 	    [child eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}]
@@ -181,7 +181,7 @@ test unload-4.2 {basic loading of unloadable package in a safe interpreter, with
 test unload-4.3 {basic loading of unloadable package in a second trusted interpreter, with package name conversion} \
 	[list $dll $loaded] {
     list [child-trusted eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}] \
-	    [load [file join $testDir pkgua$ext] pkguA child-trusted] \
+	    [load [file join $testDir pkgua$ext] Pkgua child-trusted] \
 	    [child-trusted eval pkgua_eq abc def] \
 	    [lsort [child-trusted eval info commands pkgua_*]] \
 	    [child-trusted eval {list $pkgua_loaded $pkgua_detached $pkgua_unloaded}]
@@ -217,3 +217,7 @@ interp delete child-trusted
 unset ext
 ::tcltest::cleanupTests
 return
+
+# Local Variables:
+# mode: tcl
+# End:
diff --git a/unix/dltest/pkga.c b/unix/dltest/pkga.c
index f001cdf..77b8e99 100644
--- a/unix/dltest/pkga.c
+++ b/unix/dltest/pkga.c
@@ -17,9 +17,9 @@
  */
 
 static int    Pkga_EqObjCmd(ClientData clientData,
-		Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+		Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
 static int    Pkga_QuoteObjCmd(ClientData clientData,
-		Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+		Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
 
 /*
  *----------------------------------------------------------------------
@@ -44,11 +44,12 @@ Pkga_EqObjCmd(
     ClientData dummy,		/* Not used. */
     Tcl_Interp *interp,		/* Current interpreter. */
     int objc,			/* Number of arguments. */
-    Tcl_Obj *CONST objv[])	/* Argument objects. */
+    Tcl_Obj *const objv[])	/* Argument objects. */
 {
     int result;
-    CONST char *str1, *str2;
+    const char *str1, *str2;
     int len1, len2;
+    (void)dummy;
 
     if (objc != 3) {
 	Tcl_WrongNumArgs(interp, 1, objv,  "string1 string2");
@@ -88,8 +89,10 @@ Pkga_QuoteObjCmd(
     ClientData dummy,		/* Not used. */
     Tcl_Interp *interp,		/* Current interpreter. */
     int objc,			/* Number of arguments. */
-    Tcl_Obj *CONST objv[])	/* Argument strings. */
+    Tcl_Obj *const objv[])	/* Argument strings. */
 {
+    (void)dummy;
+
     if (objc != 2) {
 	Tcl_WrongNumArgs(interp, 1, objv, "value");
 	return TCL_ERROR;
@@ -115,23 +118,22 @@ Pkga_QuoteObjCmd(
  *----------------------------------------------------------------------
  */
 
-int
+DLLEXPORT int
 Pkga_Init(
     Tcl_Interp *interp)		/* Interpreter in which the package is to be
 				 * made available. */
 {
     int code;
 
-    if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+    if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
 	return TCL_ERROR;
     }
-    code = Tcl_PkgProvide(interp, "Pkga", "1.0");
+    code = Tcl_PkgProvide(interp, "pkga", "1.0");
     if (code != TCL_OK) {
 	return code;
     }
-    Tcl_CreateObjCommand(interp, "pkga_eq", Pkga_EqObjCmd,
-	    (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
-    Tcl_CreateObjCommand(interp, "pkga_quote", Pkga_QuoteObjCmd,
-	    (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+    Tcl_CreateObjCommand(interp, "pkga_eq", Pkga_EqObjCmd, NULL, NULL);
+    Tcl_CreateObjCommand(interp, "pkga_quote", Pkga_QuoteObjCmd, NULL,
+	    NULL);
     return TCL_OK;
 }
diff --git a/unix/dltest/pkgb.c b/unix/dltest/pkgb.c
index 4d8cdab..949f9d3 100644
--- a/unix/dltest/pkgb.c
+++ b/unix/dltest/pkgb.c
@@ -18,9 +18,9 @@
  */
 
 static int    Pkgb_SubObjCmd(ClientData clientData,
-		Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+		Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
 static int    Pkgb_UnsafeObjCmd(ClientData clientData,
-		Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+		Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
 
 /*
  *----------------------------------------------------------------------
@@ -48,9 +48,10 @@ Pkgb_SubObjCmd(
     ClientData dummy,		/* Not used. */
     Tcl_Interp *interp,		/* Current interpreter. */
     int objc,			/* Number of arguments. */
-    Tcl_Obj *CONST objv[])	/* Argument objects. */
+    Tcl_Obj *const objv[])	/* Argument objects. */
 {
     int first, second;
+    (void)dummy;
 
     if (objc != 3) {
 	Tcl_WrongNumArgs(interp, 1, objv, "num num");
@@ -89,11 +90,15 @@ Pkgb_UnsafeObjCmd(
     ClientData dummy,		/* Not used. */
     Tcl_Interp *interp,		/* Current interpreter. */
     int objc,			/* Number of arguments. */
-    Tcl_Obj *CONST objv[])	/* Argument objects. */
+    Tcl_Obj *const objv[])	/* Argument objects. */
 {
+    (void)dummy;
+    (void)objc;
+    (void)objv;
+
     return Tcl_EvalEx(interp, "list unsafe command invoked", -1, TCL_EVAL_GLOBAL);
 }
-
+
 /*
  *----------------------------------------------------------------------
  *
@@ -119,19 +124,14 @@ Pkgb_Init(
     int code;
 
     if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
-	if (Tcl_InitStubs(interp, "8.4-", 0) == NULL) {
-	    return TCL_ERROR;
-	}
-	Tcl_ResetResult(interp);
+	return TCL_ERROR;
     }
-    code = Tcl_PkgProvide(interp, "Pkgb", "2.3");
+    code = Tcl_PkgProvide(interp, "pkgb", "2.3");
     if (code != TCL_OK) {
 	return code;
     }
-    Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd,
-	    (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
-    Tcl_CreateObjCommand(interp, "pkgb_unsafe", Pkgb_UnsafeObjCmd,
-	    (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+    Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, NULL, NULL);
+    Tcl_CreateObjCommand(interp, "pkgb_unsafe", Pkgb_UnsafeObjCmd, NULL, NULL);
     return TCL_OK;
 }
 
@@ -160,16 +160,12 @@ Pkgb_SafeInit(
     int code;
 
     if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
-	if (Tcl_InitStubs(interp, "8.4-", 0) == NULL) {
-	    return TCL_ERROR;
-	}
-	Tcl_ResetResult(interp);
+	return TCL_ERROR;
     }
-    code = Tcl_PkgProvide(interp, "Pkgb", "2.3");
+    code = Tcl_PkgProvide(interp, "pkgb", "2.3");
     if (code != TCL_OK) {
 	return code;
     }
-    Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, (ClientData) 0,
-	    (Tcl_CmdDeleteProc *) NULL);
+    Tcl_CreateObjCommand(interp, "pkgb_sub", Pkgb_SubObjCmd, NULL, NULL);
     return TCL_OK;
 }
diff --git a/unix/dltest/pkgc.c b/unix/dltest/pkgc.c
index 6ad5ab4..d881f0d 100644
--- a/unix/dltest/pkgc.c
+++ b/unix/dltest/pkgc.c
@@ -18,9 +18,9 @@
  */
 
 static int    Pkgc_SubObjCmd(ClientData clientData,
-		Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+		Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
 static int    Pkgc_UnsafeObjCmd(ClientData clientData,
-		Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+		Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
 
 /*
  *----------------------------------------------------------------------
@@ -44,9 +44,10 @@ Pkgc_SubObjCmd(
     ClientData dummy,		/* Not used. */
     Tcl_Interp *interp,		/* Current interpreter. */
     int objc,			/* Number of arguments. */
-    Tcl_Obj *CONST objv[])	/* Argument objects. */
+    Tcl_Obj *const objv[])	/* Argument objects. */
 {
     int first, second;
+    (void)dummy;
 
     if (objc != 3) {
 	Tcl_WrongNumArgs(interp, 1, objv, "num num");
@@ -82,8 +83,12 @@ Pkgc_UnsafeObjCmd(
     ClientData dummy,		/* Not used. */
     Tcl_Interp *interp,		/* Current interpreter. */
     int objc,			/* Number of arguments. */
-    Tcl_Obj *CONST objv[])	/* Argument objects. */
+    Tcl_Obj *const objv[])	/* Argument objects. */
 {
+    (void)dummy;
+    (void)objc;
+    (void)objv;
+
     Tcl_SetObjResult(interp, Tcl_NewStringObj("unsafe command invoked", -1));
     return TCL_OK;
 }
@@ -105,24 +110,23 @@ Pkgc_UnsafeObjCmd(
  *----------------------------------------------------------------------
  */
 
-int
+DLLEXPORT int
 Pkgc_Init(
     Tcl_Interp *interp)		/* Interpreter in which the package is to be
 				 * made available. */
 {
     int code;
 
-    if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+    if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
 	return TCL_ERROR;
     }
-    code = Tcl_PkgProvide(interp, "Pkgc", "1.7.2");
+    code = Tcl_PkgProvide(interp, "pkgc", "1.7.2");
     if (code != TCL_OK) {
 	return code;
     }
-    Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd,
-	    (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
-    Tcl_CreateObjCommand(interp, "pkgc_unsafe", Pkgc_UnsafeObjCmd,
-	    (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+    Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, NULL, NULL);
+    Tcl_CreateObjCommand(interp, "pkgc_unsafe", Pkgc_UnsafeObjCmd, NULL,
+	    NULL);
     return TCL_OK;
 }
 
@@ -143,21 +147,20 @@ Pkgc_Init(
  *----------------------------------------------------------------------
  */
 
-int
+DLLEXPORT int
 Pkgc_SafeInit(
     Tcl_Interp *interp)		/* Interpreter in which the package is to be
 				 * made available. */
 {
     int code;
 
-    if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+    if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
 	return TCL_ERROR;
     }
-    code = Tcl_PkgProvide(interp, "Pkgc", "1.7.2");
+    code = Tcl_PkgProvide(interp, "pkgc", "1.7.2");
     if (code != TCL_OK) {
 	return code;
     }
-    Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, (ClientData) 0,
-	    (Tcl_CmdDeleteProc *) NULL);
+    Tcl_CreateObjCommand(interp, "pkgc_sub", Pkgc_SubObjCmd, NULL, NULL);
     return TCL_OK;
 }
diff --git a/unix/dltest/pkgd.c b/unix/dltest/pkgd.c
index 7fe7c49..e7231ba 100644
--- a/unix/dltest/pkgd.c
+++ b/unix/dltest/pkgd.c
@@ -18,9 +18,9 @@
  */
 
 static int    Pkgd_SubObjCmd(ClientData clientData,
-		Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+		Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
 static int    Pkgd_UnsafeObjCmd(ClientData clientData,
-		Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+		Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
 
 /*
  *----------------------------------------------------------------------
@@ -44,9 +44,10 @@ Pkgd_SubObjCmd(
     ClientData dummy,		/* Not used. */
     Tcl_Interp *interp,		/* Current interpreter. */
     int objc,			/* Number of arguments. */
-    Tcl_Obj *CONST objv[])	/* Argument objects. */
+    Tcl_Obj *const objv[])	/* Argument objects. */
 {
     int first, second;
+    (void)dummy;
 
     if (objc != 3) {
 	Tcl_WrongNumArgs(interp, 1, objv, "num num");
@@ -82,8 +83,12 @@ Pkgd_UnsafeObjCmd(
     ClientData dummy,		/* Not used. */
     Tcl_Interp *interp,		/* Current interpreter. */
     int objc,			/* Number of arguments. */
-    Tcl_Obj *CONST objv[])	/* Argument objects. */
+    Tcl_Obj *const objv[])	/* Argument objects. */
 {
+    (void)dummy;
+    (void)objc;
+    (void)objv;
+
     Tcl_SetObjResult(interp, Tcl_NewStringObj("unsafe command invoked", -1));
     return TCL_OK;
 }
@@ -105,24 +110,23 @@ Pkgd_UnsafeObjCmd(
  *----------------------------------------------------------------------
  */
 
-int
+DLLEXPORT int
 Pkgd_Init(
     Tcl_Interp *interp)		/* Interpreter in which the package is to be
 				 * made available. */
 {
     int code;
 
-    if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+    if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
 	return TCL_ERROR;
     }
-    code = Tcl_PkgProvide(interp, "Pkgd", "7.3");
+    code = Tcl_PkgProvide(interp, "pkgd", "7.3");
     if (code != TCL_OK) {
 	return code;
     }
-    Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd,
-	    (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
-    Tcl_CreateObjCommand(interp, "pkgd_unsafe", Pkgd_UnsafeObjCmd,
-	    (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+    Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, NULL, NULL);
+    Tcl_CreateObjCommand(interp, "pkgd_unsafe", Pkgd_UnsafeObjCmd, NULL,
+	    NULL);
     return TCL_OK;
 }
 
@@ -143,21 +147,20 @@ Pkgd_Init(
  *----------------------------------------------------------------------
  */
 
-int
+DLLEXPORT int
 Pkgd_SafeInit(
     Tcl_Interp *interp)		/* Interpreter in which the package is to be
 				 * made available. */
 {
     int code;
 
-    if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+    if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
 	return TCL_ERROR;
     }
-    code = Tcl_PkgProvide(interp, "Pkgd", "7.3");
+    code = Tcl_PkgProvide(interp, "pkgd", "7.3");
     if (code != TCL_OK) {
 	return code;
     }
-    Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, (ClientData) 0,
-	    (Tcl_CmdDeleteProc *) NULL);
+    Tcl_CreateObjCommand(interp, "pkgd_sub", Pkgd_SubObjCmd, NULL, NULL);
     return TCL_OK;
 }
diff --git a/unix/dltest/pkge.c b/unix/dltest/pkge.c
index abd2359..b16acde 100644
--- a/unix/dltest/pkge.c
+++ b/unix/dltest/pkge.c
@@ -12,7 +12,6 @@
  */
 
 #include "tcl.h"
-
 
 /*
  *----------------------------------------------------------------------
@@ -31,15 +30,15 @@
  *----------------------------------------------------------------------
  */
 
-int
+DLLEXPORT int
 Pkge_Init(
     Tcl_Interp *interp)		/* Interpreter in which the package is to be
 				 * made available. */
 {
-    static char script[] = "if 44 {open non_existent}";
+    static const char script[] = "if 44 {open non_existent}";
 
-    if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+    if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
 	return TCL_ERROR;
     }
-    return Tcl_Eval(interp, script);
+    return Tcl_EvalEx(interp, script, -1, 0);
 }
diff --git a/unix/dltest/pkgua.c b/unix/dltest/pkgua.c
index 9c36e88..cc03886 100644
--- a/unix/dltest/pkgua.c
+++ b/unix/dltest/pkgua.c
@@ -18,9 +18,9 @@
  */
 
 static int    PkguaEqObjCmd(ClientData clientData,
-		Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+		Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
 static int    PkguaQuoteObjCmd(ClientData clientData,
-		Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]);
+		Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
 
 /*
  * In the following hash table we are going to store a struct that holds all
@@ -38,7 +38,6 @@ static Tcl_HashTable interpTokenMap;
 static int interpTokenMapInitialised = 0;
 #define MAX_REGISTERED_COMMANDS 2
 
-
 static void
 PkguaInitTokensHashTable(void)
 {
@@ -49,7 +48,7 @@ PkguaInitTokensHashTable(void)
     interpTokenMapInitialised = 1;
 }
 
-void
+static void
 PkguaFreeTokensHashTable(void)
 {
     Tcl_HashSearch search;
@@ -73,8 +72,8 @@ PkguaInterpToTokens(
 
     if (newEntry) {
 	cmdTokens = (Tcl_Command *)
-		Tcl_Alloc(sizeof(Tcl_Command) * (MAX_REGISTERED_COMMANDS+1));
-	for (newEntry=0 ; newEntry<MAX_REGISTERED_COMMANDS+1 ; ++newEntry) {
+		Tcl_Alloc(sizeof(Tcl_Command) * (MAX_REGISTERED_COMMANDS));
+	for (newEntry=0 ; newEntry<MAX_REGISTERED_COMMANDS ; ++newEntry) {
 	    cmdTokens[newEntry] = NULL;
 	}
 	Tcl_SetHashValue(entryPtr, (ClientData) cmdTokens);
@@ -120,11 +119,12 @@ PkguaEqObjCmd(
     ClientData dummy,		/* Not used. */
     Tcl_Interp *interp,		/* Current interpreter. */
     int objc,			/* Number of arguments. */
-    Tcl_Obj *CONST objv[])	/* Argument objects. */
+    Tcl_Obj *const objv[])	/* Argument objects. */
 {
     int result;
-    CONST char *str1, *str2;
+    const char *str1, *str2;
     int len1, len2;
+    (void)dummy;
 
     if (objc != 3) {
 	Tcl_WrongNumArgs(interp, 1, objv,  "string1 string2");
@@ -164,8 +164,10 @@ PkguaQuoteObjCmd(
     ClientData dummy,		/* Not used. */
     Tcl_Interp *interp,		/* Current interpreter. */
     int objc,			/* Number of arguments. */
-    Tcl_Obj *CONST objv[])	/* Argument strings. */
+    Tcl_Obj *const objv[])	/* Argument strings. */
 {
+    (void)dummy;
+
     if (objc != 2) {
 	Tcl_WrongNumArgs(interp, 1, objv, "value");
 	return TCL_ERROR;
@@ -191,39 +193,39 @@ PkguaQuoteObjCmd(
  *----------------------------------------------------------------------
  */
 
-int
+DLLEXPORT int
 Pkgua_Init(
     Tcl_Interp *interp)		/* Interpreter in which the package is to be
 				 * made available. */
 {
-    int code, cmdIndex = 0;
+    int code;
     Tcl_Command *cmdTokens;
 
-    if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+    if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
 	return TCL_ERROR;
     }
 
     /*
-     * Initialise our Hash table, where we store the registered command tokens
+     * Initialize our Hash table, where we store the registered command tokens
      * for each interpreter.
      */
 
     PkguaInitTokensHashTable();
 
-    code = Tcl_PkgProvide(interp, "Pkgua", "1.0");
+    code = Tcl_PkgProvide(interp, "pkgua", "1.0");
     if (code != TCL_OK) {
 	return code;
     }
 
-    Tcl_SetVar(interp, "::pkgua_loaded", ".", TCL_APPEND_VALUE);
+    Tcl_SetVar2(interp, "::pkgua_loaded", NULL, ".", TCL_APPEND_VALUE);
 
     cmdTokens = PkguaInterpToTokens(interp);
-    cmdTokens[cmdIndex++] =
+    cmdTokens[0] =
 	    Tcl_CreateObjCommand(interp, "pkgua_eq", PkguaEqObjCmd,
-		    (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
-    cmdTokens[cmdIndex++] =
+		    NULL, NULL);
+    cmdTokens[1] =
 	    Tcl_CreateObjCommand(interp, "pkgua_quote", PkguaQuoteObjCmd,
-		    (ClientData) 0, (Tcl_CmdDeleteProc *) NULL);
+		    NULL, NULL);
     return TCL_OK;
 }
 
@@ -244,7 +246,7 @@ Pkgua_Init(
  *----------------------------------------------------------------------
  */
 
-int
+DLLEXPORT int
 Pkgua_SafeInit(
     Tcl_Interp *interp)		/* Interpreter in which the package is to be
 				 * made available. */
@@ -269,7 +271,7 @@ Pkgua_SafeInit(
  *----------------------------------------------------------------------
  */
 
-int
+DLLEXPORT int
 Pkgua_Unload(
     Tcl_Interp *interp,		/* Interpreter from which the package is to be
 				 * unloaded. */
@@ -290,7 +292,7 @@ Pkgua_Unload(
 
     PkguaDeleteTokens(interp);
 
-    Tcl_SetVar(interp, "::pkgua_detached", ".", TCL_APPEND_VALUE);
+    Tcl_SetVar2(interp, "::pkgua_detached", NULL, ".", TCL_APPEND_VALUE);
 
     if (flags == TCL_UNLOAD_DETACH_FROM_PROCESS) {
 	/*
@@ -300,7 +302,7 @@ Pkgua_Unload(
 	 */
 
 	PkguaFreeTokensHashTable();
-	Tcl_SetVar(interp, "::pkgua_unloaded", ".", TCL_APPEND_VALUE);
+	Tcl_SetVar2(interp, "::pkgua_unloaded", NULL, ".", TCL_APPEND_VALUE);
     }
     return TCL_OK;
 }
@@ -322,7 +324,7 @@ Pkgua_Unload(
  *----------------------------------------------------------------------
  */
 
-int
+DLLEXPORT int
 Pkgua_SafeUnload(
     Tcl_Interp *interp,		/* Interpreter from which the package is to be
 				 * unloaded. */
diff --git a/unix/tclXtTest.c b/unix/tclXtTest.c
index 1393dfe..2045a54 100644
--- a/unix/tclXtTest.c
+++ b/unix/tclXtTest.c
@@ -39,7 +39,7 @@ int
 Tclxttest_Init(
     Tcl_Interp *interp)		/* Interpreter for application. */
 {
-    if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) {
+    if (Tcl_InitStubs(interp, "8.4", 0) == NULL) {
 	return TCL_ERROR;
     }
     XtToolkitInitialize();
-- 
cgit v0.12