summaryrefslogtreecommitdiffstats
path: root/Templates/TestDriver.cxx.in
blob: 0e0a8724128d3b2ef7ea02c92c6bcdad4b78b48c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

@CMAKE_TESTDRIVER_EXTRA_INCLUDES@


/* Forward declare test functions. */
@CMAKE_FORWARD_DECLARE_TESTS@

/* Create map.  */

typedef int (*MainFuncPointer)(int , char*[]);
typedef struct
{
  const char* name;
  MainFuncPointer func;
} functionMapEntry;

static functionMapEntry cmakeGeneratedFunctionMapEntries[] = {
  @CMAKE_FUNCTION_TABLE_ENTIRES@
  {0,0}
};

/* Allocate and create a lowercased copy of string
   (note that it has to be free'd manually) */

static char* lowercase(const char *string)
{
  char *new_string, *p;

#ifdef __cplusplus
  new_string = static_cast<char *>(malloc(sizeof(char) *
    static_cast<size_t>(strlen(string) + 1)));
#else
  new_string = (char *)(malloc(sizeof(char) * (size_t)(strlen(string) + 1)));
#endif

  if (!new_string)
    {
    return 0;
    }
  strcpy(new_string, string);
  p = new_string;
  while (*p != 0)
    {
#ifdef __cplusplus
    *p = static_cast<char>(tolower(*p));
#else
    *p = (char)(tolower(*p));
#endif

    ++p;
    }
  return new_string;
}

