From c0b4b17c115f5bd0872e62ff51bf9230c41a3089 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sun, 24 Jul 2022 20:04:58 +0000 Subject: Fix windows build (invalid '&'). Eliminate end-of-line spacing --- doc/range.n | 14 +++++++------- generic/tclCmdAH.c | 2 +- generic/tclCmdIL.c | 2 +- generic/tclCmdMZ.c | 24 ++++++++++++------------ generic/tclExecute.c | 6 +++--- generic/tclListObj.c | 22 +++++++++++----------- tests/range.test | 2 +- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/doc/range.n b/doc/range.n index f6b5f17..9978bb9 100644 --- a/doc/range.n +++ b/doc/range.n @@ -32,19 +32,19 @@ and use the numeric result, or error as with any invalid argument value. .SH EXAMPLES .CS .\" - + range 3 \(-> 0 1 - + range 3 0 \(-> 3 2 1 0 - + range 10 .. 1 by 2 \(-> 10 8 6 4 2 - + set l [range 0 -5] \(-> 0 -1 -2 -3 -4 -5 - + foreach i [range [llength $l]] { puts l($i)=[lindex $l $i] } @@ -54,7 +54,7 @@ and use the numeric result, or error as with any invalid argument value. l(3)=-3 l(4)=-4 l(5)=-5 - + foreach i [range [llength $l]-1 0] { puts l($i)=[lindex $l $i] } @@ -64,7 +64,7 @@ and use the numeric result, or error as with any invalid argument value. l(2)=-2 l(1)=-1 l(0)=0 - + set sqrs [lmap i [range 1 10] {expr $i*$i}] \(-> 1 4 9 16 25 36 49 64 81 100 .\" diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 41b7403..73ef295 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -2979,7 +2979,7 @@ ForeachAssignments( valuePtr = Tcl_NewWideIntObj(value); } else { valuePtr = statePtr->argvList[i][k]; - } + } } else { TclNewObj(valuePtr); /* Empty string */ } diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index c593afc..8213d45 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -3072,7 +3072,7 @@ Tcl_LreverseObjCmd( Tcl_WrongNumArgs(interp, 1, objv, "list"); return TCL_ERROR; } - + /* * Handle ArithSeries special case - don't shimmer a series into a list * just to reverse it. diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 23df26f..c48771a 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -128,7 +128,7 @@ Tcl_PwdObjCmd( * SequenceIdentifyArgument -- * * Given a Tcl_Obj, identify if it is a keyword or a number - * + * * Return Value * 0 - failure, unexpected value * 1 - value is a number @@ -150,7 +150,7 @@ SequenceIdentifyArgument( Tcl_WideInt number; SequenceOperators opmode; SequenceByMode bymode; - + status = Tcl_GetWideIntFromObj(NULL, argPtr, &number); if (status != TCL_OK) { /* Check for an index expression */ @@ -172,7 +172,7 @@ SequenceIdentifyArgument( } return NumericArg; } - + status = Tcl_GetIndexFromObj(NULL, argPtr, seq_operations, "range operation", 0, &opmode); if (status == TCL_OK) { @@ -181,7 +181,7 @@ SequenceIdentifyArgument( } return RangeKeywordArg; } - + status = Tcl_GetIndexFromObj(NULL, argPtr, seq_step_keywords, "step keyword", 0, &bymode); if (status == TCL_OK) { @@ -245,7 +245,7 @@ Tcl_RangeObjCmd( SequenceDecoded decoded; int i, arg_key = 0, value_i = 0; - /* + /* * Create a decoding key by looping through the arguments and identify * what kind of argument each one is. Encode each argument as a decimal * digit. @@ -259,7 +259,7 @@ Tcl_RangeObjCmd( switch (decoded) { case NoneArg: - /* + /* * Unrecognizable argument * Reproduce operation error message */ @@ -278,13 +278,13 @@ Tcl_RangeObjCmd( values[value_i] = keyword; value_i++; break; - + case ByKeywordArg: arg_key += ByKeywordArg; values[value_i] = keyword; value_i++; break; - + default: arg_key += 9; // Error state value_i++; @@ -305,7 +305,7 @@ Tcl_RangeObjCmd( status = TCL_ERROR; goto done; break; - + /* range n */ case 1: start = 0; @@ -339,7 +339,7 @@ Tcl_RangeObjCmd( } if (elementCount < 0) elementCount = 0; break; - + /* range n 'to' n */ /* range n 'count' n */ /* range n 'by' n */ @@ -400,7 +400,7 @@ Tcl_RangeObjCmd( break; } break; - + /* range n n 'by' n */ case 1121: start = values[0]; @@ -424,7 +424,7 @@ Tcl_RangeObjCmd( elementCount = step ? (start-end-step)/(-step) : 0; // 0 step -> empty list } break; - + /* range n 'to' n 'by' n */ /* range n 'count' n 'by' n */ case 12121: diff --git a/generic/tclExecute.c b/generic/tclExecute.c index c9ee65d..407b4ed 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -4927,7 +4927,7 @@ TEBCresume( ArithSeries *arithSeriesRepPtr = (ArithSeries*) valuePtr->internalRep.twoPtrValue.ptr1; length = arithSeriesRepPtr->len; - + /* Decode end-offset index values. */ index = TclIndexDecode(opnd, length); @@ -4963,9 +4963,9 @@ TEBCresume( } else { TclNewObj(objResultPtr); } - + lindexFastPath2: - + TRACE_APPEND(("\"%.30s\"\n", O2S(objResultPtr))); NEXT_INST_F(pcAdjustment, 1, 1); diff --git a/generic/tclListObj.c b/generic/tclListObj.c index ef7d515..2bcca64 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -845,7 +845,7 @@ Tcl_ListObjIndex( List *listRepPtr; ListGetInternalRep(listPtr, listRepPtr); - + if (listRepPtr == NULL && TclHasInternalRep(listPtr,&tclArithSeriesType)) { Tcl_WideInt widint; if (Tcl_ArithSeriesObjIndex(listPtr, index, &widint) == TCL_OK) { @@ -853,7 +853,7 @@ Tcl_ListObjIndex( return TCL_OK; } } - + if (listRepPtr == NULL) { int result; int length; @@ -920,7 +920,7 @@ Tcl_ListObjLength( *intPtr = Tcl_ArithSeriesObjLength(listPtr); return TCL_OK; } - + (void) Tcl_GetStringFromObj(listPtr, &length); if (length == 0) { *intPtr = 0; @@ -2060,14 +2060,14 @@ SetListFromAny( if (listRepPtr == NULL) { return TCL_ERROR; } - elemPtrs = &listRepPtr->elements; + elemPtrs = listRepPtr->elements; for (j = 0; j < wideLen; j++) { elemPtrs[j] = Tcl_NewWideIntObj( ArithSeriesIndexM(arithSeriesRepPtr, j)); //->start+(j*arithSeriesRepPtr->step)); Tcl_IncrRefCount(elemPtrs[j]);/* Since list now holds ref to it. */ } - listRepPtr->elemCount = wideLen; - + listRepPtr->elemCount = wideLen; + } else { int estCount, length; const char *limit, *nextElem = TclGetStringFromObj(objPtr, &length); @@ -2260,7 +2260,7 @@ static void UpdateStringOfArithSeries (Tcl_Obj *listPtr); * * The arithmetic series object is a special case of Tcl list representing * an interval of an arithmetic series in constant space. - * + * * The arithmetic series is internally represented with three integers, * *start*, *end*, and *step*, Where the length is calculated with * the following algorithm: @@ -2464,7 +2464,7 @@ FreeArithSeriesInternalRep(Tcl_Obj *arithSeriesPtr) * DupArithSeriesInternalRep -- * * Initialize the internal representation of a arithseries Tcl_Obj to a - * copy of the internal representation of an existing arithseries object. + * copy of the internal representation of an existing arithseries object. * * Results: * None. @@ -2507,7 +2507,7 @@ DupArithSeriesInternalRep(srcPtr, copyPtr) * * Update the string representation for an arithseries object. * Note: This procedure does not invalidate an existing old string rep - * so storage will be lost if this has not already been done. + * so storage will be lost if this has not already been done. * * Results: * None. @@ -2677,9 +2677,9 @@ TclArithSeriesObjRange( { ArithSeries *arithSeriesRepPtr; Tcl_WideInt start = -1, end = -1, step, len; - + ArithSeriesGetInternalRep(arithSeriesPtr, arithSeriesRepPtr); - + if (fromIdx < 0) { fromIdx = 0; } diff --git a/tests/range.test b/tests/range.test index c68a8f9..d1e96ad 100644 --- a/tests/range.test +++ b/tests/range.test @@ -163,7 +163,7 @@ test range-2.12 {decreasing range with step} arithSeriesDouble { } { 25.0 20.0 15.0 10.0 5.0 0.0 -5.0 -10.0 -15.0 -20.0 -25.0} test range-2.13 {count only operation} { - range 5 + range 5 } {0 1 2 3 4} test range-2.14 {count with step} { -- cgit v0.12