diff options
author | Kevin B Kenny <kennykb@acm.org> | 2007-04-20 05:51:08 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2007-04-20 05:51:08 (GMT) |
commit | 19d1741894fc2c56ad61073c9004a90afabf2e56 (patch) | |
tree | d1bc1e4898e7345e3f4220c96e003fd6e41b73ed | |
parent | 0823d0ce0477c8a5a0183f4f9d76768b4cc203fc (diff) | |
download | tcl-19d1741894fc2c56ad61073c9004a90afabf2e56.zip tcl-19d1741894fc2c56ad61073c9004a90afabf2e56.tar.gz tcl-19d1741894fc2c56ad61073c9004a90afabf2e56.tar.bz2 |
Whitespace policing, replacing commas in varargs with constant string catenation, and fixed an oversight in the fix for NZA time zones.
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | generic/tclBasic.c | 8 | ||||
-rw-r--r-- | generic/tclCkalloc.c | 4 | ||||
-rw-r--r-- | generic/tclClock.c | 4 | ||||
-rw-r--r-- | generic/tclCmdIL.c | 6 | ||||
-rw-r--r-- | generic/tclCmdMZ.c | 10 | ||||
-rw-r--r-- | generic/tclDate.c | 4 | ||||
-rw-r--r-- | generic/tclFCmd.c | 4 | ||||
-rw-r--r-- | generic/tclFileName.c | 6 | ||||
-rw-r--r-- | generic/tclGetDate.y | 6 | ||||
-rw-r--r-- | generic/tclIO.c | 22 | ||||
-rw-r--r-- | generic/tclInterp.c | 14 | ||||
-rw-r--r-- | tests/basic.test | 6 | ||||
-rw-r--r-- | tests/clock.test | 6 |
14 files changed, 58 insertions, 52 deletions
@@ -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 <donal.k.fellows@manchester.ac.uk> 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 ; i<objc ; i+=2) { if (TclGetString(objv[i])[0] == '#') { - Tcl_AppendResult(interp, ", this may be due to a ", - "comment incorrectly placed outside of a ", - "switch body - see the \"switch\" ", + Tcl_AppendResult(interp, ", this may be due to a " + "comment incorrectly placed outside of a " + "switch body - see the \"switch\" " "documentation", NULL); break; } diff --git a/generic/tclDate.c b/generic/tclDate.c index 4c914fc..288b5a4 100644 --- a/generic/tclDate.c +++ b/generic/tclDate.c @@ -1512,7 +1512,7 @@ yyreduce: case 38: { - if (yyvsp[-1].Number != HOUR(- 7)) YYABORT; + if (yyvsp[-1].Number != HOUR( 7)) YYABORT; yyYear = yyvsp[-2].Number / 10000; yyMonth = (yyvsp[-2].Number % 10000)/100; yyDay = yyvsp[-2].Number % 100; @@ -1525,7 +1525,7 @@ yyreduce: case 39: { - if (yyvsp[-5].Number != HOUR(- 7)) YYABORT; + if (yyvsp[-5].Number != HOUR( 7)) YYABORT; yyYear = yyvsp[-6].Number / 10000; yyMonth = (yyvsp[-6].Number % 10000)/100; yyDay = yyvsp[-6].Number % 100; diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index 8de33fa..198f9af 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclFCmd.c,v 1.38 2007/04/10 14:47:14 dkf Exp $ + * RCS: @(#) $Id: tclFCmd.c,v 1.39 2007/04/20 05:51:10 kennykb Exp $ */ #include "tclInt.h" @@ -589,7 +589,7 @@ CopyRenameOneFile( if (errno == EINVAL) { Tcl_AppendResult(interp, "error renaming \"", TclGetString(source), "\" to \"", TclGetString(target), - "\": trying to rename a volume or ", + "\": trying to rename a volume or " "move a directory into itself", NULL); goto done; } else if (errno != EXDEV) { diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 6d574aa..fad9f72 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.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: tclFileName.c,v 1.82 2007/04/17 14:49:53 dkf Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.83 2007/04/20 05:51:10 kennykb Exp $ */ #include "tclInt.h" @@ -1153,7 +1153,7 @@ DoTildeSubst( if (dir == NULL) { if (interp) { Tcl_ResetResult(interp); - Tcl_AppendResult(interp, "couldn't find HOME environment ", + Tcl_AppendResult(interp, "couldn't find HOME environment " "variable to expand path", (char *) NULL); } return NULL; @@ -1305,7 +1305,7 @@ Tcl_GlobObjCmd( } if ((globFlags & TCL_GLOBMODE_TAILS) && (pathOrDir == NULL)) { Tcl_AppendResult(interp, - "\"-tails\" must be used with either ", + "\"-tails\" must be used with either " "\"-directory\" or \"-path\"", NULL); return TCL_ERROR; } diff --git a/generic/tclGetDate.y b/generic/tclGetDate.y index 89fa14d..607c8ae 100644 --- a/generic/tclGetDate.y +++ b/generic/tclGetDate.y @@ -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: tclGetDate.y,v 1.34 2007/04/20 04:11:22 kennykb Exp $ + * RCS: @(#) $Id: tclGetDate.y,v 1.35 2007/04/20 05:51:10 kennykb Exp $ */ %{ @@ -346,7 +346,7 @@ ordMonth: tNEXT tMONTH { ; iso : tISOBASE tZONE tISOBASE { - if ($2 != HOUR(- 7)) YYABORT; + if ($2 != HOUR( 7)) YYABORT; yyYear = $1 / 10000; yyMonth = ($1 % 10000)/100; yyDay = $1 % 100; @@ -355,7 +355,7 @@ iso : tISOBASE tZONE tISOBASE { yySeconds = $3 % 100; } | tISOBASE tZONE tUNUMBER ':' tUNUMBER ':' tUNUMBER { - if ($2 != HOUR(- 7)) YYABORT; + if ($2 != HOUR( 7)) YYABORT; yyYear = $1 / 10000; yyMonth = ($1 % 10000)/100; yyDay = $1 % 100; diff --git a/generic/tclIO.c b/generic/tclIO.c index a700b36..04c6f63 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.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: tclIO.c,v 1.117 2007/04/05 13:31:54 dkf Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.118 2007/04/20 05:51:10 kennykb Exp $ */ #include "tclInt.h" @@ -856,7 +856,7 @@ Tcl_UnregisterChannel( if (statePtr->flags & 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 |