Index: doc/expatapi.html ================================================================== --- doc/expatapi.html +++ doc/expatapi.html @@ -156,11 +156,11 @@ int TclExampleObjCmd(dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; - Tcl_Obj *CONST objv[]; + Tcl_Obj *const objv[]; { char *method; CHandlerSet *handlerSet; int methodIndex, result; simpleCounter *counter; Index: doc/expatapi.n ================================================================== --- doc/expatapi.n +++ doc/expatapi.n @@ -326,11 +326,11 @@ int TclExampleObjCmd(dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; - Tcl_Obj *CONST objv[]; + Tcl_Obj *const objv[]; { char *method; CHandlerSet *handlerSet; int methodIndex, result; simpleCounter *counter; Index: doc/expatapi.xml ================================================================== --- doc/expatapi.xml +++ doc/expatapi.xml @@ -193,11 +193,11 @@ int TclExampleObjCmd(dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; - Tcl_Obj *CONST objv[]; + Tcl_Obj *const objv[]; { char *method; CHandlerSet *handlerSet; int methodIndex, result; simpleCounter *counter; Index: generic/dom.c ================================================================== --- generic/dom.c +++ generic/dom.c @@ -1812,14 +1812,14 @@ | \--------------------------------------------------------------------------*/ static int externalEntityRefHandler ( XML_Parser parser, - CONST char *openEntityNames, - CONST char *base, - CONST char *systemId, - CONST char *publicId + const char *openEntityNames, + const char *base, + const char *systemId, + const char *publicId ) { domReadInfo *info = (domReadInfo *) XML_GetUserData (parser); Tcl_Obj *cmdPtr, *resultObj, *resultTypeObj, *extbaseObj, *xmlstringObj; @@ -1831,11 +1831,11 @@ XML_Parser extparser, oldparser = NULL; char buf[4096], *resultType, *extbase, *xmlstring, *channelId, s[50]; Tcl_Channel chan = (Tcl_Channel) NULL; enum XML_Status status; XML_Index storedNextFeedbackPosition; - CONST84 char *interpResult; + const char *interpResult; if (info->document->extResolver == NULL) { Tcl_AppendResult (info->interp, "Can't read external entity \"", systemId, "\": No -externalentitycommand given", NULL); @@ -5331,21 +5331,21 @@ int TclTdomObjCmd (dummy, interp, objc, objv) ClientData dummy; Tcl_Interp *interp; int objc; - Tcl_Obj *CONST objv[]; + Tcl_Obj *const objv[]; { char *encodingName; CHandlerSet *handlerSet; int methodIndex, result, bool; tdomCmdReadInfo *info; TclGenExpatInfo *expat; Tcl_Obj *newObjName = NULL; TEncoding *encoding; - static CONST84 char *tdomMethods[] = { + static const char *tdomMethods[] = { "enable", "getdoc", "setResultEncoding", "setStoreLineColumn", "setExternalEntityResolver", "keepEmpties", "remove", "ignorexmlns", "keepCDATA", NULL Index: generic/dom.h ================================================================== --- generic/dom.h +++ generic/dom.h @@ -84,17 +84,10 @@ # define MEM_SUITE &memsuite #else # define MEM_SUITE NULL #endif -/* - * Beginning with 8.4, Tcl API is CONST'ified - */ -#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION <= 3) -# define CONST84 -#endif - /* * Beginning with 8.6, interp->errorLine isn't public visible anymore * (TIP 330) */ #if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 6) Index: generic/domxslt.c ================================================================== --- generic/domxslt.c +++ generic/domxslt.c @@ -5906,11 +5906,11 @@ Tcl_Obj *channelIdObj, *resultTypeObj; int len, mode, result, storeLineColumn; int resultcode = 0; char *resultType, *extbase, *xmlstring, *channelId, s[20]; Tcl_Obj *extResolver = NULL; - CONST84 char *str; + const char *str; domDocument *doc; xsltSubDoc *sdoc; XML_Parser parser; Tcl_Channel chan; Tcl_DString dStr; Index: generic/nodecmd.c ================================================================== --- generic/nodecmd.c +++ generic/nodecmd.c @@ -105,11 +105,11 @@ | \---------------------------------------------------------------------------*/ static void * StackPush (void *); static void * StackPop (void); static void * StackTop (void); -static int NodeObjCmd (ClientData,Tcl_Interp*,int,Tcl_Obj *CONST o[]); +static int NodeObjCmd (ClientData,Tcl_Interp*,int,Tcl_Obj *const o[]); static void StackFinalize (ClientData); extern int tcldom_appendXML (Tcl_Interp*, domNode*, Tcl_Obj*); @@ -280,11 +280,11 @@ static int NodeObjCmd ( ClientData arg, /* Type of node to create. */ Tcl_Interp * interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[] /* Argument objects. */ + Tcl_Obj *const objv[] /* Argument objects. */ ) { int type, createType, len, dlen, i, ret, disableOutputEscaping = 0, index = 1; char *tag, *p, *tval, *aval; domNode *parent, *newNode = NULL; @@ -518,11 +518,11 @@ \---------------------------------------------------------------------------*/ int nodecmd_createNodeCmd ( Tcl_Interp * interp, /* Current interpreter. */ int objc, /* Number of arguments. */ - Tcl_Obj *CONST objv[], /* Argument objects. */ + Tcl_Obj *const objv[], /* Argument objects. */ int checkName, /* Flag: Name checks? */ int checkCharData /* Flag: Data checks? */ ) { int index, ret, type, nodecmd = 0, jsonType = 0, haveJsonType = 0; int isElement = 0; @@ -539,16 +539,16 @@ enum subCmd { ELM_NODE, TXT_NODE, CDS_NODE, CMT_NODE, PIC_NODE, PRS_NODE }; - static CONST84 char *subcmds[] = { + static const char *subcmds[] = { "elementNode", "textNode", "cdataNode", "commentNode", "piNode", "parserNode", NULL }; - static CONST84 char *options[] = { + static const char *options[] = { "-returnNodeCmd", "-jsonType", "-tagName", "-namespace", NULL }; enum option { o_returnNodeCmd, o_jsonType, o_tagName, o_namespace Index: generic/nodecmd.h ================================================================== --- generic/nodecmd.h +++ generic/nodecmd.h @@ -32,11 +32,11 @@ | \---------------------------------------------------------------------------*/ int nodecmd_createNodeCmd (Tcl_Interp * interp, int objc, - Tcl_Obj *CONST objv[], + Tcl_Obj *const objv[], int checkName, int checkCharData); int nodecmd_appendFromScript (Tcl_Interp *interp, domNode *node, Index: generic/tcldom.c ================================================================== --- generic/tcldom.c +++ generic/tcldom.c @@ -358,11 +358,11 @@ " readlock \n" " writelock \n" ) ; -static CONST84 char *jsonTypes[] = { +static const char *jsonTypes[] = { "NONE", "ARRAY", "OBJECT", "NULL", "TRUE", @@ -396,14 +396,26 @@ /*---------------------------------------------------------------------------- | Prototypes for procedures defined later in this file: | \---------------------------------------------------------------------------*/ - +#if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION <= 3) +/* + * Before Tcl 8.4, Tcl_VarTraceProc and Tcl_CmdDeleteProc were not + * CONST84'ified. When compiling with -DTCL_NO_DEPRECATED, CONST84 is + * gone, therefore we can't use the function type definitions of + * Tcl_VarTraceProc and Tcl_CmdDeleteProc for these old version. + * + */ +static char * tcldom_docTrace( + ClientData clientData, Tcl_Interp *interp, + const char *part1, const char *part2, int flags); +static void tcldom_docCmdDeleteProc(ClientData clientData); +#else static Tcl_VarTraceProc tcldom_docTrace; - static Tcl_CmdDeleteProc tcldom_docCmdDeleteProc; +#endif static void tcldom_treeAsJSON(Tcl_Obj *jstring, domNode *node, Tcl_Channel channel, int indent, int level, int inside); @@ -527,12 +539,12 @@ \---------------------------------------------------------------------------*/ static char * tcldom_docTrace ( ClientData clientData, Tcl_Interp *interp, - CONST84 char *name1, - CONST84 char *name2, + const char *name1, + const char *name2, int flags ) { domDeleteInfo *dinfo = (domDeleteInfo*) clientData; domDocument *doc = dinfo->document; @@ -954,11 +966,11 @@ int tcldom_xpointerSearch ( Tcl_Interp * interp, int mode, domNode * node, int objc, - Tcl_Obj * CONST objv[] + Tcl_Obj * const objv[] ) { char *str; int i = 0; int result = 0; @@ -1623,12 +1635,12 @@ char *strToParse, int *offset, char **errMsg ) { - CONST char *varValue; - CONST char *termPtr; + const char *varValue; + const char *termPtr; Tcl_Interp *interp = (Tcl_Interp *) clientData; *offset = 0; varValue = Tcl_ParseVar(interp, strToParse, &termPtr); if (varValue) { @@ -1655,11 +1667,11 @@ static int tcldom_selectNodes ( Tcl_Interp *interp, domNode *node, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { char *xpathQuery, *typeVar, *option; char *errMsg = NULL, **mappings = NULL; int rc, i, len, optionIndex, localmapping = 0, cache = 0; @@ -1667,11 +1679,11 @@ xpathResultSet rs; Tcl_Obj *type, *objPtr, *objPtr1, *mappingListObj = NULL; xpathCBs cbs; xpathParseVarCB parseVarCB; - static CONST84 char *selectNodesOptions[] = { + static const char *selectNodesOptions[] = { "-namespaces", "-cache", NULL }; enum selectNodesOption { o_namespaces, o_cache }; @@ -3442,11 +3454,11 @@ \---------------------------------------------------------------------------*/ static int serializeAsXML ( domNode *node, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { char *channelId, prefix[MAX_PREFIX_LEN]; const char *localName; int indent, mode, escapeNonASCII = 0, doctypeDeclaration = 0; @@ -3456,11 +3468,11 @@ Tcl_Channel chan = (Tcl_Channel) NULL; Tcl_HashEntry *h; Tcl_DString dStr; int indentAttrs = -1; - static CONST84 char *asXMLOptions[] = { + static const char *asXMLOptions[] = { "-indent", "-channel", "-escapeNonASCII", "-doctypeDeclaration", "-xmlDeclaration", "-encString", "-escapeAllQuot", "-indentAttrs", NULL }; enum asXMLOption { @@ -3647,20 +3659,20 @@ \---------------------------------------------------------------------------*/ static int serializeAsHTML ( domNode *node, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { char *channelId; int optionIndex, mode, escapeNonASCII = 0, htmlEntities = 0; int doctypeDeclaration = 0; Tcl_Obj *resultPtr; Tcl_Channel chan = (Tcl_Channel) NULL; - static CONST84 char *asHTMLOptions[] = { + static const char *asHTMLOptions[] = { "-channel", "-escapeNonASCII", "-htmlEntities", "-doctypeDeclaration", NULL }; enum asHTMLOption { m_channel, m_escapeNonASCII, m_htmlEntities, m_doctypeDeclaration @@ -3745,19 +3757,19 @@ \---------------------------------------------------------------------------*/ static int serializeAsJSON ( domNode *node, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { char *channelId; int optionIndex, mode, indent = -1; Tcl_Obj *resultPtr; Tcl_Channel chan = (Tcl_Channel) NULL; - static CONST84 char *asJSONOptions[] = { + static const char *asJSONOptions[] = { "-channel", "-indent", NULL }; enum asJSONOption { m_channel, m_indent @@ -3839,11 +3851,11 @@ \---------------------------------------------------------------------------*/ static int cdataSectionElements ( domDocument *doc, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { int result, hnew; Tcl_Obj *resultPtr,*namePtr; Tcl_HashEntry *h; @@ -3929,11 +3941,11 @@ \---------------------------------------------------------------------------*/ static int selectNodesNamespaces ( domDocument *doc, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { int len, i, result; Tcl_Obj *objPtr, *listPtr; @@ -3983,11 +3995,11 @@ \---------------------------------------------------------------------------*/ static int renameNodes ( domDocument *doc, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { int len, i, hnew; Tcl_HashEntry *h; Tcl_Obj *objPtr; @@ -4018,11 +4030,11 @@ \---------------------------------------------------------------------------*/ static int deleteXPathCache ( domDocument *doc, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { Tcl_HashEntry *h; Tcl_HashSearch search; @@ -4060,11 +4072,11 @@ static int applyXSLT ( domNode *node, Tcl_Interp *interp, void *clientData, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { char *usage, **parameters = NULL, *errMsg, *option; Tcl_Obj *objPtr, *localListPtr = (Tcl_Obj *)NULL; int i, result, length, optionIndex; @@ -4081,11 +4093,11 @@ static char *cmd_usage = "wrong # args: should be \"?-parameters parameterList? " "?-ignoreUndeclaredParameters? ?-maxApplyDepth int? " "?-xsltmessagecmd cmd? ?objVar?\""; - static CONST84 char *xsltOptions[] = { + static const char *xsltOptions[] = { "-parameters", "-ignoreUndeclaredParameters", "-maxApplyDepth", "-xsltmessagecmd", NULL }; enum xsltOption { @@ -4236,17 +4248,17 @@ \---------------------------------------------------------------------------*/ static int tcldom_XSLTObjCmd ( ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { int index; char *errMsg = NULL; - static CONST84 char *options[] = { + static const char *options[] = { "transform", "delete", NULL }; enum option { m_transform, m_delete }; @@ -4338,11 +4350,11 @@ \---------------------------------------------------------------------------*/ int tcldom_NodeObjCmd ( ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { GetTcldomTSD() domNode *node, *child, *refChild, *oldChild, *refNode; @@ -4357,11 +4369,11 @@ Tcl_Obj *namePtr, *resultPtr; Tcl_Obj *mobjv[MAX_REWRITE_ARGS]; Tcl_CmdInfo cmdInfo; Tcl_HashEntry *h; - static CONST84 char *nodeMethods[] = { + static const char *nodeMethods[] = { "firstChild", "nextSibling", "getAttribute", "nodeName", "nodeValue", "nodeType", "attributes", "asList", "find", "setAttribute", "removeAttribute", "parentNode", "previousSibling", "lastChild", "appendChild", "removeChild", "hasChildNodes", "localName", "childNodes", "ownerDocument", @@ -5409,11 +5421,11 @@ \---------------------------------------------------------------------------*/ int tcldom_DocObjCmd ( ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { GetTcldomTSD() domDeleteInfo * dinfo; @@ -5425,11 +5437,11 @@ int restoreDomCreateCmdMode = 0; domNode * n; Tcl_CmdInfo cmdInfo; Tcl_Obj * mobjv[MAX_REWRITE_ARGS]; - static CONST84 char *docMethods[] = { + static const char *docMethods[] = { "documentElement", "getElementsByTagName", "delete", "createElement", "createCDATASection", "createTextNode", "createComment", "createProcessingInstruction", "createElementNS", "getDefaultOutputMethod", "asXML", "asHTML", "getElementsByTagNameNS", "xslt", @@ -6002,11 +6014,11 @@ { int setVariable = 0, jsonType = 0, index; domDocument *doc; Tcl_Obj *newObjName = NULL; - static CONST84 char *options[] = {"-jsonType", NULL}; + static const char *options[] = {"-jsonType", NULL}; CheckArgs(1,4,1,"?-jsonType jsonType? ?newObjVar?"); if (objc == 2) { newObjName = objv[1]; @@ -6140,11 +6152,11 @@ char *xml_string, *option, *errStr, *channelId, *baseURI = NULL; char *jsonRoot = NULL; Tcl_Obj *extResolver = NULL; Tcl_Obj *feedbackCmd = NULL; - CONST84 char *interpResult; + const char *interpResult; int optionIndex, value, xml_string_len, mode; int jsonmaxnesting = JSON_MAX_NESTING; int ignoreWhiteSpaces = 1; int takeJSONParser = 0; int takeSimpleParser = 0; @@ -6161,11 +6173,11 @@ Tcl_Obj *newObjName = NULL; XML_Parser parser; Tcl_Channel chan = (Tcl_Channel) NULL; Tcl_CmdInfo cmdInfo; - static CONST84 char *parseOptions[] = { + static const char *parseOptions[] = { "-keepEmpties", "-simple", "-html", "-feedbackAfter", "-channel", "-baseurl", "-externalentitycommand", "-useForeignDTD", "-paramentityparsing", "-feedbackcmd", "-json", "-jsonroot", #ifdef TDOM_HAVE_GUMBO @@ -6184,11 +6196,11 @@ #endif o_jsonmaxnesting, o_ignorexmlns, o_LAST, o_keepCDATA }; - static CONST84 char *paramEntityParsingValues[] = { + static const char *paramEntityParsingValues[] = { "always", "never", "notstandalone", (char *) NULL }; @@ -6657,11 +6669,11 @@ Tcl_Obj * const objv[] ) { int featureIndex, result; - static CONST84 char *features[] = { + static const char *features[] = { "expatversion", "expatmajorversion", "expatminorversion", "expatmicroversion", "dtd", "ns", "unknown", "tdomalloc", "lessns", "html5", "jsonmaxnesting", "versionhash", "TCL_UTF_MAX", NULL @@ -6761,21 +6773,21 @@ \---------------------------------------------------------------------------*/ int tcldom_DomObjCmd ( ClientData clientData, Tcl_Interp * interp, int objc, - Tcl_Obj * CONST objv[] + Tcl_Obj * const objv[] ) { GetTcldomTSD() char * method, tmp[300]; int methodIndex, result, i, bool; Tcl_CmdInfo cmdInfo; Tcl_Obj * mobjv[MAX_REWRITE_ARGS]; - static CONST84 char *domMethods[] = { + static const char *domMethods[] = { "createDocument", "createDocumentNS", "createNodeCmd", "parse", "setResultEncoding", "setStoreLineColumn", "isCharData", "isName", "isPIName", "isQName", "isComment", "isCDATA", "isPIValue", "isNCName", "createDocumentNode", @@ -6797,11 +6809,11 @@ #ifdef TCL_THREADS ,m_attachDocument, m_detachDocument #endif }; - static CONST84 char *nodeModeValues[] = { + static const char *nodeModeValues[] = { "automatic", "command", "token", NULL }; enum nodeModeValue { v_automatic, v_command, v_token }; @@ -7183,11 +7195,11 @@ \---------------------------------------------------------------------------*/ int tcldom_unknownCmd ( ClientData clientData, Tcl_Interp * interp, int objc, - Tcl_Obj * CONST objv[] + Tcl_Obj * const objv[] ) { int len, i, rc, openedParen, count, args; char *cmd, *dot, *paren, *arg[MAX_REWRITE_ARGS], *object, *method; Tcl_DString callString; Index: generic/tclexpat.c ================================================================== --- generic/tclexpat.c +++ generic/tclexpat.c @@ -112,13 +112,13 @@ /*---------------------------------------------------------------------------- | Prototypes for procedures defined later in this file: | \---------------------------------------------------------------------------*/ int TclExpatObjCmd (ClientData dummy, - Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); + Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int TclExpatInstanceCmd (ClientData dummy, - Tcl_Interp *interp, int objc, struct Tcl_Obj *CONST objv[]); + Tcl_Interp *interp, int objc, struct Tcl_Obj *const objv[]); static void TclExpatDeleteCmd (ClientData clientData); static Tcl_Obj* FindUniqueCmdName (Tcl_Interp *interp); static int TclExpatCheckWhiteData (char *pc, int len); @@ -127,16 +127,16 @@ static void TclExpatFreeParser (TclGenExpatInfo *expat); static int TclExpatParse (Tcl_Interp *interp, TclGenExpatInfo *expat, char *data, int len, TclExpat_InputType type); static int TclExpatConfigure (Tcl_Interp *interp, - TclGenExpatInfo *expat, int objc, Tcl_Obj *CONST objv[]); + TclGenExpatInfo *expat, int objc, Tcl_Obj *const objv[]); static int TclExpatCget (Tcl_Interp *interp, - TclGenExpatInfo *expat, int objc, Tcl_Obj *CONST objv[]); + TclGenExpatInfo *expat, int objc, Tcl_Obj *const objv[]); static int TclExpatGet (Tcl_Interp *interp, - TclGenExpatInfo *expat, int objc, Tcl_Obj *CONST objv[]); + TclGenExpatInfo *expat, int objc, Tcl_Obj *const objv[]); static void TclExpatDispatchPCDATA (TclGenExpatInfo *expat); static void TclGenExpatElementStartHandler (void *userdata, const XML_Char *name, const XML_Char **atts); static void TclGenExpatElementEndHandler (void *userData, @@ -202,14 +202,14 @@ static void TclGenExpatEntityDeclHandler (void *userData, const XML_Char *entityname, int is_param, const XML_Char *value, int length, - CONST XML_Char *base, - CONST XML_Char *systemId, - CONST XML_Char *publicId, - CONST XML_Char *notationName); + const XML_Char *base, + const XML_Char *systemId, + const XML_Char *publicId, + const XML_Char *notationName); /* *---------------------------------------------------------------------------- * * CreateTclHandlerSet -- @@ -339,11 +339,11 @@ int TclExpatObjCmd( ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { TclGenExpatInfo *genexpat; int ns_mode = 0; char *nsoption; @@ -652,11 +652,11 @@ *---------------------------------------------------------------------------- */ static void CurrentmarkupCommand ( void *userData, - CONST char *s, + const char *s, int len ) { TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; if (expat->status != TCL_OK) { @@ -699,17 +699,17 @@ static int TclExpatInstanceCmd ( ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { TclGenExpatInfo *expat = (TclGenExpatInfo *) clientData; char *data; int len = 0, optionIndex, result = TCL_OK; - static CONST84 char *options[] = { + static const char *options[] = { "configure", "cget", "currentmarkup", "free", "get", "parse", "parsechannel", "parsefile", "reset", "delete", NULL }; enum options { @@ -1101,13 +1101,13 @@ static int TclExpatConfigure ( Tcl_Interp *interp, TclGenExpatInfo *expat, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { - static CONST84 char *switches[] = { + static const char *switches[] = { "-final", "-baseurl", "-elementstartcommand", "-elementendcommand", "-characterdatacommand", @@ -1158,11 +1158,11 @@ EXPAT_ENTITYDECLCOMMAND, EXPAT_NOWHITESPACE, EXPAT_HANDLERSET, EXPAT_NOEXPAND }; - static CONST84 char *paramEntityParsingValues[] = { + static const char *paramEntityParsingValues[] = { "always", "never", "notstandalone", (char *) NULL }; @@ -1170,11 +1170,11 @@ EXPAT_PARAMENTITYPARSINGALWAYS, EXPAT_PARAMENTITYPARSINGNEVER, EXPAT_PARAMENTITYPARSINGNOTSTANDALONE }; int optionIndex, value, bool; - Tcl_Obj *CONST *objPtr = objv; + Tcl_Obj *const *objPtr = objv; Tcl_CmdInfo cmdInfo; int rc; char *handlerSetName = NULL; TclHandlerSet *tmpTclHandlerSet, *activeTclHandlerSet = NULL; @@ -1593,13 +1593,13 @@ static int TclExpatCget ( Tcl_Interp *interp, TclGenExpatInfo *expat, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { - static CONST84 char *switches[] = { + static const char *switches[] = { "-final", "-baseurl", "-elementstartcommand", "-elementendcommand", "-characterdatacommand", @@ -1995,14 +1995,14 @@ static int TclExpatGet ( Tcl_Interp *interp, TclGenExpatInfo *expat, int objc, - Tcl_Obj *CONST objv[] + Tcl_Obj *const objv[] ) { - static CONST84 char *getSwitches[] = { + static const char *getSwitches[] = { "-specifiedattributecount", "-currentbytecount", "-currentlinenumber", "-currentcolumnnumber", "-currentbyteindex", @@ -2289,11 +2289,11 @@ */ static void TclGenExpatElementEndHandler( void *userData, - CONST char *name + const char *name ) { TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; int result; Tcl_Obj *vector[2], *ename = NULL; TclHandlerSet *activeTclHandlerSet; @@ -2504,11 +2504,11 @@ */ static void TclGenExpatEndNamespaceDeclHandler( void *userData, - CONST char *prefix + const char *prefix ) { TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; Tcl_Obj *cmdPtr; int result; TclHandlerSet *activeTclHandlerSet; @@ -2627,11 +2627,11 @@ */ static void TclGenExpatCharacterDataHandler( void *userData, - CONST char *s, + const char *s, int len ) { TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; if (expat->status != TCL_OK) { @@ -2782,12 +2782,12 @@ */ static void TclGenExpatProcessingInstructionHandler( void *userData, - CONST char *target, - CONST char *data + const char *target, + const char *data ) { TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; Tcl_Obj *cmdPtr; int result; TclHandlerSet *activeTclHandlerSet; @@ -2868,11 +2868,11 @@ */ static void TclGenExpatDefaultHandler( void *userData, - CONST char *s, + const char *s, int len ) { TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; Tcl_Obj *cmdPtr; int result; @@ -2954,18 +2954,18 @@ */ static void TclGenExpatEntityDeclHandler( void *userData, - CONST char *entityname, + const char *entityname, int is_param, - CONST char *value, + const char *value, int length, - CONST char *base, - CONST char *systemId, - CONST char *publicId, - CONST char *notationName + const char *base, + const char *systemId, + const char *publicId, + const char *notationName ) { TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; Tcl_Obj *cmdPtr; int result; TclHandlerSet *activeTclHandlerSet; @@ -3075,14 +3075,14 @@ */ static void TclGenExpatNotationDeclHandler( void *userData, - CONST char *notationName, - CONST char *base, - CONST char *systemId, - CONST char *publicId + const char *notationName, + const char *base, + const char *systemId, + const char *publicId ) { TclGenExpatInfo *expat = (TclGenExpatInfo *) userData; Tcl_Obj *cmdPtr; int result; TclHandlerSet *activeTclHandlerSet; @@ -3174,11 +3174,11 @@ */ static int TclGenExpatUnknownEncodingHandler( void *encodingHandlerData, - CONST char *name, + const char *name, XML_Encoding *info ) { TclGenExpatInfo *expat = (TclGenExpatInfo *) encodingHandlerData; CHandlerSet *activeCHandlerSet; @@ -3220,14 +3220,14 @@ *---------------------------------------------------------------------------- */ static int TclGenExpatExternalEntityRefHandler( XML_Parser parser, - CONST char *openEntityNames, - CONST char *base, - CONST char *systemId, - CONST char *publicId + const char *openEntityNames, + const char *base, + const char *systemId, + const char *publicId ) { TclGenExpatInfo *expat = (TclGenExpatInfo *) XML_GetUserData(parser); Tcl_Obj *cmdPtr, *resultObj, *resultTypeObj, *extbaseObj, *dataObj; int result, mode, done, fd, tclLen; size_t len; @@ -4519,11 +4519,11 @@ int CheckExpatParserObj ( Tcl_Interp *interp, - Tcl_Obj *CONST nameObj + Tcl_Obj *const nameObj ) { Tcl_CmdInfo info; if (!Tcl_GetCommandInfo (interp, Tcl_GetString(nameObj), &info)) { return 0; @@ -4535,11 +4535,11 @@ } int CHandlerSetInstall ( Tcl_Interp *interp, - Tcl_Obj *CONST expatObj, + Tcl_Obj *const expatObj, CHandlerSet *handlerSet ) { Tcl_CmdInfo info; TclGenExpatInfo *expat; CHandlerSet *activeCHandlerSet; @@ -4572,11 +4572,11 @@ } int CHandlerSetRemove ( Tcl_Interp *interp, - Tcl_Obj *CONST expatObj, + Tcl_Obj *const expatObj, char *handlerSetName ) { Tcl_CmdInfo info; TclGenExpatInfo *expat; CHandlerSet *activeCHandlerSet, *parentHandlerSet = NULL; @@ -4612,11 +4612,11 @@ } CHandlerSet * CHandlerSetGet ( Tcl_Interp *interp, - Tcl_Obj *CONST expatObj, + Tcl_Obj *const expatObj, char *handlerSetName ) { Tcl_CmdInfo info; TclGenExpatInfo *expat; CHandlerSet *activeCHandlerSet; @@ -4639,11 +4639,11 @@ } void * CHandlerSetGetUserData ( Tcl_Interp *interp, - Tcl_Obj *CONST expatObj, + Tcl_Obj *const expatObj, char *handlerSetName ) { Tcl_CmdInfo info; TclGenExpatInfo *expat; CHandlerSet *activeCHandlerSet; @@ -4666,13 +4666,13 @@ } TclGenExpatInfo * GetExpatInfo ( Tcl_Interp *interp, - Tcl_Obj *CONST expatObj + Tcl_Obj *const expatObj ) { Tcl_CmdInfo info; if (!Tcl_GetCommandInfo (interp, Tcl_GetString(expatObj), &info)) { return NULL; } return (TclGenExpatInfo *) info.objClientData; } Index: generic/tclexpat.h ================================================================== --- generic/tclexpat.h +++ generic/tclexpat.h @@ -132,11 +132,11 @@ 2 == parsing an input chunk */ XML_Char nsSeparator; int paramentityparsing; int noexpand; int useForeignDTD; - CONST char *currentmarkup; /* Used to transfer data for method */ + const char *currentmarkup; /* Used to transfer data for method */ int currentmarkuplen; /* currentmarkup */ TclHandlerSet *firstTclHandlerSet; CHandlerSet *firstCHandlerSet; } TclGenExpatInfo; @@ -152,22 +152,22 @@ #endif EXTERN Tcl_ObjCmdProc TclExpatObjCmd; EXTERN int CheckExpatParserObj (Tcl_Interp *interp, - Tcl_Obj *CONST nameObj); + Tcl_Obj *const nameObj); EXTERN int CHandlerSetInstall (Tcl_Interp *interp, - Tcl_Obj *CONST expatObj, + Tcl_Obj *const expatObj, CHandlerSet *handlerSet); EXTERN int CHandlerSetRemove (Tcl_Interp *interp, - Tcl_Obj *CONST expatObj, + Tcl_Obj *const expatObj, char *handlerSetName); EXTERN CHandlerSet * CHandlerSetCreate (char *name); EXTERN CHandlerSet * CHandlerSetGet (Tcl_Interp *interp, - Tcl_Obj *CONST expatObj, + Tcl_Obj *const expatObj, char *handlerSetName); EXTERN void * CHandlerSetGetUserData (Tcl_Interp *interp, - Tcl_Obj *CONST expatObj, + Tcl_Obj *const expatObj, char *handlerSetName); EXTERN TclGenExpatInfo * GetExpatInfo (Tcl_Interp *interp, - Tcl_Obj *CONST expatObj); + Tcl_Obj *const expatObj); Index: generic/tclpull.h ================================================================== --- generic/tclpull.h +++ generic/tclpull.h @@ -1,3 +1,3 @@ int tDOM_PullParserCmd (ClientData dummy, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]); + Tcl_Obj *const objv[]); Index: generic/tdom.decls ================================================================== --- generic/tdom.decls +++ generic/tdom.decls @@ -9,38 +9,38 @@ interface tdom #hooks {} declare 0 generic { int TclExpatObjCmd (ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) + int objc, Tcl_Obj *const objv[]) } declare 1 generic { - int CheckExpatParserObj (Tcl_Interp *interp, Tcl_Obj *CONST nameObj) + int CheckExpatParserObj (Tcl_Interp *interp, Tcl_Obj *const nameObj) } declare 2 generic { - int CHandlerSetInstall (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, + int CHandlerSetInstall (Tcl_Interp *interp, Tcl_Obj *const expatObj, CHandlerSet *handlerSet) } declare 3 generic { - int CHandlerSetRemove (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, + int CHandlerSetRemove (Tcl_Interp *interp, Tcl_Obj *const expatObj, char *handlerSetName) } declare 4 generic { CHandlerSet * CHandlerSetCreate (char *name) } declare 5 generic { - CHandlerSet * CHandlerSetGet (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, + CHandlerSet * CHandlerSetGet (Tcl_Interp *interp, Tcl_Obj *const expatObj, char *handlerSetName) } declare 6 generic { void * CHandlerSetGetUserData (Tcl_Interp *interp, - Tcl_Obj *CONST expatObj, + Tcl_Obj *const expatObj, char *handlerSetName) } declare 7 generic { TclGenExpatInfo * GetExpatInfo (Tcl_Interp *interp, - Tcl_Obj *CONST expatObj) + Tcl_Obj *const expatObj) } declare 8 generic { XML_Size XML_GetCurrentLineNumber(XML_Parser parser) } declare 9 generic { Index: generic/tdomDecls.h ================================================================== --- generic/tdomDecls.h +++ generic/tdomDecls.h @@ -13,35 +13,35 @@ * Exported function declarations: */ /* 0 */ EXTERN int TclExpatObjCmd(ClientData dummy, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]); + int objc, Tcl_Obj *const objv[]); /* 1 */ EXTERN int CheckExpatParserObj(Tcl_Interp *interp, - Tcl_Obj *CONST nameObj); + Tcl_Obj *const nameObj); /* 2 */ EXTERN int CHandlerSetInstall(Tcl_Interp *interp, - Tcl_Obj *CONST expatObj, + Tcl_Obj *const expatObj, CHandlerSet *handlerSet); /* 3 */ EXTERN int CHandlerSetRemove(Tcl_Interp *interp, - Tcl_Obj *CONST expatObj, + Tcl_Obj *const expatObj, char *handlerSetName); /* 4 */ EXTERN CHandlerSet * CHandlerSetCreate(char *name); /* 5 */ EXTERN CHandlerSet * CHandlerSetGet(Tcl_Interp *interp, - Tcl_Obj *CONST expatObj, + Tcl_Obj *const expatObj, char *handlerSetName); /* 6 */ EXTERN void * CHandlerSetGetUserData(Tcl_Interp *interp, - Tcl_Obj *CONST expatObj, + Tcl_Obj *const expatObj, char *handlerSetName); /* 7 */ EXTERN TclGenExpatInfo * GetExpatInfo(Tcl_Interp *interp, - Tcl_Obj *CONST expatObj); + Tcl_Obj *const expatObj); /* 8 */ EXTERN XML_Size XML_GetCurrentLineNumber(XML_Parser parser); /* 9 */ EXTERN XML_Size XML_GetCurrentColumnNumber(XML_Parser parser); /* 10 */ @@ -65,18 +65,18 @@ typedef struct TdomStubs { int magic; void *hooks; - int (*tclExpatObjCmd) (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); /* 0 */ - int (*checkExpatParserObj) (Tcl_Interp *interp, Tcl_Obj *CONST nameObj); /* 1 */ - int (*cHandlerSetInstall) (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, CHandlerSet *handlerSet); /* 2 */ - int (*cHandlerSetRemove) (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, char *handlerSetName); /* 3 */ + int (*tclExpatObjCmd) (ClientData dummy, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); /* 0 */ + int (*checkExpatParserObj) (Tcl_Interp *interp, Tcl_Obj *const nameObj); /* 1 */ + int (*cHandlerSetInstall) (Tcl_Interp *interp, Tcl_Obj *const expatObj, CHandlerSet *handlerSet); /* 2 */ + int (*cHandlerSetRemove) (Tcl_Interp *interp, Tcl_Obj *const expatObj, char *handlerSetName); /* 3 */ CHandlerSet * (*cHandlerSetCreate) (char *name); /* 4 */ - CHandlerSet * (*cHandlerSetGet) (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, char *handlerSetName); /* 5 */ - void * (*cHandlerSetGetUserData) (Tcl_Interp *interp, Tcl_Obj *CONST expatObj, char *handlerSetName); /* 6 */ - TclGenExpatInfo * (*getExpatInfo) (Tcl_Interp *interp, Tcl_Obj *CONST expatObj); /* 7 */ + CHandlerSet * (*cHandlerSetGet) (Tcl_Interp *interp, Tcl_Obj *const expatObj, char *handlerSetName); /* 5 */ + void * (*cHandlerSetGetUserData) (Tcl_Interp *interp, Tcl_Obj *const expatObj, char *handlerSetName); /* 6 */ + TclGenExpatInfo * (*getExpatInfo) (Tcl_Interp *interp, Tcl_Obj *const expatObj); /* 7 */ XML_Size (*xML_GetCurrentLineNumber) (XML_Parser parser); /* 8 */ XML_Size (*xML_GetCurrentColumnNumber) (XML_Parser parser); /* 9 */ XML_Index (*xML_GetCurrentByteIndex) (XML_Parser parser); /* 10 */ int (*xML_GetCurrentByteCount) (XML_Parser parser); /* 11 */ enum XML_Status (*xML_SetBase) (XML_Parser parser, const XML_Char *base); /* 12 */ Index: generic/tdomStubLib.c ================================================================== --- generic/tdomStubLib.c +++ generic/tdomStubLib.c @@ -51,18 +51,18 @@ /*---------------------------------------------------------------------------- | Tdom_InitStubs | \---------------------------------------------------------------------------*/ -CONST char * +const char * Tdom_InitStubs ( Tcl_Interp *interp, char *version, int exact ) { - CONST char *actualVersion; + const char *actualVersion; ClientData clientData = NULL; #if (TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION == 0) Tcl_SetResult(interp, "Too old Tcl version. Binary extensions " "to tDOM are not possible, with a that outdated " Index: tests/all.tcl ================================================================== --- tests/all.tcl +++ tests/all.tcl @@ -26,10 +26,15 @@ ::tcltest::testConstraint need_uri 1 } } } +::tcltest::testConstraint needExpand 1 +if {$tcl_version < 8.5} { + ::tcltest::testConstraint needExpand 0 +} + set timeCmd {clock format [clock seconds]} set ::tcltest::testSingleFile false puts stdout "Tcl $tcl_patchLevel tests running in interp: [info nameofexecutable]" Index: tests/domDoc.test ================================================================== --- tests/domDoc.test +++ tests/domDoc.test @@ -1139,16 +1139,20 @@ set result } { e1} test domDoc-22.2 {appendFromScript} { set doc [dom parse ] - namespace eval nodeCmds { - $doc appendFromScript { - e1 - e2 - } + $doc appendFromScript { + nodeCmds::e1 + nodeCmds::e2 } + # namespace eval nodeCmds { + # $doc appendFromScript { + # e1 + # e2 + # } + # } set result [$doc asXML -indent none] foreach node [$doc selectNodes *] { lappend result [$node parentNode] lappend result [expr {$doc == [$node ownerDocument]}] } Index: tests/domjson.test ================================================================== --- tests/domjson.test +++ tests/domjson.test @@ -159,11 +159,11 @@ test json-1.19 {Invalid input - uncompled \u escape} { catch {dom parse -json {"ab\u00"}} } 1 -test json-1.20 {Escaped binary 0} { +test json-1.20 {Escaped binary 0} {needExpand} { dom parse -json "\"a\\u0000\"" doc set textvalue [$doc selectNodes string(node())] set result [string length $textvalue] binary scan $textvalue c2 result2 lappend result {*}$result2 Index: tests/loadtdom.tcl ================================================================== --- tests/loadtdom.tcl +++ tests/loadtdom.tcl @@ -11,10 +11,10 @@ if {[catch {package require -exact tdom 0.9.1}]} { if {[catch {load [file join [file dir [info script]] ../unix/libtdom0.9.1.so]}]} { error "Unable to load the appropriate tDOM version!" } } -if {[info commands ::tDOM::xmlReadFile] eq ""} { +if {[info commands ::tDOM::xmlReadFile] == ""} { # tcldomsh without the script library. Source the lib. source [file join [file dir [info script]] ../lib tdom.tcl] }