This is an automated email from the ASF dual-hosted git repository.

mxmanghi pushed a commit to branch tcl-novem
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git


The following commit(s) were added to refs/heads/tcl-novem by this push:
     new 6513179  changing CONST into const and introducing also Tcl_Size 
wherever required by Tcl 9.0. Implementing also close2proc as required by 
channel version 5
6513179 is described below

commit 651317953b425e5d0a6b69c773bb6c8ddc5ffc0e
Author: Massimo Manghi <man...@trixie.rivetweb.org>
AuthorDate: Sun Nov 19 22:05:42 2023 +0100

    changing CONST into const and introducing also Tcl_Size wherever required 
by Tcl 9.0. Implementing also close2proc as required by channel version 5
---
 ChangeLog                       |  3 +++
 src/TclWeb.h                    |  2 +-
 src/librivet/rivetCrypt.c       | 20 ++++++++--------
 src/librivet/rivetList.c        | 38 ++++++++++++++++++------------
 src/librivet/rivetWWW.c         | 22 +++++++++---------
 src/mod_rivet_ng/TclWebapache.c | 18 ++++++++++-----
 src/mod_rivet_ng/rivetChannel.c | 39 +++++++++++++++++--------------
 src/mod_rivet_ng/rivetCore.c    | 51 ++++++++++++++++++++---------------------
 src/mod_rivet_ng/rivetInspect.c |  2 +-
 src/parser/rivetParser.c        |  2 +-
 10 files changed, 109 insertions(+), 88 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 195fd88..378926d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2023-11-19 Massimo Manghi <mxman...@apache.org>