int main(int ac, char *av[])
{
  int i, NumTests, testNum = 0, partial_match;
  char *arg, *test_name;
  int count;
  int testToRun = -1;

  @CMAKE_TESTDRIVER_ARGVC_FUNCTION@

  for(count =0; cmakeGeneratedFunctionMapEntries[count].name != 0; count++)
    {
    }
  NumTests = count;
  /* If no test name was given */
  /* process command line with user function.  */
  if (ac < 2)
    {
    /* Ask for a test.  */
    printf("Available tests:\n");
    for (i =0; i < NumTests; ++i)
      {
      printf("%3d. %s\n", i, cmakeGeneratedFunctionMapEntries[i].name);
      }
    printf("To run a test, enter the test number: ");
    fflush(stdout);
    if( scanf("%d", &testNum) != 1 )
      {
      printf("Couldn't parse that input as a number\n");
      return -1;
      }
    if (testNum >= NumTests)
      {
      printf("%3d is an invalid test number.\n", testNum);
      return -1;
      }
    testToRun = testNum;
    ac--;
    av++;
    }
  partial_match = 0;
  arg = 0;
  /* If partial match is requested.  */
  if(testToRun == -1 && ac > 1)
    {
    partial_match = (strcmp(av[1], "-R") == 0) ? 1 : 0;
    }
  if (partial_match && ac < 3)
    {
    printf("-R needs an additional parameter.\n");
    return -1;
    }
  if(testToRun == -1)
    {
    arg = lowercase(av[1 + partial_match]);
    }
  for (i =0; i < NumTests && testToRun == -1; ++i)
    {
    test_name = lowercase(cmakeGeneratedFunctionMapEntries[i].name);
    if (partial_match && strstr(test_name, arg) != NULL)
      {
      testToRun = i;
      ac -=2;
      av += 2;
      }
    else if (!partial_match && strcmp(test_name, arg) == 0)
      {
      testToRun = i;
      ac--;
      av++;
      }
    free(test_name);
    }
  if(arg)
    {
    free(arg);
    }
  if(testToRun != -1)
    {
    int result;
@CMAKE_TESTDRIVER_BEFORE_TESTMAIN@
    if (testToRun < 0 || testToRun >= NumTests)
      {
      printf(
        "testToRun was modified by TestDriver code to an invalid value: %3d.\n",
        testNum);
      return -1;
      }
    result = (*cmakeGeneratedFunctionMapEntries[testToRun].func)(ac, av);
@CMAKE_TESTDRIVER_AFTER_TESTMAIN@
    return result;
    }


  /* Nothing was run, display the test names.  */
  printf("Available tests:\n");
  for (i =0; i < NumTests; ++i)
    {
    printf("%3d. %s\n", i, cmakeGeneratedFunctionMapEntries[i].name);
    }
  printf("Failed: %s is an invalid test name.\n", av[1]);

  return -1;
}
option value='bug_e711ffb458'>bug_e711ffb458 Tcl is a high-level, general-purpose, interpreted, dynamic programming language. It was designed with the goal of being very simple but powerful.
summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-04-14 03:24:42 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-04-14 03:24:42 (GMT)
commitec63738e5cc5f171f66684c4ce9aebfb97b1a90b (patch)
tree5c1e98975b8897b4eee8308f4a2875eb07fc2544 /generic
parentdcd5ea5b916676bf83a5fd3de9ee1d19e1f45c81 (diff)
parentf7c3a988274b5e8026bf4836028bfd6831e6a615 (diff)
downloadtcl-ec63738e5cc5f171f66684c4ce9aebfb97b1a90b.zip
tcl-ec63738e5cc5f171f66684c4ce9aebfb97b1a90b.tar.gz
tcl-ec63738e5cc5f171f66684c4ce9aebfb97b1a90b.tar.bz2
Merge trunk
Diffstat (limited to 'generic')
-rw-r--r--generic/regc_nfa.c10
-rw-r--r--generic/regguts.h4
-rw-r--r--generic/tcl.decls2
-rw-r--r--generic/tclAlloc.c6
-rw-r--r--generic/tclBasic.c22
-rw-r--r--generic/tclBinary.c10
-rw-r--r--generic/tclCmdIL.c8
-rw-r--r--generic/tclCmdMZ.c10
-rw-r--r--generic/tclCompCmds.c12
-rw-r--r--generic/tclCompCmdsGR.c6
-rw-r--r--generic/tclCompCmdsSZ.c2
-rw-r--r--generic/tclCompExpr.c8
-rw-r--r--generic/tclCompile.c6
-rw-r--r--generic/tclCompile.h2
-rw-r--r--generic/tclConfig.c2
-rw-r--r--generic/tclDate.c2
-rw-r--r--generic/tclDecls.h36
-rw-r--r--generic/tclDictObj.c12
-rw-r--r--generic/tclEncoding.c2
-rw-r--r--generic/tclEnsemble.c2
-rw-r--r--generic/tclEnv.c2
-rw-r--r--generic/tclEvent.c4
-rw-r--r--generic/tclExecute.c10
-rw-r--r--generic/tclFCmd.c4
-rw-r--r--generic/tclFileName.c4
-rw-r--r--generic/tclIO.c190
-rw-r--r--generic/tclIO.h8
-rw-r--r--generic/tclIOCmd.c5
-rw-r--r--generic/tclIOGT.c14
-rw-r--r--generic/tclIORChan.c26
-rw-r--r--generic/tclIORTrans.c26
-rw-r--r--generic/tclIOUtil.c7
-rw-r--r--generic/tclIndexObj.c2
-rw-r--r--generic/tclInt.h26
-rw-r--r--generic/tclInterp.c6
-rw-r--r--generic/tclLink.c2
-rw-r--r--generic/tclListObj.c89
-rw-r--r--generic/tclLiteral.c4
-rw-r--r--generic/tclNamesp.c6
-rw-r--r--generic/tclNotify.c12
-rw-r--r--generic/tclOO.c4
-rw-r--r--generic/tclOOCall.c2
-rw-r--r--generic/tclOOMethod.c2
-rw-r--r--generic/tclObj.c23
-rw-r--r--generic/tclPanic.c2
-rw-r--r--generic/tclParse.c8
-rw-r--r--generic/tclPathObj.c4
-rw-r--r--generic/tclPipe.c4
-rw-r--r--generic/tclPkg.c4
-rw-r--r--generic/tclResult.c37
-rw-r--r--generic/tclStrToD.c6
-rw-r--r--generic/tclStringObj.c84
-rw-r--r--generic/tclStringRep.h2
-rw-r--r--generic/tclStubInit.c22
-rw-r--r--generic/tclTest.c33
-rw-r--r--generic/tclTestObj.c2
-rw-r--r--generic/tclThreadAlloc.c2
-rw-r--r--generic/tclThreadJoin.c4
-rw-r--r--generic/tclThreadTest.c5
-rw-r--r--generic/tclTrace.c13
-rw-r--r--generic/tclUtf.c2
-rw-r--r--generic/tclUtil.c4
-rw-r--r--generic/tclVar.c4
-rw-r--r--generic/tclZlib.c2
64 files changed, 451 insertions, 435 deletions
diff --git a/generic/regc_nfa.c b/generic/regc_nfa.c
index 94a9f99..5357571 100644
--- a/generic/regc_nfa.c
+++ b/generic/regc_nfa.c
@@ -487,7 +487,7 @@ freearc(
/*
* changearctarget - flip an arc to have a different to state
*
- * Caller must have verified that there is no pre-existing duplicate arc.
+ * Caller must have verified that there is no preexisting duplicate arc.
*
* Note that because we store arcs in their from state, we can't easily have
* a similar changearcsource function.
@@ -1515,7 +1515,7 @@ pullback(
* Returns 1 if successful (which it always is unless the source is the
* start state or we have an internal error), 0 if nothing happened.
*
- * A significant property of this function is that it deletes no pre-existing
+ * A significant property of this function is that it deletes no preexisting
* states, and no outarcs of the constraint's from state other than the given
* constraint arc. This makes the loops in pullback() safe, at the cost that
* we may leave useless states behind. Therefore, we leave it to pullback()
@@ -1694,7 +1694,7 @@ pushfwd(
* Returns 1 if successful (which it always is unless the destination is the
* post state or we have an internal error), 0 if nothing happened.
*
- * A significant property of this function is that it deletes no pre-existing
+ * A significant property of this function is that it deletes no preexisting
* states, and no inarcs of the constraint's to state other than the given
* constraint arc. This makes the loops in pushfwd() safe, at the cost that
* we may leave useless states behind. Therefore, we leave it to pushfwd()
@@ -2467,7 +2467,7 @@ breakconstraintloop(struct nfa * nfa, struct state * sinitial)
* have multiple redundant arc pathways). Each donemap is a char array
* indexed by state number. The donemaps are all of the same size "nstates",
* which is nfa->nstates as of the start of the recursion. This is enough to
- * have entries for all pre-existing states, but *not* entries for clone
+ * have entries for all preexisting states, but *not* entries for clone
* states created during the recursion. That's okay since we have no need to
* mark those.
*
@@ -2774,7 +2774,7 @@ markcanreach(
- analyze - ascertain potentially-useful facts about an optimized NFA
^ static long analyze(struct nfa *);
*/
-static long /* re_info bits to be ORed in */
+static long /* re_info bits to be OR'ed in */
analyze(
struct nfa *nfa)
{
diff --git a/generic/regguts.h b/generic/regguts.h
index b9af7ac..e135874 100644
--- a/generic/regguts.h
+++ b/generic/regguts.h
@@ -258,10 +258,10 @@ struct state {
};
struct nfa {
- struct state *pre; /* pre-initial state */
+ struct state *pre; /* preinitial state */
struct state *init; /* initial state */
struct state *final; /* final state */
- struct state *post; /* post-final state */
+ struct state *post; /* postfinal state */
size_t nstates; /* for numbering states */
struct state *states; /* state-chain header */
struct state *slast; /* tail of the chain */
diff --git a/generic/tcl.decls b/generic/tcl.decls
index e50e3de..375fab8 100644
--- a/generic/tcl.decls
+++ b/generic/tcl.decls
@@ -59,7 +59,7 @@ declare 8 {
const char *file, int line)
}
-# Tcl_CreateFileHandler and Tcl_DeleteFileHandler are only available on unix,
+# Tcl_CreateFileHandler and Tcl_DeleteFileHandler are only available on Unix,
# but they are part of the old generic interface, so we include them here for
# compatibility reasons.
diff --git a/generic/tclAlloc.c b/generic/tclAlloc.c
index 8b1bd74..3c4fac3 100644
--- a/generic/tclAlloc.c
+++ b/generic/tclAlloc.c
@@ -116,7 +116,7 @@ static struct block bigBlocks={ /* Big blocks aren't suballocated. */
/*
* The allocator is protected by a special mutex that must be explicitly
- * initialized. Futhermore, because Tcl_Alloc may be used before anything else
+ * initialized. Furthermore, because Tcl_Alloc may be used before anything else
* in Tcl, we make this module self-initializing after all with the allocInit
* variable.
*/
@@ -510,7 +510,7 @@ TclpFree(
void *
TclpRealloc(
- void *oldPtr, /* Pointer to alloced block. */
+ void *oldPtr, /* Pointer to alloc'ed block. */
size_t numBytes) /* New size of memory. */
{
int i;
@@ -609,7 +609,7 @@ TclpRealloc(
}
/*
- * Ok, we don't have to copy, it fits as-is
+ * No need to copy. It fits as-is.
*/
#ifndef NDEBUG
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 1d78e7e..59ffd18 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -1031,7 +1031,7 @@ Tcl_CreateInterp(void)
/*
* Create the core commands. Do it here, rather than calling
* Tcl_CreateCommand, because it's faster (there's no need to check for a
- * pre-existing command by the same name). If a command has a Tcl_CmdProc
+ * preexisting command by the same name). If a command has a Tcl_CmdProc
* but no Tcl_ObjCmdProc, set the Tcl_ObjCmdProc to
* TclInvokeStringCommand. This is an object-based wrapper function that
* extracts strings, calls the string function, and creates an object for
@@ -2209,15 +2209,15 @@ Tcl_HideCommand(
}
/*
- * NB: This code is currently 'like' a rename to a specialy set apart name
+ * NB: This code is currently 'like' a rename to a special separate name
* table. Changes here and in TclRenameCommand must be kept in synch until
* the common parts are actually factorized out.
*/
/*
* Remove the hash entry for the command from the interpreter command
- * table. This is like deleting the command, so bump its command epoch;
- * this invalidates any cached references that point to the command.
+ * table. This is like deleting the command, so bump its command epoch
+ * to invalidate any cached references that point to the command.
*/
if (cmdPtr->hPtr != NULL) {
@@ -2338,7 +2338,7 @@ Tcl_ExposeCommand(
if (cmdPtr->nsPtr != iPtr->globalNsPtr) {
/*
- * This case is theoritically impossible, we might rather Tcl_Panic
+ * This case is theoretically impossible, we might rather Tcl_Panic
* than 'nicely' erroring out ?
*/
@@ -2444,7 +2444,7 @@ Tcl_ExposeCommand(
* In the future, when cmdName is seen as the name of a command by
* Tcl_Eval, proc will be called. To support the bytecode interpreter,
* the command is created with a wrapper Tcl_ObjCmdProc
- * (TclInvokeStringCommand) that eventially calls proc. When the command
+ * (TclInvokeStringCommand) that eventually calls proc. When the command
* is deleted from the table, deleteProc will be called. See the manual
* entry for details on the calling sequence.
*
@@ -3931,7 +3931,7 @@ CallCommandTraces(
* The value given for the code argument.
*
* Side effects:
- * Transfers a message from the cancelation message to the interpreter.
+ * Transfers a message from the cancellation message to the interpreter.
*
*----------------------------------------------------------------------
*/
@@ -4854,7 +4854,7 @@ TEOV_NotFound(
/*
* Get the list of words for the unknown handler and allocate enough space
- * to hold both the handler prefix and all words of the command invokation
+ * to hold both the handler prefix and all words of the command invocation
* itself.
*/
@@ -5149,7 +5149,7 @@ TclEvalEx(
* TclSubstTokens(), to properly handle
* [...]-nested commands. The 'outerScript'
* refers to the most-outer script containing
- * the embedded command, which is refered to
+ * the embedded command, which is referred to
* by 'script'. The 'clNextOuter' refers to
* the current entry in the table of
* continuation lines in this "main script",
@@ -5715,8 +5715,8 @@ TclArgumentEnter(
/*
* Ignore argument words without line information (= dynamic). If they
* are variables they may have location information associated with
- * that, either through globally recorded 'set' invokations, or
- * literals in bytecode. Eitehr way there is no need to record
+ * that, either through globally recorded 'set' invocations, or
+ * literals in bytecode. Either way there is no need to record
* something here.
*/
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 1083533..70ea1c2 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -26,7 +26,7 @@
#define BINARY_NOCOUNT ((size_t)-2) /* No count was specified in format. */
/*
- * The following flags may be ORed together and returned by GetFormatSpec
+ * The following flags may be OR'ed together and returned by GetFormatSpec
*/
#define BINARY_SIGNED 0 /* Field to be read as signed data */
@@ -37,7 +37,7 @@
* placed in the object cache by 'binary scan' before it bails out and
* switches back to Plan A (creating a new object for each value.)
* Theoretically, it would be possible to keep the cache about for the values
- * that are already in it, but that makes the code slower in practise when
+ * that are already in it, but that makes the code slower in practice when
* overflow happens, and makes little odds the rest of the time (as measured
* on my machine.) It is also slower (on the sample I tried at least) to grow
* the cache to hold all items we might want to put in it; presumably the
@@ -378,6 +378,7 @@ Tcl_GetBytesFromObj(
return baPtr->bytes;
}
+#if !defined(TCL_NO_DEPRECATED)
unsigned char *
TclGetBytesFromObj(
Tcl_Interp *interp, /* For error reporting */
@@ -405,6 +406,7 @@ TclGetBytesFromObj(
}
return bytes;
}
+#endif
/*
*----------------------------------------------------------------------
@@ -1047,7 +1049,7 @@ BinaryFormatCmd(
}
/*
- * Prepare the result object by preallocating the caclulated number of
+ * Prepare the result object by preallocating the calculated number of
* bytes and filling with nulls.
*/
@@ -1808,7 +1810,7 @@ GetFormatSpec(
*
* This routine determines, if bytes of a number need to be re-ordered,
* and returns a numeric code indicating the re-ordering to be done.
- * This depends on the endiannes of the machine and the desired format.
+ * This depends on the endianness of the machine and the desired format.
* It is in effect a table (whose contents depend on the endianness of
* the system) describing whether a value needs reversing or not. Anyone
* porting the code to a big-endian platform should take care to make
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index 92014bd..9717236 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -65,7 +65,7 @@ typedef struct {
int sortMode; /* The sort mode. One of SORTMODE_* values
* defined below. */
Tcl_Obj *compareCmdPtr; /* The Tcl comparison command when sortMode is
- * SORTMODE_COMMAND. Pre-initialized to hold
+ * SORTMODE_COMMAND. Preinitialized to hold
* base of command. */
int *indexv; /* If the -index option was specified, this
* holds an encoding of the indexes contained
@@ -4894,7 +4894,7 @@ Tcl_LsortObjCmd(
}
/*
- * Merge this element in the pre-existing sublists (and merge together
+ * Merge this element in the preexisting sublists (and merge together
* sublists when we have two of the same size).
*/
@@ -5212,7 +5212,7 @@ MergeLists(
* ordering between two elements.
*
* Results:
- * A negative results means the the first element comes before the
+ * A negative results means the first element comes before the
* second, and a positive results means that the second element should
* come first. A result of zero means the two elements are equal and it
* doesn't matter which comes first.
@@ -5414,7 +5414,7 @@ DictionaryCompare(
/*
* Convert both chars to lower for the comparison, because
- * dictionary sorts are case insensitve. Covert to lower, not
+ * dictionary sorts are case-insensitive. Covert to lower, not
* upper, so chars between Z and a will sort before A (where most
* other interesting punctuations occur).
*/
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index 77c8cb4..a4316b4 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -427,7 +427,7 @@ Tcl_RegexpObjCmd(
* match. We always increment the offset by at least one to prevent
* endless looping (as in the case: regexp -all {a*} a). Otherwise,
* when we match the NULL string at the end of the input string, we
- * will loop indefinately (because the length of the match is 0, so
+ * will loop indefinitely (because the length of the match is 0, so
* offset never changes).
*/
@@ -1239,7 +1239,7 @@ Tcl_SplitObjCmd(
/*
* Handle the special case of splitting on a single character. This is
- * only true for the one-char ASCII case, as one unicode char is > 1
+ * only true for the one-char ASCII case, as one Unicode char is > 1
* byte in length.
*/
@@ -1589,7 +1589,7 @@ StringIsCmd(
/*
* We get the objPtr so that we can short-cut for some classes by checking
* the object type (int and double), but we need the string otherwise,
- * because we don't want any conversion of type occuring (as, for example,
+ * because we don't want any conversion of type occurring (as, for example,
* Tcl_Get*FromObj would do).
*/
@@ -2129,7 +2129,7 @@ StringMapCmd(
int *u2lc = 0;
/*
- * Precompute pointers to the unicode string and length. This saves us
+ * Precompute pointers to the Unicode string and length. This saves us
* repeated function calls later, significantly speeding up the
* algorithm. We only need the lowercase first char in the nocase
* case.
@@ -2178,7 +2178,7 @@ StringMapCmd(
ustring1 = p - 1;
/*
- * Append the map value to the unicode string.
+ * Append the map value to the Unicode string.
*/
Tcl_AppendUnicodeToObj(resultPtr,
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 3a61a94..000921b 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -230,7 +230,7 @@ TclCompileAppendCmd(
*
* TclCompileArray*Cmd --
*
- * Functions called to compile "array" sucommands.
+ * Functions called to compile "array" subcommands.
*
* Results:
* All return TCL_OK for a successful compile, and TCL_ERROR to defer
@@ -635,7 +635,7 @@ TclCompileCatchCmd(
* catch range so that errors in the substitution are not caught.
* [Bug 219184]
* The reason for duplicating the script is that EVAL_STK would otherwise
- * begin by undeflowing the stack below the mark set by BEGIN_CATCH4.
+ * begin by underflowing the stack below the mark set by BEGIN_CATCH4.
*/
range = TclCreateExceptRange(CATCH_EXCEPTION_RANGE, envPtr);
@@ -983,7 +983,7 @@ TclCompileContinueCmd(
*
* TclCompileDict*Cmd --
*
- * Functions called to compile "dict" sucommands.
+ * Functions called to compile "dict" subcommands.
*
* Results:
* All return TCL_OK for a successful compile, and TCL_ERROR to defer
@@ -1690,7 +1690,7 @@ CompileDictEachCmd(
/*
* Error handler "finally" clause, which force-terminates the iteration
- * and rethrows the error.
+ * and re-throws the error.
*/
TclAdjustStackDepth(-1, envPtr);
@@ -1862,7 +1862,7 @@ TclCompileDictUpdateCmd(
/*
* Termination code for non-ok returns: stash the result and return
* options in the stack, bring up the key list, finish the update code,
- * and finally return with the catched return data
+ * and finally return with the caught return data
*/
ExceptionRangeTarget(envPtr, range, catchOffset);
@@ -1908,7 +1908,7 @@ TclCompileDictAppendCmd(
/*
* There must be at least two argument after the command. And we impose an
- * (arbirary) safe limit; anyone exceeding it should stop worrying about
+ * (arbitrary) safe limit; anyone exceeding it should stop worrying about
* speed quite so much. ;-)
*/
diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c
index c86d369..ea9e063 100644
--- a/generic/tclCompCmdsGR.c
+++ b/generic/tclCompCmdsGR.c
@@ -416,7 +416,7 @@ TclCompileIfCmd(
if (TclFixupForwardJumpToHere(envPtr,
jumpEndFixupArray.fixup + jumpIndex, 127)) {
/*
- * Adjust the immediately preceeding "ifFalse" jump. We moved it's
+ * Adjust the immediately preceding "ifFalse" jump. We moved it's
* target (just after this jump) down three bytes.
*/
@@ -619,8 +619,8 @@ TclCompileInfoCommandsCmd(
Tcl_DecrRefCount(objPtr);
/*
- * Confirmed as a literal that will not frighten the horses. Compile. Note
- * that the result needs to be list-ified.
+ * Confirmed as a literal that will not frighten the horses. Compile.
+ * The result must be made into a list.
*/
/* TODO: Just push the known value */
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index 47999d9..6b35f19 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -2382,7 +2382,7 @@ IssueSwitchJumpTable(
* Compile the switch by using a jump table, which is basically a
* hashtable that maps from literal values to match against to the offset
* (relative to the INST_JUMP_TABLE instruction) to jump to. The jump
- * table itself is independent of any invokation of the bytecode, and as
+ * table itself is independent of any invocation of the bytecode, and as
* such is stored in an auxData block.
*
* Start by allocating the jump table itself, plus some workspace.
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c
index c503304..61c68b4 100644
--- a/generic/tclCompExpr.c
+++ b/generic/tclCompExpr.c
@@ -96,7 +96,7 @@ enum OperandTypes {
*
* The lexeme field is filled in with the lexeme of the operator that is
* returned by the ParseLexeme() routine. Only lexemes for unary and binary
- * operators get stored in an OpNode. Other lexmes get different treatement.
+ * operators get stored in an OpNode. Other lexmes get different treatment.
*
* The precedence field provides a place to store the precedence of the
* operator, so it need not be looked up again and again.
@@ -157,7 +157,7 @@ enum Marks {
* BINARY_PLUS according to context. */
#define MINUS 2 /* Ambiguous. Resolves to UNARY_MINUS or
* BINARY_MINUS according to context. */
-#define BAREWORD 3 /* Ambigous. Resolves to BOOLEAN or to
+#define BAREWORD 3 /* Ambiguous. Resolves to BOOLEAN or to
* FUNCTION or a parse error according to
* context and value. */
#define INCOMPLETE 4 /* A parse error. Used only when the single
@@ -576,7 +576,7 @@ ParseExpr(
* we build the parse tree. */
unsigned int nodesAvailable = 64; /* Initial size of the storage array. This
* value establishes a minimum tree memory
- * cost of only about 1 kibyte, and is large
+ * cost of only about 1 kilobyte, and is large
* enough for most expressions to parse with
* no need for array growth and
* reallocation. */
@@ -1912,7 +1912,7 @@ Tcl_ParseExpr(
* Returns the number of bytes scanned to produce the lexeme.
*
* Side effects:
- * Code identifying lexeme parsed is writen to *lexemePtr.
+ * Code identifying lexeme parsed is written to *lexemePtr.
*
*----------------------------------------------------------------------
*/
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index be308e3..f60000d 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -2037,7 +2037,7 @@ CompileCommandTokens(
assert ((int)parsePtr->numWords > 0);
- /* Pre-Compile */
+ /* Precompile */
TclNewObj(cmdObj);
envPtr->numCommands++;
@@ -2409,9 +2409,9 @@ TclCompileTokens(
int count = count1;
/*
- * if this is actually a literal, handle continuation lines by
+ * If this is actually a literal, handle continuation lines by
* preallocating a small table to store the locations of any continuation
- * lines we find in this literal. The table is extended if needed.
+ * lines found in this literal. The table is extended if needed.
*
* Note: In contrast with the analagous code in 'TclSubstTokens()' the
* 'adjust' variable seems unneeded here. The code which merges
diff --git a/generic/tclCompile.h b/generic/tclCompile.h
index 0ad7b58..eabc689 100644
--- a/generic/tclCompile.h
+++ b/generic/tclCompile.h
@@ -444,7 +444,7 @@ typedef struct ByteCode {
* active. This structure can be freed when
* refCount becomes zero. */
unsigned int flags; /* flags describing state for the codebyte.
- * this variable holds ORed values from the
+ * this variable holds OR'ed values from the
* TCL_BYTECODE_ masks defined above */
const char *source; /* The source string from which this ByteCode
* was compiled. Note that this pointer is not
diff --git a/generic/tclConfig.c b/generic/tclConfig.c
index 17490bd..be692b4 100644
--- a/generic/tclConfig.c
+++ b/generic/tclConfig.c
@@ -181,7 +181,7 @@ Tcl_RegisterConfig(
* configuration information embedded into a library.
*
* Results:
- * A standard tcl result.
+ * A standard Tcl result.
*
* Side effects:
* See the manual for what this command does.
diff --git a/generic/tclDate.c b/generic/tclDate.c
index fa6e60d..52bdf4c 100644
--- a/generic/tclDate.c
+++ b/generic/tclDate.c
@@ -2425,7 +2425,7 @@ static const TABLE TimezoneTable[] = {
{ "ist", tZONE, -HOUR(11/2) }, /* Indian Standard */
{ "zp6", tZONE, -HOUR( 6) }, /* USSR Zone 5 */
#if 0
- /* For completeness. NST is also Newfoundland Stanard, nad SST is
+ /* For completeness. NST is also Newfoundland Standard, and SST is
* also Swedish Summer. */
{ "nst", tZONE, -HOUR(13/2) }, /* North Sumatra */
{ "sst", tZONE, -HOUR( 7) }, /* South Sumatra, USSR Zone 6 */
diff --git a/generic/tclDecls.h b/generic/tclDecls.h
index ec9a49a..4cc95c8 100644
--- a/generic/tclDecls.h
+++ b/generic/tclDecls.h
@@ -4020,19 +4020,31 @@ extern const TclStubs *tclStubsPtr;
Tcl_GetStringFromObj(objPtr, (Tcl_Size *)NULL)
#define Tcl_GetUnicode(objPtr) \
Tcl_GetUnicodeFromObj(objPtr, (Tcl_Size *)NULL)
-#undef Tcl_GetBytesFromObj
+#if TCL_MAJOR_VERSION < 9 || !defined(TCL_NO_DEPRECATED)
+# undef Tcl_GetBytesFromObj
+# undef Tcl_GetStringFromObj
+# undef Tcl_GetUnicodeFromObj
+#endif
#undef Tcl_GetIndexFromObjStruct
#undef Tcl_GetBooleanFromObj
#undef Tcl_GetBoolean
-#undef Tcl_GetStringFromObj
-#undef Tcl_GetUnicodeFromObj
#undef TclGetByteArrayFromObj
#undef Tcl_GetByteArrayFromObj
#if defined(USE_TCL_STUBS)
-#define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) \
- (sizeof(*(sizePtr)) <= sizeof(int) ? \
- tclStubsPtr->tclGetBytesFromObj(interp, objPtr, (int *)(void *)(sizePtr)) : \
- tclStubsPtr->tcl_GetBytesFromObj(interp, objPtr, (size_t *)(void *)(sizePtr)))
+# if TCL_MAJOR_VERSION < 9 || !defined(TCL_NO_DEPRECATED)
+# define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) \
+ (sizeof(*(sizePtr)) <= sizeof(int) ? \
+ tclStubsPtr->tclGetBytesFromObj(interp, objPtr, (int *)(void *)(sizePtr)) : \
+ tclStubsPtr->tcl_GetBytesFromObj(interp, objPtr, (size_t *)(void *)(sizePtr)))
+# define Tcl_GetStringFromObj(objPtr, sizePtr) \
+ (sizeof(*(sizePtr)) <= sizeof(int) ? \
+ tclStubsPtr->tclGetStringFromObj(objPtr, (int *)(void *)(sizePtr)) : \
+ tclStubsPtr->tcl_GetStringFromObj(objPtr, (size_t *)(void *)(sizePtr)))
+# define Tcl_GetUnicodeFromObj(objPtr, sizePtr) \
+ (sizeof(*(sizePtr)) <= sizeof(int) ? \
+ tclStubsPtr->tclGetUnicodeFromObj(objPtr, (int *)(void *)(sizePtr)) : \
+ tclStubsPtr->tcl_GetUnicodeFromObj(objPtr, (size_t *)(void *)(sizePtr)))
+# endif
#define Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags, indexPtr) \
(tclStubsPtr->tcl_GetIndexFromObjStruct((interp), (objPtr), (tablePtr), (offset), (msg), \
(flags)|(int)(sizeof(*(indexPtr))<<1), (indexPtr)))
@@ -4042,10 +4054,6 @@ extern const TclStubs *tclStubsPtr;
#define Tcl_GetBoolean(interp, src, boolPtr) \
((sizeof(*(boolPtr)) == sizeof(int) && (TCL_MAJOR_VERSION == 8)) ? tclStubsPtr->tcl_GetBoolean(interp, src, (int *)(boolPtr)) : \
Tcl_GetBool(interp, src, (TCL_NULL_OK-2)&(int)sizeof((*(boolPtr))), (char *)(boolPtr)))
-#define Tcl_GetStringFromObj(objPtr, sizePtr) \
- (sizeof(*(sizePtr)) <= sizeof(int) ? \
- tclStubsPtr->tclGetStringFromObj(objPtr, (int *)(void *)(sizePtr)) : \
- tclStubsPtr->tcl_GetStringFromObj(objPtr, (size_t *)(void *)(sizePtr)))
#if TCL_MAJOR_VERSION > 8
#define Tcl_GetByteArrayFromObj(objPtr, sizePtr) \
(sizeof(*(sizePtr)) <= sizeof(int) ? \
@@ -4057,10 +4065,6 @@ extern const TclStubs *tclStubsPtr;
tclStubsPtr->tclGetByteArrayFromObj(objPtr, (int *)(void *)(sizePtr)) : \
tclStubsPtr->tcl_GetByteArrayFromObj(objPtr, (size_t *)(void *)(sizePtr)))
#endif
-#define Tcl_GetUnicodeFromObj(objPtr, sizePtr) \
- (sizeof(*(sizePtr)) <= sizeof(int) ? \
- tclStubsPtr->tclGetUnicodeFromObj(objPtr, (int *)(void *)(sizePtr)) : \
- tclStubsPtr->tcl_GetUnicodeFromObj(objPtr, (size_t *)(void *)(sizePtr)))
#else
#define Tcl_GetBytesFromObj(interp, objPtr, sizePtr) \
(sizeof(*(sizePtr)) <= sizeof(int) ? \
@@ -4199,7 +4203,7 @@ extern const TclStubs *tclStubsPtr;
# define Tcl_WCharLen (sizeof(wchar_t) != sizeof(short) \
? (Tcl_Size (*)(wchar_t *))Tcl_UniCharLen \
: (Tcl_Size (*)(wchar_t *))Tcl_Char16Len)
-#if !defined(BUILD_tcl)
+#if !defined(BUILD_tcl) && !defined(TCL_NO_DEPRECATED)
# define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) == sizeof(int) \
? TclListObjGetElements((interp), (listPtr), (int *)(void *)(objcPtr), (objvPtr)) \
: (Tcl_ListObjGetElements)((interp), (listPtr), (size_t *)(void *)(objcPtr), (objvPtr)))
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index 5c18c8a..ab921c1 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -769,7 +769,7 @@ GetDictFromObj(
* the chain fields of the dictionaries (for easy invalidation of string
* representations using InvalidateDictChain). If the flags argument has
* the DICT_PATH_CREATE bits set (and not the DICT_PATH_EXISTS bit),
- * non-existant keys will be inserted with a value of an empty
+ * non-extant keys will be inserted with a value of an empty
* dictionary, resulting in the path being built.
*
*----------------------------------------------------------------------
@@ -862,7 +862,7 @@ TclTraceDictPath(
*
* InvalidateDictChain --
*
- * Go through a dictionary chain (built by an updating invokation of
+ * Go through a dictionary chain (built by an updating invocation of
* TclTraceDictPath) and invalidate the string representations of all the
* dictionaries on the chain.
*
@@ -1188,7 +1188,7 @@ Tcl_DictObjNext(
ChainEntry *cPtr;
/*
- * If the searh is done; we do no work.
+ * If the search is done; we do no work.
*/
if (!searchPtr->epoch) {
@@ -3674,9 +3674,9 @@ TclDictWithFinish(
if (pathc > 0) {
/*
* Want to get to the dictionary which we will update; need to do
- * prepare-for-update de-sharing along the path *but* avoid generating
- * an error on a non-existant path (we'll treat that the same as a
- * non-existant variable. Luckily, the de-sharing operation isn't
+ * prepare-for-update unsharing along the path *but* avoid generating
+ * an error on a non-extant path (we'll treat that the same as a
+ * non-extant variable. Luckily, the unsharing operation isn't
* deeply damaging if we don't go on to update; it's just less than
* perfectly efficient (but no memory should be leaked).
*/
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index e9b0cce..6feb686 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -3479,7 +3479,7 @@ TableToUtfProc(
}
/*
- * Special case for 1-byte utf chars for speed.
+ * Special case for 1-byte Utf chars for speed.
*/
if ((unsigned)ch - 1 < 0x7F) {
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index 98f4ae0..9088854 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c