summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclIndexObj.c77
-rw-r--r--win/makefile.vc16
-rw-r--r--win/rules.vc9
3 files changed, 53 insertions, 49 deletions
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c
index efa29eb..01d3c94 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -21,7 +21,7 @@
static int GetIndexFromObjList(Tcl_Interp *interp,
Tcl_Obj *objPtr, Tcl_Obj *tableObjPtr,
- const char *msg, int flags, int *indexPtr);
+ const char *msg, int flags, Tcl_Size *indexPtr);
static void UpdateStringOfIndex(Tcl_Obj *objPtr);
static void DupIndex(Tcl_Obj *srcPtr, Tcl_Obj *dupPtr);
static void FreeIndex(Tcl_Obj *objPtr);
@@ -172,7 +172,7 @@ GetIndexFromObjList(
const char *msg, /* Identifying word to use in error
* messages. */
int flags, /* 0 or TCL_EXACT */
- int *indexPtr) /* Place to store resulting integer index. */
+ Tcl_Size *indexPtr) /* Place to store resulting index. */
{
Tcl_Size objc, t;
@@ -206,7 +206,7 @@ GetIndexFromObjList(
return TCL_OK;
}
- tablePtr[t] = Tcl_GetString(objv[t]);
+ tablePtr[t] = TclGetString(objv[t]);
}
tablePtr[objc] = NULL;
@@ -255,7 +255,7 @@ Tcl_GetIndexFromObjStruct(
* offset, the third plus the offset again,
* etc. The last entry must be NULL and there
* must not be duplicate entries. */
- int offset, /* The number of bytes between entries */
+ Tcl_Size offset, /* The number of bytes between entries */
const char *msg, /* Identifying word to use in error
* messages. */
int flags, /* 0, TCL_EXACT, TCL_NULL_OK or TCL_INDEX_TEMP_TABLE */
@@ -270,8 +270,8 @@ Tcl_GetIndexFromObjStruct(
const Tcl_ObjInternalRep *irPtr;
/* Protect against invalid values, like -1 or 0. */
- if (offset < (int)sizeof(char *)) {
- offset = (int)sizeof(char *);
+ if (offset < (Tcl_Size)sizeof(char *)) {
+ offset = (Tcl_Size)sizeof(char *);
}
/*
* See if there is a valid cached result from a previous lookup.
@@ -399,32 +399,35 @@ Tcl_GetIndexFromObjStruct(
}
Tcl_AppendStringsToObj(resultPtr,
(numAbbrev>1 && !(flags & TCL_EXACT) ? "ambiguous " : "bad "),
- msg, " \"", key, (void *)NULL);
+ msg, " \"", key, (char *)NULL);
if (*entryPtr == NULL) {
- Tcl_AppendStringsToObj(resultPtr, "\": no valid options", (void *)NULL);
+ Tcl_AppendStringsToObj(resultPtr, "\": no valid options", (char *)NULL);
} else {
Tcl_AppendStringsToObj(resultPtr, "\": must be ",
- *entryPtr, (void *)NULL);
+ *entryPtr, (char *)NULL);
entryPtr = NEXT_ENTRY(entryPtr, offset);
while (*entryPtr != NULL) {
if ((*NEXT_ENTRY(entryPtr, offset) == NULL) && !(flags & TCL_NULL_OK)) {
Tcl_AppendStringsToObj(resultPtr, (count > 0 ? "," : ""),
- " or ", *entryPtr, (void *)NULL);
+ " or ", *entryPtr, (char *)NULL);
} else if (**entryPtr) {
- Tcl_AppendStringsToObj(resultPtr, ", ", *entryPtr, (void *)NULL);
+ Tcl_AppendStringsToObj(resultPtr, ", ", *entryPtr, (char *)NULL);
count++;
}
entryPtr = NEXT_ENTRY(entryPtr, offset);
}
if ((flags & TCL_NULL_OK)) {
- Tcl_AppendStringsToObj(resultPtr, ", or \"\"", (void *)NULL);
+ Tcl_AppendStringsToObj(resultPtr, ", or \"\"", (char *)NULL);
}
}
Tcl_SetObjResult(interp, resultPtr);
- Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", msg, key, (void *)NULL);
+ Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "INDEX", msg, key, (char *)NULL);
}
return TCL_ERROR;
}
+/* #define again, needed below */
+#define Tcl_GetIndexFromObjStruct(interp, objPtr, tablePtr, offset, msg, flags, indexPtr) \
+ ((Tcl_GetIndexFromObjStruct)((interp), (objPtr), (tablePtr), (offset), (msg), (flags)|(int)(sizeof(*(indexPtr))<<1), (indexPtr)))
/*
*----------------------------------------------------------------------
@@ -569,8 +572,8 @@ PrefixMatchObjCmd(
int objc, /* Number of arguments. */
Tcl_Obj *const objv[]) /* Argument objects. */
{
- int flags = 0, result, index, i;
- Tcl_Size dummyLength, errorLength;
+ int flags = 0, result, index;
+ Tcl_Size errorLength, i;
Tcl_Obj *errorPtr = NULL;
const char *message = "option";
Tcl_Obj *tablePtr, *objPtr, *resultPtr;
@@ -587,8 +590,8 @@ PrefixMatchObjCmd(
}
for (i = 1; i < (objc - 2); i++) {
- if (Tcl_GetIndexFromObj(interp, objv[i], matchOptions, "option", 0,
- &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(interp, objv[i], matchOptions,
+ sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
switch ((enum matchOptionsEnum) index) {
@@ -599,17 +602,17 @@ PrefixMatchObjCmd(
if (i > objc-4) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"missing value for -message", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NOARG", (void *)NULL);
+ Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NOARG", (char *)NULL);
return TCL_ERROR;
}
i++;
- message = Tcl_GetString(objv[i]);
+ message = TclGetString(objv[i]);
break;
case PRFMATCH_ERROR:
if (i > objc-4) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"missing value for -error", TCL_INDEX_NONE));
- Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NOARG", (void *)NULL);
+ Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NOARG", (char *)NULL);
return TCL_ERROR;
}
i++;
@@ -621,7 +624,7 @@ PrefixMatchObjCmd(
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"error options must have an even number of elements",
-1));
- Tcl_SetErrorCode(interp, "TCL", "VALUE", "DICTIONARY", (void *)NULL);
+ Tcl_SetErrorCode(interp, "TCL", "VALUE", "DICTIONARY", (char *)NULL);
return TCL_ERROR;
}
errorPtr = objv[i];
@@ -637,13 +640,13 @@ PrefixMatchObjCmd(
* error case regardless of level.
*/
- result = TclListObjLengthM(interp, tablePtr, &dummyLength);
+ result = TclListObjLengthM(interp, tablePtr, &i);
if (result != TCL_OK) {
return result;
}
result = GetIndexFromObjList(interp, objPtr, tablePtr, message, flags,
- &index);
+ &i);
if (result != TCL_OK) {
if (errorPtr != NULL && errorLength == 0) {
Tcl_ResetResult(interp);
@@ -662,7 +665,7 @@ PrefixMatchObjCmd(
return Tcl_SetReturnOptions(interp, errorPtr);
}
- result = Tcl_ListObjIndex(interp, tablePtr, index, &resultPtr);
+ result = Tcl_ListObjIndex(interp, tablePtr, i, &resultPtr);
if (result != TCL_OK) {
return result;
}
@@ -980,7 +983,7 @@ Tcl_WrongNumArgs(
*/
if (i + 1 < toPrint || objc!=0 || message!=NULL) {
- Tcl_AppendStringsToObj(objPtr, " ", (void *)NULL);
+ Tcl_AppendStringsToObj(objPtr, " ", (char *)NULL);
}
}
}
@@ -1002,7 +1005,7 @@ Tcl_WrongNumArgs(
if ((irPtr = TclFetchInternalRep(objv[i], &tclIndexType))) {
IndexRep *indexRep = (IndexRep *)irPtr->twoPtrValue.ptr1;
- Tcl_AppendStringsToObj(objPtr, EXPAND_OF(indexRep), (void *)NULL);
+ Tcl_AppendStringsToObj(objPtr, EXPAND_OF(indexRep), (char *)NULL);
} else {
/*
* Quote the argument if it contains spaces (Bug 942757).
@@ -1032,7 +1035,7 @@ Tcl_WrongNumArgs(
*/
if (i + 1 < objc || message!=NULL) {
- Tcl_AppendStringsToObj(objPtr, " ", (void *)NULL);
+ Tcl_AppendStringsToObj(objPtr, " ", (char *)NULL);
}
}
@@ -1043,10 +1046,10 @@ Tcl_WrongNumArgs(
*/
if (message != NULL) {
- Tcl_AppendStringsToObj(objPtr, message, (void *)NULL);
+ Tcl_AppendStringsToObj(objPtr, message, (char *)NULL);
}
- Tcl_AppendStringsToObj(objPtr, "\"", (void *)NULL);
- Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (void *)NULL);
+ Tcl_AppendStringsToObj(objPtr, "\"", (char *)NULL);
+ Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", (char *)NULL);
Tcl_SetObjResult(interp, objPtr);
#undef MAY_QUOTE_WORD
#undef AFTER_FIRST_WORD
@@ -1081,7 +1084,7 @@ Tcl_ParseArgsObjv(
Tcl_Interp *interp, /* Place to store error message. */
const Tcl_ArgvInfo *argTable,
/* Array of option descriptions. */
- int *objcPtr, /* Number of arguments in objv. Modified to
+ Tcl_Size *objcPtr, /* Number of arguments in objv. Modified to
* hold # args left in objv at end. */
Tcl_Obj *const *objv, /* Array of arguments to be parsed. */
Tcl_Obj ***remObjv) /* Pointer to array of arguments that were not
@@ -1206,7 +1209,7 @@ Tcl_ParseArgsObjv(
(int *) infoPtr->dstPtr) == TCL_ERROR) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"expected integer argument for \"%s\" but got \"%s\"",
- infoPtr->keyStr, Tcl_GetString(objv[srcIndex])));
+ infoPtr->keyStr, TclGetString(objv[srcIndex])));
goto error;
}
srcIndex++;
@@ -1217,7 +1220,7 @@ Tcl_ParseArgsObjv(
goto missingArg;
}
*((const char **) infoPtr->dstPtr) =
- Tcl_GetString(objv[srcIndex]);
+ TclGetString(objv[srcIndex]);
srcIndex++;
objc--;
break;
@@ -1239,7 +1242,7 @@ Tcl_ParseArgsObjv(
(double *) infoPtr->dstPtr) == TCL_ERROR) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"expected floating-point argument for \"%s\" but got \"%s\"",
- infoPtr->keyStr, Tcl_GetString(objv[srcIndex])));
+ infoPtr->keyStr, TclGetString(objv[srcIndex])));
goto error;
}
srcIndex++;
@@ -1449,8 +1452,8 @@ TclGetCompletionCodeFromObj(
&& TclGetIntFromObj(NULL, value, codePtr) == TCL_OK) {
return TCL_OK;
}
- if (Tcl_GetIndexFromObj(NULL, value, returnCodes, NULL, TCL_EXACT,
- codePtr) == TCL_OK) {
+ if (Tcl_GetIndexFromObjStruct(NULL, value, returnCodes,
+ sizeof(char *), NULL, TCL_EXACT, codePtr) == TCL_OK) {
return TCL_OK;
}
@@ -1463,7 +1466,7 @@ TclGetCompletionCodeFromObj(
"bad completion code \"%s\": must be"
" ok, error, return, break, continue, or an integer",
TclGetString(value)));
- Tcl_SetErrorCode(interp, "TCL", "RESULT", "ILLEGAL_CODE", (void *)NULL);
+ Tcl_SetErrorCode(interp, "TCL", "RESULT", "ILLEGAL_CODE", (char *)NULL);
}
return TCL_ERROR;
}
diff --git a/win/makefile.vc b/win/makefile.vc
index 232bd4f..3f6a7e5 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -17,13 +17,13 @@
# nmake [-nologo] -f makefile.vc [TARGET|MACRODEF [TARGET|MACRODEF] [...]]
#
# For MACRODEF, see TIP 477 (https://core.tcl-lang.org/tips/doc/main/tip/477.md)
-# or examine Sections 6-8 in rules.vc.
+# or examine Sections 7-9 in rules.vc.
#
-# Possible values of TARGET are:
+# Possible values for TARGET are:
# release -- Builds everything that ships with a release. (default)
# core -- Builds the core [tclXX.(dll|lib)]
# shell -- Builds tclsh and the core.
-# dlls -- Just builds the windows extensions
+# dlls -- Just builds the windows extensions.
# all -- Builds everything.
# test -- Builds and runs the test suite.
# tcltest -- Just builds the test shell.
@@ -47,9 +47,9 @@
# Visual Studio/Windows SDK for the appropriate target architecture.
#
# NOTE: For older (Visual C++ 6 or the 2003 SDK), to use the Platform
-# SDK (not expressly needed), run setenv.bat after
-# vcvars32.bat according to the instructions for it. This can also
-# turn on the 64-bit compiler, if your SDK has it.
+# SDK (not expressly needed), run setenv.bat after vcvars32.bat
+# according to the instructions for it. This can also turn on the
+# 64-bit compiler, if your SDK has it.
#
# Basic macros and options usable on the commandline (see rules.vc for more info):
# OPTS=msvcrt,noembed,nothreads,pdbs,profile,static,symbols,thrdalloc,time64bit,unchecked,none
@@ -136,10 +136,10 @@ PROJECT = tcl
# rules.vc file will set up "all" as the target.
DEFAULT_BUILD_TARGET = release
-# We want to use our own resource file, not the standard template one.
+# We have a custom resource file
RCFILE = tcl.rc
-# The rules.vc file does most of the hard work in terms of defining
+# The rules.vc file does much of the hard work in terms of defining
# the build configuration, macros, output directories etc.
!include "rules.vc"
diff --git a/win/rules.vc b/win/rules.vc
index 337eec9..143ea9e 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -79,10 +79,11 @@ NEED_TK_SOURCE = 0
# 3. Determine the compiler and linker versions
# 4. Build the nmakehlp helper application
# 5. Determine the supported compiler options and features
-# 6. Parse the OPTS macro value for user-specified build configuration
-# 7. Parse the STATS macro value for statistics instrumentation
-# 8. Parse the CHECKS macro for additional compilation checks
-# 9. Extract Tcl, and possibly Tk, version numbers from the headers
+# 6. Extract Tcl, Tk, and possibly extensions, version numbers from the
+# headers
+# 7. Parse the OPTS macro value for user-specified build configuration
+# 8. Parse the STATS macro value for statistics instrumentation
+# 9. Parse the CHECKS macro for additional compilation checks
# 10. Based on this selected configuration, construct the output
# directory and file paths
# 11. Construct the paths where the package is to be installed