+    * src/mod_rivet_ng/*.c: changing code to comply with the Tcl 9.0 new 
requirements
+
 2023-11-12 Massimo Manghi <mxman...@apache.org>
        * .appveyor.yml: Attemping to fix Visual Studio generator version
 
diff --git a/src/TclWeb.h b/src/TclWeb.h
index fc8a341..5f418fd 100644
--- a/src/TclWeb.h
+++ b/src/TclWeb.h
@@ -71,7 +71,7 @@ int TclWeb_SetHeaderType(char *header, TclWebRequest *req);
 
 int TclWeb_PrintHeaders(TclWebRequest *req);
 
-int TclWeb_PrintError(CONST86 char *errstr, int htmlflag, TclWebRequest *req);
+int TclWeb_PrintError(const char *errstr, int htmlflag, TclWebRequest *req);
 
 /*
  *-----------------------------------------------------------------------------
diff --git a/src/librivet/rivetCrypt.c b/src/librivet/rivetCrypt.c
index 78e2918..08f8094 100644
--- a/src/librivet/rivetCrypt.c
+++ b/src/librivet/rivetCrypt.c
@@ -71,20 +71,20 @@ TCL_CMD_HEADER( Rivet_EncryptCmd )
 {
     char *data, *key;
     char *resultBuffer;
-    int dataLen;
+    Tcl_Size dataLen;
     int keyIndex;
 
     if( objc < 3 ) {
-        Tcl_WrongNumArgs( interp, 1, objv, "data key" );
+        Tcl_WrongNumArgs(interp,1,objv,"data key");
         return TCL_ERROR;
     }
 
-    data = Tcl_GetStringFromObj( objv[1], &dataLen );
+    data = Tcl_GetStringFromObj(objv[1],&dataLen);
 
-    resultBuffer = (char *)Tcl_Alloc( (unsigned)dataLen + 1 );
-    strcpy ( resultBuffer, data );
+    resultBuffer = (char *)Tcl_Alloc((unsigned)dataLen + 1);
+    strcpy (resultBuffer, data);
 
-    for( keyIndex = 2; keyIndex < objc; keyIndex++ )
+    for (keyIndex = 2;keyIndex < objc;keyIndex++)
     {
         key = Tcl_GetStringFromObj( objv[keyIndex], NULL );
         Rivet_Crypt( resultBuffer, key, 0L, MODE_ENCRYPT );
@@ -99,15 +99,15 @@ TCL_CMD_HEADER( Rivet_DecryptCmd )
 {
     char *data, *key;
     char *resultBuffer;
-    int dataLen;
+    Tcl_Size dataLen;
     int keyIndex;
 
     if( objc < 3 ) {
-    Tcl_WrongNumArgs( interp, 1, objv, "data key" );
-        return TCL_ERROR;
+               Tcl_WrongNumArgs( interp, 1, objv, "data key" );
+               return TCL_ERROR;
     }
 
-    data = Tcl_GetStringFromObj( objv[1], &dataLen );
+    data = Tcl_GetStringFromObj(objv[1],&dataLen);
 
     resultBuffer = (char *)Tcl_Alloc( (unsigned)dataLen + 1 );
     strcpy ( resultBuffer, data );
diff --git a/src/librivet/rivetList.c b/src/librivet/rivetList.c
index 33ccf46..b24d055 100644
--- a/src/librivet/rivetList.c
+++ b/src/librivet/rivetList.c
@@ -50,10 +50,11 @@ TCL_CMD_HEADER(Rivet_LremoveObjCmd)
 #define EXACT   0
 #define GLOB    1
 #define REGEXP  2
-    int listObjc, i, j, match, mode, patternLen, valueLen;
+    int i, j, match, mode;
     int list, all, done, append;
     char *modeStr, *pattern, *value;
     Tcl_Obj **listObjv, *matchedListPtr = NULL;
+    Tcl_Size listObjc;
 
     if( objc < 3 ) {
         Tcl_WrongNumArgs( interp, 1, objv,
@@ -108,6 +109,8 @@ TCL_CMD_HEADER(Rivet_LremoveObjCmd)
     done = 0;
     for(i = 0; i < listObjc; i++)
     {
+               Tcl_Size valueLen;
+
         match = 0;
         value = Tcl_GetStringFromObj(listObjv[i], &valueLen);
 
@@ -126,6 +129,8 @@ TCL_CMD_HEADER(Rivet_LremoveObjCmd)
         append = list + 1;
         for( j = list + 1; j < objc; ++j )
         {
+                       Tcl_Size  patternLen;
+
             pattern = Tcl_GetStringFromObj(objv[j], &patternLen);
             if( (mode != EXACT) && (strlen(pattern) != (size_t)patternLen) ) {
                 goto binData;
@@ -234,21 +239,21 @@ Rivet_ListObjAppendString (interp, targetList, string, 
length)
  */
 TCL_CMD_HEADER(Rivet_CommaSplitObjCmd) 
 {
-    char        *first, *next;
+    char        *first,*next;
     char         c;
-    int          stringLength;
+    Tcl_Size     stringLength;
     Tcl_Obj     *resultList;
 
     /* ??? need a way to set this */
     /* true if two quotes ("") in the body of a field maps to one (") */
-    int          quotequoteQuotesQuote = 1;
+    int quotequoteQuotesQuote = 1;
 
     /* true if quotes within strings not followed by a comma are allowed */
-    int          quotePairsWithinStrings = 1;
+    int quotePairsWithinStrings = 1;
 
     if( objc != 2 ) {
-    Tcl_WrongNumArgs( interp, 1, objv, "string" );
-    return TCL_ERROR;
+               Tcl_WrongNumArgs( interp, 1, objv, "string" );
+               return TCL_ERROR;
     }
 
     /* get access to a textual representation of the object */
@@ -396,13 +401,13 @@ TCL_CMD_HEADER(Rivet_CommaSplitObjCmd)
  */
 TCL_CMD_HEADER(Rivet_CommaJoinObjCmd)
 {
-    int         listObjc;
+    Tcl_Size    listObjc;
     Tcl_Obj   **listObjv;
     int         listIdx, didField;
     Tcl_Obj    *resultPtr;
     char       *walkPtr;
     char       *strPtr;
-    int         stringLength;
+    Tcl_Size    stringLength;
 
     if( objc != 2 ) {
     Tcl_WrongNumArgs( interp, 1, objv,
@@ -473,19 +478,22 @@ TCL_CMD_HEADER(Rivet_CommaJoinObjCmd)
  */
 TCL_CMD_HEADER( Rivet_LassignArrayObjCmd )
 {
-    int     listObjc, listIdx, idx;
+    int      listIdx,idx;
+       Tcl_Size listObjc;
     Tcl_Obj **listObjv;
     Tcl_Obj *varValue;
 
-    if( objc < 4 ) {
-    Tcl_WrongNumArgs( interp, 1, objv,
-            "list arrayName elementName ?elementName..?");
-        return TCL_ERROR;
+    if (objc < 4) {
+               Tcl_WrongNumArgs( interp, 1, objv,
+                               "list arrayName elementName ?elementName..?");
+               return TCL_ERROR;
     }
 
-    if( Tcl_ListObjGetElements(interp, objv[1],
+    if (Tcl_ListObjGetElements(interp, objv[1],
                                &listObjc, &listObjv) != TCL_OK)
+       {
         return TCL_ERROR;
+       }
 
     for (idx = 3, listIdx = 0; idx < objc; idx++, listIdx++) {
     varValue = (listIdx < listObjc) ?
diff --git a/src/librivet/rivetWWW.c b/src/librivet/rivetWWW.c
index 672c1b8..bbf9fdd 100644
--- a/src/librivet/rivetWWW.c
+++ b/src/librivet/rivetWWW.c
@@ -81,8 +81,8 @@ Rivet_HexToDigit(int c) {
  */
 TCL_CMD_HEADER( Rivet_UnescapeStringCmd )
 {
-    char *origString, *newString, *origStringP, *newStringP;
-    int  origLength;
+    char     *origString, *newString, *origStringP, *newStringP;
+    Tcl_Size  origLength;
     int digit1, digit2;
 
     if ( objc != 2 ) {
@@ -90,7 +90,7 @@ TCL_CMD_HEADER( Rivet_UnescapeStringCmd )
         return TCL_ERROR;
     }
 
-    origString = Tcl_GetStringFromObj( objv[1], &origLength );
+    origString = Tcl_GetStringFromObj(objv[1],&origLength);
     newString = Tcl_Alloc( (unsigned)origLength + 1);
 
     /* for all the characters in the source string */
@@ -176,8 +176,8 @@ Rivet_DigitToHex(int c) {
  */
 TCL_CMD_HEADER( Rivet_EscapeStringCmd )
 {
-    char *origString, *newString, *origStringP, *newStringP;
-    int origLength;
+    char    *origString, *newString, *origStringP, *newStringP;
+    Tcl_Size origLength;
 
     if ( objc != 2 ) {
         Tcl_WrongNumArgs( interp, 1, objv, "string" );
@@ -229,15 +229,15 @@ TCL_CMD_HEADER( Rivet_EscapeStringCmd )
  */
 TCL_CMD_HEADER( Rivet_EscapeSgmlCharsCmd )
 {
-    char *origString, *newString, *origStringP, *newStringP;
-    int origLength;
+    char    *origString, *newString, *origStringP, *newStringP;
+    Tcl_Size origLength;
 
     if( objc != 2 ) {
         Tcl_WrongNumArgs( interp, 1, objv, "string" );
         return TCL_ERROR;
     }
 
-    origString = Tcl_GetStringFromObj( objv[1], &origLength );
+    origString = Tcl_GetStringFromObj(objv[1],&origLength);
 
     /* If they sent us an empty string, we're done */
     if (origLength == 0) return TCL_OK;
@@ -313,15 +313,15 @@ TCL_CMD_HEADER( Rivet_EscapeSgmlCharsCmd )
  */
 TCL_CMD_HEADER( Rivet_EscapeShellCommandCmd )
 {
-    char *origString, *newString, *origStringP, *newStringP, *checkP;
-    int  origLength;
+    char     *origString, *newString, *origStringP, *newStringP, *checkP;
+    Tcl_Size  origLength;
 
     if( objc != 2) {
         Tcl_WrongNumArgs( interp, 1, objv, "string" );
         return TCL_ERROR;
     }
 
-    origString = Tcl_GetStringFromObj( objv[1], &origLength );
+    origString = Tcl_GetStringFromObj(objv[1],&origLength);
 
     newString = Tcl_Alloc( (unsigned)origLength * 2 + 1 );
 
diff --git a/src/mod_rivet_ng/TclWebapache.c b/src/mod_rivet_ng/TclWebapache.c
index 1b9ed59..ae1217f 100644
--- a/src/mod_rivet_ng/TclWebapache.c
+++ b/src/mod_rivet_ng/TclWebapache.c
@@ -207,7 +207,7 @@ TclWeb_PrintHeaders(TclWebRequest *req)
 
 /* Print nice HTML formatted errors */
 int
-TclWeb_PrintError(CONST86 char *errstr, int htmlflag, TclWebRequest *req)
+TclWeb_PrintError(const char *errstr, int htmlflag, TclWebRequest *req)
 {
     TclWeb_SetHeaderType(DEFAULT_HEADER_TYPE, req);
     TclWeb_PrintHeaders(req);
@@ -788,14 +788,20 @@ TclWeb_EscapeShellCommand(char *out, char *in, 
TclWebRequest *req)
 
 /* These API's are a bit different, because it's so much more
  * practical. */
+#if 0
+#undef Tcl_ExternalToUtfDString
+#define Tcl_ExternalToUtfDString(encoding, src, len, ds) \
+       (Tcl_ExternalToUtfDStringEx(NULL,(encoding),(src),(len), \
+       TCL_ENCODING_PROFILE_TCL8, (ds), NULL))
+#endif
 
-char *TclWeb_StringToUtf(char *in, TclWebRequest *req)
+char *TclWeb_StringToUtf (char *in,TclWebRequest *req)
 {
     char *tmp;
     Tcl_DString dstr;
-    Tcl_DStringInit(&dstr);
-    Tcl_ExternalToUtfDString(NULL, in, (signed)strlen(in), &dstr);
-    tmp = (char*) apr_pstrdup(req->req->pool, Tcl_DStringValue(&dstr));
+
+    Tcl_DStringInit(&dstr);    
+    tmp = (char*) 
apr_pstrdup(req->req->pool,Tcl_ExternalToUtfDString(NULL,in,(signed)strlen(in),&dstr));
     Tcl_DStringFree(&dstr);
     return tmp;
 }
@@ -820,7 +826,7 @@ int TclWeb_UploadChannel(char *varname, TclWebRequest *req)
 {
     Tcl_Channel chan;
 
-    chan = Tcl_OpenFileChannel(req->interp, req->upload->tempname, "r", 0);
+    chan = Tcl_OpenFileChannel(req->interp,req->upload->tempname,"r",0);
     if (chan == NULL) {
            return TCL_ERROR;
     } else {
diff --git a/src/mod_rivet_ng/rivetChannel.c b/src/mod_rivet_ng/rivetChannel.c
index 0b3b854..a1e80b8 100644
--- a/src/mod_rivet_ng/rivetChannel.c
+++ b/src/mod_rivet_ng/rivetChannel.c
@@ -35,12 +35,11 @@
 #include <tcl.h>
 #include <errno.h>
 
-//#include "apache_request.h"
 #include "mod_rivet.h"
 #include "TclWeb.h"
 
 static int
-inputproc(ClientData instancedata, char *buf, int toRead, int *errorCodePtr)
+RivetChan_InputProc(ClientData instancedata, char *buf, int toRead, int 
*errorCodePtr)
 {
     return EINVAL;
 }
@@ -49,7 +48,7 @@ inputproc(ClientData instancedata, char *buf, int toRead, int 
*errorCodePtr)
    Channel that we create to divert stdout to. */
 
 static int
-outputproc(ClientData instancedata, CONST86 char *buf, int toWrite, int 
*errorCodePtr)
+RivetChan_OutputProc(ClientData instancedata, const char *buf, int toWrite, 
int *errorCodePtr)
 {
     apr_threadkey_t*        rivet_thread_key = (apr_threadkey_t*) instancedata;
     rivet_thread_private*   private;
@@ -67,43 +66,50 @@ outputproc(ClientData instancedata, CONST86 char *buf, int 
toWrite, int *errorCo
 }
 
 static int
-closeproc(ClientData instancedata, Tcl_Interp *interp)
+RivetChan_CloseProc(ClientData instancedata, Tcl_Interp *interp)
 {
     return 0;
 }
 
 static int
-setoptionproc(ClientData instancedata, Tcl_Interp *interp,
-                 CONST86 char *optionname, CONST86 char *value)
+RivetChan_Close2Proc(ClientData instancedata, Tcl_Interp *interp, int flags)
+{
+    return 0;
+}
+
+
+static int
+RivetChan_SetOptionProc(ClientData instancedata,Tcl_Interp *interp,
+             const char *optionname,const char *value)
 {
     return TCL_OK;
 }
 
 static void
-watchproc(ClientData instancedata, int mask)
+RivetChan_WatchProc(ClientData instancedata, int mask)
 {
     /* not much to do here */
     return;
 }
 
 static int
-gethandleproc(ClientData instancedata, int direction, ClientData *handlePtr)
+RivetChan_GetHandleProc(ClientData instancedata, int direction, ClientData 
*handlePtr)
 {
     return TCL_ERROR;
 }
 
 Tcl_ChannelType RivetChan = {
     "apache_channel",           /* typeName */
-    TCL_CHANNEL_VERSION_4,      /* channel type version */
-    closeproc,                  /* close proc */
-    inputproc,                  /* input proc */
-    outputproc,                 /* output proc */
+    TCL_CHANNEL_VERSION_5,      /* channel type version */
+    RivetChan_CloseProc,        /* close proc */
+    RivetChan_InputProc,        /* input proc */
+    RivetChan_OutputProc,       /* output proc */
     NULL,                       /* seek proc - can be null */
-    setoptionproc,              /* set option proc - can be null */
+    RivetChan_SetOptionProc,    /* set option proc - can be null */
     NULL,                       /* get option proc - can be null */
-    watchproc,                  /* watch proc */
-    gethandleproc,              /* get handle proc */
-    NULL,                       /* close 2 proc - can be null */
+    RivetChan_WatchProc,        /* watch proc */
+    RivetChan_GetHandleProc,    /* get handle proc */
+    RivetChan_Close2Proc,       /* close 2 proc - can be null */
     NULL,                       /* block mode proc - can be null */
     NULL,                       /* flush proc - can be null */
     NULL,                       /* handler proc - can be null */
@@ -111,4 +117,3 @@ Tcl_ChannelType RivetChan = {
     NULL,                       /* thread action proc - can be null */
     NULL                        /* truncate proc */
 };
-
diff --git a/src/mod_rivet_ng/rivetCore.c b/src/mod_rivet_ng/rivetCore.c
index b54c8c1..4a2b30b 100644
--- a/src/mod_rivet_ng/rivetCore.c
+++ b/src/mod_rivet_ng/rivetCore.c
@@ -123,7 +123,6 @@ TCL_CMD_HEADER( Rivet_MakeURL )
     rivet_thread_private*   private;
     Tcl_Obj*                result  = NULL;
     char*                   url_target_name;
-    int                     target_length;
 
     if (objc > 2)
     {
@@ -139,6 +138,7 @@ TCL_CMD_HEADER( Rivet_MakeURL )
     }
     else
     {
+       Tcl_Size target_length;
         url_target_name = Tcl_GetStringFromObj(objv[1],&target_length);
 
         // we check the first character for a '/' (absolute path)
@@ -222,17 +222,17 @@ TCL_CMD_HEADER( Rivet_Parse )
 
     if( objc == 2 ) {
 
-        filename = Tcl_GetStringFromObj( objv[1], (int *)NULL );
+        filename = Tcl_GetStringFromObj(objv[1],(Tcl_Size *)NULL);
 
     } else {
 
-        if (STREQU( Tcl_GetStringFromObj(objv[1], (int *)NULL), "-virtual")) {
+        if (STREQU(Tcl_GetStringFromObj(objv[1],(Tcl_Size *)NULL),"-virtual")) 
{
 
         /* */
 
-            filename = 
TclWeb_GetVirtualFile(private->req,Tcl_GetStringFromObj(objv[2],(int *)NULL));
+            filename = 
TclWeb_GetVirtualFile(private->req,Tcl_GetStringFromObj(objv[2],(Tcl_Size 
*)NULL));
 
-        } else if ( STREQU( Tcl_GetStringFromObj(objv[1], (int *)NULL), 
"-string")) {
+        } else if (STREQU(Tcl_GetStringFromObj(objv[1],(Tcl_Size 
*)NULL),"-string")) {
 
             int      res;
             Tcl_Obj* script = objv[2];
@@ -259,7 +259,7 @@ TCL_CMD_HEADER( Rivet_Parse )
 
         } else {
 
-            Tcl_WrongNumArgs( interp, 1, objv, "?-virtual? filename | -string 
template_string" );
+            Tcl_WrongNumArgs(interp,1,objv,"?-virtual? filename | -string 
template_string");
             return TCL_ERROR;
 
         }
@@ -350,7 +350,7 @@ TCL_CMD_HEADER( Rivet_Parse )
  *-----------------------------------------------------------------------------
  */
 
-TCL_CMD_HEADER( Rivet_Include )
+TCL_CMD_HEADER(Rivet_Include)
 {
     rivet_thread_private*   private;
     int                     sz;
@@ -361,7 +361,7 @@ TCL_CMD_HEADER( Rivet_Include )
     Tcl_DString             transoptions;
     Tcl_DString             encoptions;
 
-    if( objc < 2 || objc > 3 )
+    if ((objc < 2) || (objc > 3))
     {
         Tcl_WrongNumArgs(interp, 1, objv, "?-virtual? filename");
         return TCL_ERROR;
@@ -370,16 +370,16 @@ TCL_CMD_HEADER( Rivet_Include )
     THREAD_PRIVATE_DATA(private)
     CHECK_REQUEST_REC(private,"::rivet::include")
 
-    if( objc == 2 ) {
-        filename = Tcl_GetStringFromObj( objv[1], (int *)NULL );
+    if (objc == 2) {
+        filename = Tcl_GetStringFromObj(objv[1],(Tcl_Size *)NULL);
     } else {
-        if( !STREQU( Tcl_GetStringFromObj(objv[1], (int *)NULL), "-virtual") ) 
{
+        if( !STREQU(Tcl_GetStringFromObj(objv[1],(Tcl_Size *)NULL), 
"-virtual") ) {
             Tcl_WrongNumArgs( interp, 1, objv, "?-virtual? filename" );
             return TCL_ERROR;
         }
 
         CHECK_REQUEST_REC(private,"::rivet::include -virtual")
-        filename = 
TclWeb_GetVirtualFile(private->req,Tcl_GetStringFromObj(objv[2], (int *)NULL) );
+        filename = 
TclWeb_GetVirtualFile(private->req,Tcl_GetStringFromObj(objv[2],(Tcl_Size 
*)NULL));
     }
 
     fd = Tcl_OpenFileChannel(interp, filename, "r", 0664);
@@ -405,7 +405,7 @@ TCL_CMD_HEADER( Rivet_Include )
      * previous settings. */
     Tcl_DStringInit(&transoptions);
     Tcl_DStringInit(&encoptions);
-    tclstdout = Tcl_GetChannel(interp, "stdout", NULL);
+    tclstdout = Tcl_GetChannel(interp,"stdout",NULL);
     Tcl_GetChannelOption(interp, tclstdout, "-translation", &transoptions);
     Tcl_GetChannelOption(interp, tclstdout, "-encoding", &encoptions);
     Tcl_SetChannelOption(interp, tclstdout, "-translation", "binary");
@@ -448,7 +448,7 @@ TCL_CMD_HEADER( Rivet_Headers )
         return TCL_ERROR;
     }
 
-    opt = Tcl_GetStringFromObj(objv[1], NULL);
+    opt = Tcl_GetStringFromObj(objv[1],(Tcl_Size *)NULL);
 
     /* Basic introspection returning the value of the headers_printed flag */
 
@@ -471,8 +471,7 @@ TCL_CMD_HEADER( Rivet_Headers )
             Tcl_WrongNumArgs(interp, 2, objv, "new-url");
             return TCL_ERROR;
         }
-        apr_table_set(private->r->headers_out, "Location",
-                     Tcl_GetStringFromObj (objv[2], (int *)NULL));
+        
apr_table_set(private->r->headers_out,"Location",Tcl_GetStringFromObj(objv[2],(Tcl_Size
 *)NULL));
         TclWeb_SetStatus(301, private->req);
         return TCL_OK;
     }
@@ -886,7 +885,7 @@ TCL_CMD_HEADER( Rivet_ApacheTable )
     apr_table_t *table = NULL;
     int subcommandindex;
 
-    static CONST86 char *SubCommand[] = {
+    static const char *SubCommand[] = {
         "get",
         "set",
         "exists",
@@ -907,7 +906,7 @@ TCL_CMD_HEADER( Rivet_ApacheTable )
         SUB_CLEAR
     };
 
-    static CONST86 char *tableNames[] = {
+    static const char *tableNames[] = {
         "notes",
         "headers_in",
         "headers_out",
@@ -1015,7 +1014,7 @@ TCL_CMD_HEADER( Rivet_ApacheTable )
             char *value;
 
             if (objc == 4) {
-                int listObjc;
+                Tcl_Size  listObjc;
                 Tcl_Obj **listObjv;
 
                 if (Tcl_ListObjGetElements (interp, objv[3], &listObjc, 
&listObjv) == TCL_ERROR) {
@@ -1132,7 +1131,7 @@ TCL_CMD_HEADER( Rivet_Upload )
      * of an upload
      */
 
-    static CONST86 char *SubCommand[] = {
+    static const char *SubCommand[] = {
         "channel",
         "save",
         "data",
@@ -1157,7 +1156,7 @@ TCL_CMD_HEADER( Rivet_Upload )
         NAMES
     };
 
-    static CONST86 int cmds_objc[] = { 3,4,3,3,3,3,3,3,2 };
+    static const int cmds_objc[] = { 3,4,3,3,3,3,3,3,2 };
     int expected_objc;
 
     rivet_thread_private* private;
@@ -1775,7 +1774,7 @@ TCL_CMD_HEADER(Rivet_LogErrorCmd)
     int loglevelindex;
     int  apLogLevel = 0;
 
-    static CONST86 char *logLevel[] = {
+    static const char *logLevel[] = {
         "emerg",
         "alert",
         "crit",
@@ -1889,9 +1888,9 @@ TestpanicCmd(dummy, interp, argc, argv)
     ClientData dummy;                   /* Not used. */
     Tcl_Interp *interp;                 /* Current interpreter. */
     int argc;                           /* Number of arguments. */
-    CONST char **argv;                  /* Argument strings. */
+    const char **argv;                  /* Argument strings. */
 {
-    CONST char *argString;
+    const char *argString;
 
     /*
      *  Put the arguments into a var args structure
@@ -1899,7 +1898,7 @@ TestpanicCmd(dummy, interp, argc, argv)
      */
 
     argString = Tcl_Merge(argc-1, argv+1);
-    panic("%s",argString);
+    Tcl_Panic("%s",argString);
     ckfree((char *)argString);
 
     return TCL_OK;
@@ -2054,7 +2053,7 @@ TCL_CMD_HEADER( Rivet_GetThreadId )
         char*    cmd_arg;
 
         Tcl_IncrRefCount(argobj);
-        cmd_arg = Tcl_GetStringFromObj(argobj,NULL);
+        cmd_arg = Tcl_GetStringFromObj(argobj,(Tcl_Size *)NULL);
         if (STRNEQU(cmd_arg,"-hex"))
         {
             output_format = format_hex;
diff --git a/src/mod_rivet_ng/rivetInspect.c b/src/mod_rivet_ng/rivetInspect.c
index 767a84b..b94b1b3 100644
--- a/src/mod_rivet_ng/rivetInspect.c
+++ b/src/mod_rivet_ng/rivetInspect.c
@@ -311,7 +311,7 @@ Tcl_Obj* Rivet_BuildConfDictionary ( Tcl_Interp*           
interp,
         {
             int       i;
             Tcl_Obj** objArrayPnt;
-            int       objArrayCnt;
+            Tcl_Size  objArrayCnt;
             Tcl_Obj*  val;
 
             Tcl_IncrRefCount(keyval_list);
diff --git a/src/parser/rivetParser.c b/src/parser/rivetParser.c
index e05941b..2eed107 100644
--- a/src/parser/rivetParser.c
+++ b/src/parser/rivetParser.c
@@ -242,7 +242,7 @@ Rivet_Parser(Tcl_Obj *outbuf, Tcl_Obj *inbuf)
     int endseqlen      =       (int) strlen(END_TAG);
     int startseqlen =  (int) strlen(START_TAG);
     int inside = 0, p = 0, check_echo = 0;
-    int inLen = 0;
+    Tcl_Size inLen = 0;
 
     next = Tcl_GetStringFromObj(inbuf, &inLen);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@tcl.apache.org
For additional commands, e-mail: commits-h...@tcl.apache.org

Reply via email to