From 19d1741894fc2c56ad61073c9004a90afabf2e56 Mon Sep 17 00:00:00 2001 From: Kevin B Kenny Date: Fri, 20 Apr 2007 05:51:08 +0000 Subject: Whitespace policing, replacing commas in varargs with constant string catenation, and fixed an oversight in the fix for NZA time zones. --- ChangeLog | 10 ++++++++++ generic/tclBasic.c | 8 ++++---- generic/tclCkalloc.c | 4 ++-- generic/tclClock.c | 4 ++-- generic/tclCmdIL.c | 6 +++--- generic/tclCmdMZ.c | 10 +++++----- generic/tclDate.c | 4 ++-- generic/tclFCmd.c | 4 ++-- generic/tclFileName.c | 6 +++--- generic/tclGetDate.y | 6 +++--- generic/tclIO.c | 22 +++++++++++----------- generic/tclInterp.c | 14 +++++++------- tests/basic.test | 6 +++--- tests/clock.test | 6 +----- 14 files changed, 58 insertions(+), 52 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1066a6c..06099a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,16 @@ * doc/Notifier.3: Documented Tcl_SetNotifier and Tcl_ServiceModeHook. Quite against my better judgment. [Bug 414933] + * generic/tclBasic.c: + * generic/tclCkalloc.c: + * generic/tclClock.c: + * generic/tclCmdIL.c: + * generic/tclCmdMZ.c: + * generic/tclFCmd.c: + * generic/tclFileName.c: + * generic/tclIO.c: + * generic/tclInterp.c: Replaced commas in varargs with string + concatenation where possible. [Patch 1515234] 2007-04-19 Donal K. Fellows diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 3d58522..33f5da7 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.243 2007/04/10 14:47:08 dkf Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.244 2007/04/20 05:51:08 kennykb Exp $ */ #include "tclInt.h" @@ -1397,7 +1397,7 @@ Tcl_HideCommand( if (strstr(hiddenCmdToken, "::") != NULL) { Tcl_AppendResult(interp, - "cannot use namespace qualifiers in hidden command", + "cannot use namespace qualifiers in hidden command" " token (rename)", NULL); return TCL_ERROR; } @@ -1420,7 +1420,7 @@ Tcl_HideCommand( */ if (cmdPtr->nsPtr != iPtr->globalNsPtr) { - Tcl_AppendResult(interp, "can only hide global namespace commands", + Tcl_AppendResult(interp, "can only hide global namespace commands" " (use rename then hide)", NULL); return TCL_ERROR; } @@ -1547,7 +1547,7 @@ Tcl_ExposeCommand( */ if (strstr(cmdName, "::") != NULL) { - Tcl_AppendResult(interp, "can not expose to a namespace ", + Tcl_AppendResult(interp, "cannot expose to a namespace " "(use expose to toplevel, then rename)", NULL); return TCL_ERROR; } diff --git a/generic/tclCkalloc.c b/generic/tclCkalloc.c index 7993515..6deaf34 100644 --- a/generic/tclCkalloc.c +++ b/generic/tclCkalloc.c @@ -14,7 +14,7 @@ * * This code contributed by Karl Lehenbauer and Mark Diekhans * - * RCS: @(#) $Id: tclCkalloc.c,v 1.30 2006/11/15 20:08:43 dgp Exp $ + * RCS: @(#) $Id: tclCkalloc.c,v 1.31 2007/04/20 05:51:09 kennykb Exp $ */ #include "tclInt.h" @@ -913,7 +913,7 @@ MemoryCmd( } Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": should be active, break_on_malloc, info, init, onexit, ", + "\": should be active, break_on_malloc, info, init, onexit, " "tag, trace, trace_on_at_malloc, or validate", NULL); return TCL_ERROR; diff --git a/generic/tclClock.c b/generic/tclClock.c index 223577b..ff3e7bb 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclClock.c,v 1.60 2007/04/10 14:47:09 dkf Exp $ + * RCS: @(#) $Id: tclClock.c,v 1.61 2007/04/20 05:51:09 kennykb Exp $ */ #include "tclInt.h" @@ -994,7 +994,7 @@ ConvertUTCToLocalUsingC( timeVal = ThreadSafeLocalTime(&tock); if (timeVal == NULL) { Tcl_AppendResult(interp, - "localtime failed (clock value may be too ", + "localtime failed (clock value may be too " "large/small to represent)", NULL); Tcl_SetErrorCode(interp, "CLOCK", "localtimeFailed", NULL); return TCL_ERROR; diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 3484b49..08a96db 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdIL.c,v 1.113 2007/04/10 14:47:09 dkf Exp $ + * RCS: @(#) $Id: tclCmdIL.c,v 1.114 2007/04/20 05:51:09 kennykb Exp $ */ #include "tclInt.h" @@ -3916,7 +3916,7 @@ Tcl_LsortObjCmd( ckfree((char *) sortInfo.indexv); } Tcl_AppendResult(interp, - "\"-command\" option must be followed ", + "\"-command\" option must be followed " "by comparison command", NULL); return TCL_ERROR; } @@ -3941,7 +3941,7 @@ Tcl_LsortObjCmd( ckfree((char *) sortInfo.indexv); } if (i == (objc-2)) { - Tcl_AppendResult(interp, "\"-index\" option must be ", + Tcl_AppendResult(interp, "\"-index\" option must be " "followed by list index", NULL); return TCL_ERROR; } diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 640f43f..dde42b3 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdMZ.c,v 1.148 2007/04/10 14:47:09 dkf Exp $ + * RCS: @(#) $Id: tclCmdMZ.c,v 1.149 2007/04/20 05:51:10 kennykb Exp $ */ #include "tclInt.h" @@ -185,7 +185,7 @@ Tcl_RegexpObjCmd( */ if (doinline && ((objc - 2) != 0)) { - Tcl_AppendResult(interp, "regexp match variables not allowed", + Tcl_AppendResult(interp, "regexp match variables not allowed" " when using -inline", NULL); goto optionError; } @@ -2748,9 +2748,9 @@ Tcl_SwitchObjCmd( if (splitObjs) { for (i=0 ; iflags & CHANNEL_INCLOSE) { if (interp != NULL) { - Tcl_AppendResult(interp, "Illegal recursive call to close ", + Tcl_AppendResult(interp, "Illegal recursive call to close " "through close-handler of channel", NULL); } return TCL_ERROR; @@ -2835,7 +2835,7 @@ Tcl_Close( if (statePtr->flags & CHANNEL_INCLOSE) { if (interp) { - Tcl_AppendResult(interp, "Illegal recursive call to close ", + Tcl_AppendResult(interp, "Illegal recursive call to close " "through close-handler of channel", NULL); } return TCL_ERROR; @@ -6950,7 +6950,7 @@ Tcl_SetChannelOption( if (statePtr->csPtr) { if (interp) { - Tcl_AppendResult(interp, "unable to set channel options: ", + Tcl_AppendResult(interp, "unable to set channel options: " "background copy in progress", NULL); } return TCL_ERROR; @@ -7002,7 +7002,7 @@ Tcl_SetChannelOption( statePtr->flags |= CHANNEL_UNBUFFERED; } else { if (interp) { - Tcl_AppendResult(interp, "bad value for -buffering: ", + Tcl_AppendResult(interp, "bad value for -buffering: " "must be one of full, line, or none", NULL); return TCL_ERROR; } @@ -7062,7 +7062,7 @@ Tcl_SetChannelOption( } else if (argc != 2) { if (interp) { Tcl_AppendResult(interp, - "bad value for -eofchar: should be a list of zero,", + "bad value for -eofchar: should be a list of zero," " one, or two elements", NULL); } ckfree((char *) argv); @@ -7105,7 +7105,7 @@ Tcl_SetChannelOption( } else { if (interp) { Tcl_AppendResult(interp, - "bad value for -translation: must be a one or two", + "bad value for -translation: must be a one or two" " element list", NULL); } ckfree((char *) argv); @@ -7134,8 +7134,8 @@ Tcl_SetChannelOption( } else { if (interp) { Tcl_AppendResult(interp, - "bad value for -translation: ", - "must be one of auto, binary, cr, lf, crlf,", + "bad value for -translation: " + "must be one of auto, binary, cr, lf, crlf," " or platform", NULL); } ckfree((char *) argv); @@ -7185,8 +7185,8 @@ Tcl_SetChannelOption( } else { if (interp) { Tcl_AppendResult(interp, - "bad value for -translation: ", - "must be one of auto, binary, cr, lf, crlf,", + "bad value for -translation: " + "must be one of auto, binary, cr, lf, crlf," " or platform", NULL); } ckfree((char *) argv); diff --git a/generic/tclInterp.c b/generic/tclInterp.c index b9f445a..7fcb341 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInterp.c,v 1.72 2007/04/10 14:47:16 dkf Exp $ + * RCS: @(#) $Id: tclInterp.c,v 1.73 2007/04/20 05:51:10 kennykb Exp $ */ #include "tclInt.h" @@ -2572,7 +2572,7 @@ SlaveRecursionLimit( if (objc) { if (Tcl_IsSafe(interp)) { - Tcl_AppendResult(interp, "permission denied: ", + Tcl_AppendResult(interp, "permission denied: " "safe interpreters cannot change recursion limit", (char *) NULL); return TCL_ERROR; @@ -4105,7 +4105,7 @@ SlaveCommandLimitCmd( return TCL_ERROR; } if (gran < 1) { - Tcl_AppendResult(interp, "granularity must be at ", + Tcl_AppendResult(interp, "granularity must be at " "least 1", NULL); return TCL_ERROR; } @@ -4120,7 +4120,7 @@ SlaveCommandLimitCmd( return TCL_ERROR; } if (limit < 0) { - Tcl_AppendResult(interp, "command limit value must be at ", + Tcl_AppendResult(interp, "command limit value must be at " "least 0", NULL); return TCL_ERROR; } @@ -4297,7 +4297,7 @@ SlaveTimeLimitCmd( return TCL_ERROR; } if (gran < 1) { - Tcl_AppendResult(interp, "granularity must be at ", + Tcl_AppendResult(interp, "granularity must be at " "least 1", NULL); return TCL_ERROR; } @@ -4344,12 +4344,12 @@ SlaveTimeLimitCmd( */ if (secObj != NULL && secLen == 0 && milliLen > 0) { - Tcl_AppendResult(interp, "may only set -milliseconds ", + Tcl_AppendResult(interp, "may only set -milliseconds " "if -seconds is not also being reset", NULL); return TCL_ERROR; } if (milliLen == 0 && (secObj == NULL || secLen > 0)) { - Tcl_AppendResult(interp, "may only reset -milliseconds ", + Tcl_AppendResult(interp, "may only reset -milliseconds " "if -seconds is also being reset", NULL); return TCL_ERROR; } diff --git a/tests/basic.test b/tests/basic.test index e8a9e75..b8d608e 100644 --- a/tests/basic.test +++ b/tests/basic.test @@ -15,7 +15,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: basic.test,v 1.43 2006/11/03 00:34:52 hobbs Exp $ +# RCS: @(#) $Id: basic.test,v 1.44 2007/04/20 05:51:11 kennykb Exp $ # package require tcltest 2 @@ -155,7 +155,7 @@ test basic-12.2 {Tcl_HideCommand, a hidden cmd remembers its containing namespac [namespace delete test_ns_basic] } {:: {} 1 {invalid command name "cmd"} {} :: {}} -test basic-13.1 {Tcl_ExposeCommand, a command stays in the global namespace and can not go to another namespace} { +test basic-13.1 {Tcl_ExposeCommand, a command stays in the global namespace and cannot go to another namespace} { catch {namespace delete test_ns_basic} catch {rename cmd ""} proc cmd {} { ;# note that this is global @@ -182,7 +182,7 @@ test basic-13.1 {Tcl_ExposeCommand, a command stays in the global namespace and [test_ns_basic::exposeCmdWorkAround] \ [test_ns_basic::newCmd] \ [namespace delete test_ns_basic] -} {:: {} 1 {can not expose to a namespace (use expose to toplevel, then rename)} {} ::test_ns_basic {}} +} {:: {} 1 {cannot expose to a namespace (use expose to toplevel, then rename)} {} ::test_ns_basic {}} test basic-13.2 {Tcl_ExposeCommand, invalidate cached refs to cmd now being exposed} { catch {rename p ""} catch {rename cmd ""} diff --git a/tests/clock.test b/tests/clock.test index 4fe33c7..801cb48 100644 --- a/tests/clock.test +++ b/tests/clock.test @@ -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: clock.test,v 1.78 2007/04/20 04:11:22 kennykb Exp $ +# RCS: @(#) $Id: clock.test,v 1.79 2007/04/20 05:51:11 kennykb Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -36548,10 +36548,6 @@ test clock-59.1 {military time zones} { } join $trouble \n } {} - - - - # cleanup -- cgit v0.12