Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | make some more internal tables CONST fix compilation with -DNO_CONST |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | core-8-4-branch |
Files: | files | file ages | folders |
SHA1: |
8e001f840260d0833abef7763606b84b |
User & Date: | jan.nijtmans 2012-04-18 21:38:50 |
Context
2012-04-23
| ||
12:30 | make some more internal tables const On cygwin, install dll's in /usr/bin, not in /usr/lib check-in: 6de689d796 user: jan.nijtmans tags: core-8-4-branch | |
2012-04-18
| ||
22:05 | make some more internal tables const a few CONST -> const changes check-in: 24c0f42d9a user: jan.nijtmans tags: core-8-5-branch | |
21:38 | make some more internal tables CONST fix compilation with -DNO_CONST check-in: 8e001f8402 user: jan.nijtmans tags: core-8-4-branch | |
2012-04-16
| ||
06:05 |
* doc/FileSystem.3 (Tcl_FSOpenFileChannelProc): [Bug 3518244]: Fixed documentation of this filesys...check-in: d074aef7f9 user: dkf tags: core-8-4-branch | |
Changes
Changes to generic/regerror.c.
︙ | ︙ | |||
28 29 30 31 32 33 34 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #include "regguts.h" /* unknown-error explanation */ | | | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #include "regguts.h" /* unknown-error explanation */ static CONST char unk[] = "*** unknown regex error code 0x%x ***"; /* struct to map among codes, code names, and explanations */ static struct rerr { int code; char *name; char *explain; } rerrs[] = { |
︙ | ︙ |
Changes to generic/tclBasic.c.
︙ | ︙ | |||
60 61 62 63 64 65 66 | extern TclStubs tclStubs; /* * The following structure defines the commands in the Tcl core. */ typedef struct { | | | | 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 | extern TclStubs tclStubs; /* * The following structure defines the commands in the Tcl core. */ typedef struct { CONST char *name; /* Name of object-based command. */ Tcl_CmdProc *proc; /* String-based procedure for command. */ Tcl_ObjCmdProc *objProc; /* Object-based procedure for command. */ CompileProc *compileProc; /* Procedure called to compile command. */ int isSafe; /* If non-zero, command will be present * in safe interpreter. Otherwise it will * be hidden. */ } CmdInfo; /* * The built-in commands, and the procedures that implement them: */ static CONST CmdInfo builtInCmds[] = { /* * Commands in the generic core. Note that at least one of the proc or * objProc members should be non-NULL. This avoids infinitely recursive * calls between TclInvokeObjectCommand and TclInvokeStringCommand if a * command name is computed at runtime and results in the name of a * compiled command. */ |
︙ | ︙ | |||
300 301 302 303 304 305 306 | { Interp *iPtr; Tcl_Interp *interp; Command *cmdPtr; BuiltinFunc *builtinFuncPtr; MathFunc *mathFuncPtr; Tcl_HashEntry *hPtr; | | | 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | { Interp *iPtr; Tcl_Interp *interp; Command *cmdPtr; BuiltinFunc *builtinFuncPtr; MathFunc *mathFuncPtr; Tcl_HashEntry *hPtr; CONST CmdInfo *cmdInfoPtr; int i; union { char c[sizeof(short)]; short s; } order; #ifdef TCL_COMPILE_STATS ByteCodeStats *statsPtr; |
︙ | ︙ | |||
660 661 662 663 664 665 666 | *---------------------------------------------------------------------- */ int TclHideUnsafeCommands(interp) Tcl_Interp *interp; /* Hide commands in this interpreter. */ { | | | 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 | *---------------------------------------------------------------------- */ int TclHideUnsafeCommands(interp) Tcl_Interp *interp; /* Hide commands in this interpreter. */ { register CONST CmdInfo *cmdInfoPtr; if (interp == (Tcl_Interp *) NULL) { return TCL_ERROR; } for (cmdInfoPtr = builtInCmds; cmdInfoPtr->name != NULL; cmdInfoPtr++) { if (!cmdInfoPtr->isSafe) { Tcl_HideCommand(interp, cmdInfoPtr->name, cmdInfoPtr->name); |
︙ | ︙ |
Changes to generic/tclBinary.c.
︙ | ︙ | |||
1156 1157 1158 1159 1160 1161 1162 | break; } case 'h': case 'H': { char *dest; unsigned char *src; int i; | | | 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 | break; } case 'h': case 'H': { char *dest; unsigned char *src; int i; static CONST char hexdigit[] = "0123456789abcdef"; if (arg >= objc) { DeleteScanNumberCache(numberCachePtr); goto badIndex; } if (count == BINARY_ALL) { count = (length - offset)*2; |
︙ | ︙ |
Changes to generic/tclEncoding.c.
︙ | ︙ | |||
1458 1459 1460 1461 1462 1463 1464 | Tcl_EncodingType encType; /* * Speed over memory. Use a full 256 character table to decode hex * sequences in the encoding files. */ | | | 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 | Tcl_EncodingType encType; /* * Speed over memory. Use a full 256 character table to decode hex * sequences in the encoding files. */ static CONST char staticHex[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0 ... 15 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 16 ... 31 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 32 ... 47 */ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, /* 48 ... 63 */ 0, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 64 ... 79 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 ... 95 */ 0, 10, 11, 12, 13, 14, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 96 ... 111 */ |
︙ | ︙ |
Changes to generic/tclExecute.c.
︙ | ︙ | |||
83 84 85 86 87 88 89 | /* * Mapping from expression instruction opcodes to strings; used for error * messages. Note that these entries must match the order and number of the * expression opcodes (e.g., INST_LOR) in tclCompile.h. */ | | | | 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 | /* * Mapping from expression instruction opcodes to strings; used for error * messages. Note that these entries must match the order and number of the * expression opcodes (e.g., INST_LOR) in tclCompile.h. */ static CONST char *CONST operatorStrings[] = { "||", "&&", "|", "^", "&", "==", "!=", "<", ">", "<=", ">=", "<<", ">>", "+", "-", "*", "/", "%", "+", "-", "~", "!", "BUILTIN FUNCTION", "FUNCTION", "", "", "", "", "", "", "", "", "eq", "ne", }; /* * Mapping from Tcl result codes to strings; used for error and debugging * messages. */ #ifdef TCL_COMPILE_DEBUG static CONST char *CONST resultStrings[] = { "TCL_OK", "TCL_ERROR", "TCL_RETURN", "TCL_BREAK", "TCL_CONTINUE" }; #endif /* * These are used by evalstats to monitor object usage in Tcl. */ |
︙ | ︙ | |||
393 394 395 396 397 398 399 | static void IllegalExprOperandType _ANSI_ARGS_(( Tcl_Interp *interp, unsigned char *pc, Tcl_Obj *opndPtr)); static void InitByteCodeExecution _ANSI_ARGS_(( Tcl_Interp *interp)); #ifdef TCL_COMPILE_DEBUG static void PrintByteCodeInfo _ANSI_ARGS_((ByteCode *codePtr)); | | | 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 | static void IllegalExprOperandType _ANSI_ARGS_(( Tcl_Interp *interp, unsigned char *pc, Tcl_Obj *opndPtr)); static void InitByteCodeExecution _ANSI_ARGS_(( Tcl_Interp *interp)); #ifdef TCL_COMPILE_DEBUG static void PrintByteCodeInfo _ANSI_ARGS_((ByteCode *codePtr)); static CONST char * StringForResultCode _ANSI_ARGS_((int result)); static void ValidatePcAndStackTop _ANSI_ARGS_(( ByteCode *codePtr, unsigned char *pc, int stackTop, int stackLowerBound)); #endif /* TCL_COMPILE_DEBUG */ static int VerifyExprObjType _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Obj *objPtr)); |
︙ | ︙ | |||
6560 6561 6562 6563 6564 6565 6566 | * * Side effects: * None. * *---------------------------------------------------------------------- */ | | | 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 | * * Side effects: * None. * *---------------------------------------------------------------------- */ static CONST char * StringForResultCode(result) int result; /* The Tcl result code for which to * generate a string. */ { static char buf[TCL_INTEGER_SPACE]; if ((result >= TCL_OK) && (result <= TCL_CONTINUE)) { |
︙ | ︙ |
Changes to generic/tclFileName.c.
︙ | ︙ | |||
2587 2588 2589 2590 2591 2592 2593 | } if (repair >= 0) { Tcl_Obj *paths = Tcl_GetObjResult(interp); int end; Tcl_ListObjLength(NULL, paths, &end); while (repair < end) { | | | 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 | } if (repair >= 0) { Tcl_Obj *paths = Tcl_GetObjResult(interp); int end; Tcl_ListObjLength(NULL, paths, &end); while (repair < end) { CONST char *bytes; int numBytes; Tcl_Obj *fixme, *newObj; Tcl_ListObjIndex(NULL, paths, repair, &fixme); bytes = Tcl_GetStringFromObj(fixme, &numBytes); newObj = Tcl_NewStringObj(bytes+2, numBytes-2); Tcl_ListObjReplace(NULL, paths, repair, 1, 1, &newObj); |
︙ | ︙ |
Changes to generic/tclParseExpr.c.
︙ | ︙ | |||
128 129 130 131 132 133 134 | #define STRNEQ 35 /* * Mapping from lexemes to strings; used for debugging messages. These * entries must match the order and number of the lexeme definitions above. */ | | | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | #define STRNEQ 35 /* * Mapping from lexemes to strings; used for debugging messages. These * entries must match the order and number of the lexeme definitions above. */ static CONST char *CONST lexemeStrings[] = { "LITERAL", "FUNCNAME", "[", "{", "(", ")", "$", "\"", ",", "END", "UNKNOWN", "UNKNOWN_CHAR", "*", "/", "%", "+", "-", "<<", ">>", "<", ">", "<=", ">=", "==", "!=", "&", "^", "|", "&&", "||", "?", ":", "!", "~", "eq", "ne", }; |
︙ | ︙ |
Changes to generic/tclPkg.c.
︙ | ︙ | |||
74 75 76 77 78 79 80 | static int SomeRequirementSatisfied(char *havei, int reqc, Tcl_Obj *CONST reqv[]); static void AddRequirementsToResult(Tcl_Interp* interp, int reqc, Tcl_Obj *CONST reqv[]); static void AddRequirementsToDString(Tcl_DString* dstring, int reqc, Tcl_Obj *CONST reqv[]); static Package * FindPackage(Tcl_Interp *interp, CONST char *name); | | | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | static int SomeRequirementSatisfied(char *havei, int reqc, Tcl_Obj *CONST reqv[]); static void AddRequirementsToResult(Tcl_Interp* interp, int reqc, Tcl_Obj *CONST reqv[]); static void AddRequirementsToDString(Tcl_DString* dstring, int reqc, Tcl_Obj *CONST reqv[]); static Package * FindPackage(Tcl_Interp *interp, CONST char *name); static CONST char * PkgRequireCore(Tcl_Interp *interp, CONST char *name, int reqx, Tcl_Obj *CONST reqv[], ClientData *clientDataPtr); #endif /* * Helper macros. */ |
︙ | ︙ | |||
257 258 259 260 261 262 263 | Package *pkgPtr; PkgAvail *availPtr, *bestPtr; char *script; int code, satisfies, result, pass; Tcl_DString command; #else Tcl_Obj *ov; | | | 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | Package *pkgPtr; PkgAvail *availPtr, *bestPtr; char *script; int code, satisfies, result, pass; Tcl_DString command; #else Tcl_Obj *ov; CONST char *result = NULL; #endif /* * If an attempt is being made to load this into a standalone executable * on a platform where backlinking is not supported then this must be * a shared version of Tcl (Otherwise the load would have failed). * Detect this situation by checking that this library has been correctly |
︙ | ︙ | |||
369 370 371 372 373 374 375 | CONST char *name, /* Name of desired package. */ int reqc, /* Requirements constraining the desired * version. */ Tcl_Obj *CONST reqv[], /* 0 means to use the latest version * available. */ ClientData *clientDataPtr) { | | | | 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 | CONST char *name, /* Name of desired package. */ int reqc, /* Requirements constraining the desired * version. */ Tcl_Obj *CONST reqv[], /* 0 means to use the latest version * available. */ ClientData *clientDataPtr) { CONST char *result = PkgRequireCore(interp, name, reqc, reqv, clientDataPtr); if (result == NULL) { return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewStringObj(result, -1)); return TCL_OK; } static CONST char * PkgRequireCore( Tcl_Interp *interp, /* Interpreter in which package is now * available. */ CONST char *name, /* Name of desired package. */ int reqc, /* Requirements constraining the desired * version. */ Tcl_Obj *CONST reqv[], /* 0 means to use the latest version |
︙ | ︙ | |||
1073 1074 1075 1076 1077 1078 1079 | if ((pkgPtr->version != NULL) || (pkgPtr->availPtr != NULL)) { Tcl_AppendElement(interp, Tcl_GetHashKey(tablePtr, hPtr)); } } break; } case PKG_PRESENT: { | | | 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 | if ((pkgPtr->version != NULL) || (pkgPtr->availPtr != NULL)) { Tcl_AppendElement(interp, Tcl_GetHashKey(tablePtr, hPtr)); } } break; } case PKG_PRESENT: { CONST char *name; if (objc < 3) { goto require; } argv2 = Tcl_GetString(objv[2]); if ((argv2[0] == '-') && (strcmp(argv2, "-exact") == 0)) { if (objc != 5) { goto requireSyntax; |
︙ | ︙ |
Changes to generic/tclStringObj.c.
︙ | ︙ | |||
1013 1014 1015 1016 1017 1018 1019 | typePtr->freeIntRepProc(objPtr); } SetUnicodeObj(objPtr, unicode, numChars); } static int UnicodeLength( | | | 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 | typePtr->freeIntRepProc(objPtr); } SetUnicodeObj(objPtr, unicode, numChars); } static int UnicodeLength( CONST Tcl_UniChar *unicode) { int numChars = 0; if (unicode) { while (numChars >= 0 && unicode[numChars] != 0) { numChars++; } |
︙ | ︙ |
Changes to generic/tclStubInit.c.
︙ | ︙ | |||
177 178 179 180 181 182 183 | #elif !defined(__WIN32__) /* UNIX and MAC */ # define TclWinConvertError (void (*) _ANSI_ARGS_((unsigned int))) TclGetAndDetachPids # define TclWinConvertWSAError (void (*) _ANSI_ARGS_((unsigned int))) TclpCloseFile # define TclWinGetPlatformId (int (*)()) TclpCreateTempFile # define TclWinGetTclInstance (void *(*)()) TclpCreateProcess # define TclWinNToHS (unsigned short (*) _ANSI_ARGS_((unsigned short ns))) TclpMakeFile | | | 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | #elif !defined(__WIN32__) /* UNIX and MAC */ # define TclWinConvertError (void (*) _ANSI_ARGS_((unsigned int))) TclGetAndDetachPids # define TclWinConvertWSAError (void (*) _ANSI_ARGS_((unsigned int))) TclpCloseFile # define TclWinGetPlatformId (int (*)()) TclpCreateTempFile # define TclWinGetTclInstance (void *(*)()) TclpCreateProcess # define TclWinNToHS (unsigned short (*) _ANSI_ARGS_((unsigned short ns))) TclpMakeFile # define TclWinSetSockOpt (int (*) _ANSI_ARGS_((void *, int, int, CONST char *, int))) TclpOpenFile # define TclWinAddProcess 0 # define TclWinNoBackslash 0 # define TclWinSetInterfaces 0 # define TclWinFlushDirtyChannels 0 # define TclWinResetInterfaces 0 # define TclMacOSXGetFileAttribute 0 /* Only implemented in Tcl >= 8.5 */ # define TclMacOSXMatchType 0 /* Only implemented in Tcl >= 8.5 */ |
︙ | ︙ |
Changes to generic/tclTestProcBodyObj.c.
︙ | ︙ | |||
13 14 15 16 17 18 19 | #include "tclInt.h" /* * name and version of this package */ | | | | | | | 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 | #include "tclInt.h" /* * name and version of this package */ static CONST char packageName[] = "procbodytest"; static CONST char packageVersion[] = "1.0"; /* * Name of the commands exported by this package */ static CONST char procCommand[] = "proc"; /* * this struct describes an entry in the table of command names and command * procs */ typedef struct CmdTable { CONST char *cmdName; /* command name */ Tcl_ObjCmdProc *proc; /* command proc */ int exportIt; /* if 1, export the command */ } CmdTable; /* * Declarations for functions defined in this file. */ static int ProcBodyTestProcObjCmd _ANSI_ARGS_((ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])); static int ProcBodyTestInitInternal _ANSI_ARGS_((Tcl_Interp *interp, int isSafe)); static int RegisterCommand _ANSI_ARGS_((Tcl_Interp* interp, CONST char *namespace, CONST CmdTable *cmdTablePtr)); int Procbodytest_Init _ANSI_ARGS_((Tcl_Interp * interp)); int Procbodytest_SafeInit _ANSI_ARGS_((Tcl_Interp * interp)); /* * List of commands to create when the package is loaded; must go after the * declarations of the enable command procedure. */ |
︙ | ︙ | |||
133 134 135 136 137 138 139 | * *---------------------------------------------------------------------- */ static int RegisterCommand(interp, namespace, cmdTablePtr) Tcl_Interp* interp; /* the Tcl interpreter for which the * operation is performed */ | | | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | * *---------------------------------------------------------------------- */ static int RegisterCommand(interp, namespace, cmdTablePtr) Tcl_Interp* interp; /* the Tcl interpreter for which the * operation is performed */ CONST char *namespace; /* the namespace in which the command * is registered */ CONST CmdTable *cmdTablePtr; /* the command to register */ { char buf[128]; if (cmdTablePtr->exportIt) { sprintf(buf, "namespace eval %s { namespace export %s }", |
︙ | ︙ |