Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade TclX to Tcl9 #12

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for tclx 8.6.
# Generated by GNU Autoconf 2.69 for tclx 9.0.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -577,8 +577,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='tclx'
PACKAGE_TARNAME='tclx'
PACKAGE_VERSION='8.6'
PACKAGE_STRING='tclx 8.6'
PACKAGE_VERSION='9.0'
PACKAGE_STRING='tclx 9.0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1298,7 +1298,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures tclx 8.6 to adapt to many kinds of systems.
\`configure' configures tclx 9.0 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1359,7 +1359,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of tclx 8.6:";;
short | recursive ) echo "Configuration of tclx 9.0:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1460,7 +1460,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
tclx configure 8.6
tclx configure 9.0
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1982,7 +1982,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by tclx $as_me 8.6, which was
It was created by tclx $as_me 9.0, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -2330,7 +2330,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu


FULL_VERSION="8.6.0"
FULL_VERSION="9.0.0"


# TEA extensions pass this us the version of TEA they think they
Expand Down Expand Up @@ -2598,7 +2598,7 @@ $as_echo "$as_me: WARNING: --with-tcl argument should refer to directory contain
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
`ls -d /usr/lib/tcl8.6 2>/dev/null` \
`ls -d /usr/lib/tcl9.0 2>/dev/null` \
ramikhaldi marked this conversation as resolved.
Show resolved Hide resolved
`ls -d /usr/lib/tcl8.5 2>/dev/null` \
; do
if test -f "$i/tclConfig.sh" ; then
Expand Down Expand Up @@ -10398,7 +10398,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by tclx $as_me 8.6, which was
This file was extended by tclx $as_me 9.0, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -10451,7 +10451,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
tclx config.status 8.6
tclx config.status 9.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Expand Down
4 changes: 2 additions & 2 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ dnl to configure the system for the local environment.
#
# RCS: @(#) $Id: configure.in,v 1.17 2006/01/26 00:30:54 hobbs Exp $

AC_INIT([tclx], [8.6])
FULL_VERSION="8.6.0"
AC_INIT([tclx], [9.0])
FULL_VERSION="9.0.0"

TEA_INIT([3.9])

Expand Down
6 changes: 5 additions & 1 deletion generic/tclExtend.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ typedef void *void_pt;
#define TCLX_CMDL_INTERACTIVE (1<<0)
#define TCLX_CMDL_EXIT_ON_EOF (1<<1)

#define CONST const
ramikhaldi marked this conversation as resolved.
Show resolved Hide resolved
#define VOID void
#define panic Tcl_Panic

Comment on lines +55 to +58
Copy link
Member

@resuna resuna Nov 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to build without these lines. They were not previously needed. If there are other changes necessary to make it work they need to be made elsewhere.

/*
* Application signal error handler. Called after normal signal processing,
* when a signal results in an error. Its main purpose in life is to allow
Expand Down Expand Up @@ -97,7 +101,7 @@ EXTERN void TclX_SplitWinCmdLine (int *argcPtr, char ***argvPtr);
/*
* Exported utility functions.
*/
EXTERN void TclX_AppendObjResult TCL_VARARGS_DEF(Tcl_Interp *, interpArg);
EXTERN void TclX_AppendObjResult (Tcl_Interp *, ...);

EXTERN char * TclX_DownShift (char *targetStr, CONST char *sourceStr);

Expand Down
6 changes: 3 additions & 3 deletions generic/tclXbsearch.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ ReadAndCompare (off_t fileOffset, binSearchCB_t *searchCBPtr)
* one.
*/
if (fileOffset != 0) {
if (Tcl_Gets (searchCBPtr->channel, &searchCBPtr->lineBuf) < 0) {
if (Tcl_Gets (searchCBPtr->channel, &searchCBPtr->lineBuf) <= 0) {
if (Tcl_Eof (searchCBPtr->channel) ||
Tcl_InputBlocked (searchCBPtr->channel)) {
TclX_AppendObjResult (searchCBPtr->interp,
Expand Down Expand Up @@ -197,7 +197,7 @@ ReadAndCompare (off_t fileOffset, binSearchCB_t *searchCBPtr)
* Read the line. Only compare if EOF was not hit, otherwise, treat as if
* we went above the key we are looking for.
*/
if (Tcl_Gets (searchCBPtr->channel, &searchCBPtr->lineBuf) < 0) {
if (Tcl_Gets (searchCBPtr->channel, &searchCBPtr->lineBuf) <= 0) {
if (Tcl_Eof (searchCBPtr->channel) ||
Tcl_InputBlocked (searchCBPtr->channel)) {
searchCBPtr->cmpResult = -1;
Expand Down Expand Up @@ -343,7 +343,7 @@ TclX_BsearchObjCmd (ClientData clientData,
valPtr = Tcl_NewStringObj (Tcl_DStringValue (&searchCB.lineBuf),
-1);
if (Tcl_ObjSetVar2(interp, objv[3], NULL, valPtr,
TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) {
TCL_LEAVE_ERR_MSG) == NULL) {
Tcl_DecrRefCount (valPtr);
goto errorExit;
}
Expand Down
7 changes: 2 additions & 5 deletions generic/tclXchmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ TclX_ChmodObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *
Tcl_Obj **fileObjv;
char *fileIdsString;
char *modeString;
int modeBits;

/*
* Options are not parsable just looking for "-", since modes can
Expand All @@ -334,12 +333,10 @@ TclX_ChmodObjCmd (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *

modeString = Tcl_GetStringFromObj (objv [objIdx], NULL);
if (ISDIGIT (modeString[0])) {
if (Tcl_GetIntFromObj (interp, objv [objIdx], &modeBits)
!= TCL_OK)
return TCL_ERROR;
modeInfo.absMode = modeBits;
modeInfo.absMode = strtol(modeString, 0, 0);
modeInfo.symMode = NULL;
} else {
modeInfo.absMode = 0;
modeInfo.symMode = modeString;
}

Expand Down
25 changes: 5 additions & 20 deletions generic/tclXdup.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ DupChannelOptions (Tcl_Interp *interp,
goto errorExit;
}
if ((optArgc % 2) != 0) {
panic("channel didn't return keyword/value pairs");
Tcl_Panic("channel didn't return keyword/value pairs");
}

for (idx = 0; idx < optArgc; idx += 2) {
Expand Down Expand Up @@ -208,18 +208,11 @@ TclX_DupObjCmd (ClientData clientData,
* If a number is supplied, bind it to a file handle rather than doing
* a dup.
*/
if (objv [1]->typePtr == Tcl_GetObjType ("int")) {
bindFnum = TRUE;
} else {
srcChannelId = Tcl_GetStringFromObj (objv [1], NULL);
if (ISDIGIT (srcChannelId [0])) {
if (Tcl_ConvertToType (interp, objv [1],
Tcl_GetObjType ("int")) != TCL_OK)
goto badFnum;

bindFnum = FALSE;
srcChannelId = Tcl_GetStringFromObj (objv [1], NULL);
if (ISDIGIT (srcChannelId [0])) {
bindFnum = TRUE;
} else {
bindFnum = FALSE;
}
}
if (bindFnum) {
if (objc != 2)
Expand All @@ -245,14 +238,6 @@ TclX_DupObjCmd (ClientData clientData,
Tcl_GetChannelName (newChannel), -1);
return TCL_OK;

badFnum:
Tcl_ResetResult (interp);
TclX_AppendObjResult (interp, "invalid integer file number \"",
Tcl_GetStringFromObj (objv [1], NULL),
"\", expected unsigned integer or Tcl file id",
(char *) NULL);
return TCL_ERROR;

bind2ndArg:
TclX_AppendObjResult (interp, "the second argument, targetChannelId, ",
"is not allow when binding a file number to ",
Expand Down
6 changes: 3 additions & 3 deletions generic/tclXfcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ GetFcntlAttr (Tcl_Interp *interp, Tcl_Channel channel, int mode, int attrib)
value = (optValue == TCLX_BUFFERING_LINE);
break;
case ATTR_KEEPALIVE:
if (TclXOSgetsockopt (interp, channel, SO_KEEPALIVE, &value) != TCL_OK)
if (TclXOSgetsockopt (interp, channel, SO_KEEPALIVE, (socklen_t *) &value) != TCL_OK)
return TCL_ERROR;
break;
default:
panic ("bug in fcntl get attrib");
Tcl_Panic ("bug in fcntl get attrib");
value = 0; /* suppress compiler warning for initialized value */
}

Expand Down Expand Up @@ -260,7 +260,7 @@ SetFcntlAttrObj (Tcl_Interp *interp,
case ATTR_KEEPALIVE:
return TclXOSsetsockopt (interp, channel, SO_KEEPALIVE, value);
default:
panic ("buf in fcntl set attrib");
Tcl_Panic ("buf in fcntl set attrib");
}
return TCL_ERROR; /* Should never be reached */
}
Expand Down
4 changes: 2 additions & 2 deletions generic/tclXfilecmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ TclX_PipeObjCmd (ClientData clientData,
channelNames [1], (char *) NULL);
} else {
if (Tcl_ObjSetVar2(interp, objv[1], NULL, Tcl_NewStringObj(channelNames [0], -1),
TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL)
TCL_LEAVE_ERR_MSG) == NULL)
goto errorExit;

if (Tcl_ObjSetVar2(interp, objv[2], NULL,
Tcl_NewStringObj(channelNames [1], -1),
TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL)
TCL_LEAVE_ERR_MSG) == NULL)
goto errorExit;
}

Expand Down
7 changes: 1 addition & 6 deletions generic/tclXfilescan.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,12 +641,7 @@ ScanFile (Tcl_Interp *interp, scanContext_t *contextPtr, Tcl_Channel channel)

data.offset = (off_t) Tcl_Tell (channel);
Tcl_DStringSetLength (&lineBuf, 0);
if (Tcl_Gets (channel, &lineBuf) < 0) {
if (Tcl_Eof (channel) || Tcl_InputBlocked (channel))
goto scanExit;
Tcl_SetStringObj (Tcl_GetObjResult (interp),
Tcl_PosixError (interp), -1);
result = TCL_ERROR;
if (Tcl_Gets (channel, &lineBuf) < 0 || Tcl_Eof (channel) || Tcl_InputBlocked (channel) ) {
goto scanExit;
}

Expand Down
4 changes: 2 additions & 2 deletions generic/tclXgeneral.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ SetLoopCounter (Tcl_Interp *interp, char *varName, int idx)
{
Tcl_Obj *iObj, *newVarObj;

iObj = Tcl_GetVar2Ex(interp, varName, NULL, TCL_PARSE_PART1);
iObj = Tcl_GetVar2Ex(interp, varName, NULL, 0);
if ((iObj == NULL) || (Tcl_IsShared (iObj))) {
iObj = newVarObj = Tcl_NewLongObj (idx);
} else {
Expand All @@ -330,7 +330,7 @@ SetLoopCounter (Tcl_Interp *interp, char *varName, int idx)

Tcl_SetLongObj (iObj, idx);
if (Tcl_SetVar2Ex(interp, varName, NULL, iObj,
TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) {
TCL_LEAVE_ERR_MSG) == NULL) {
if (newVarObj != NULL) {
Tcl_DecrRefCount (newVarObj);
}
Expand Down
2 changes: 1 addition & 1 deletion generic/tclXhandles.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ TclX_HandleFree (void_pt headerPtr, void_pt entryPtr)

entryHdrPtr = HEADER_AREA (entryPtr);
if (entryHdrPtr->freeLink != ALLOCATED_IDX)
panic ("Tcl_HandleFree: entry not allocated %x\n", entryHdrPtr);
Tcl_Panic ("Tcl_HandleFree: entry not allocated %x\n", entryHdrPtr->freeLink);

entryHdrPtr->freeLink = tblHdrPtr->freeHeadIdx;
tblHdrPtr->freeHeadIdx =
Expand Down
8 changes: 4 additions & 4 deletions generic/tclXkeylist.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ DeleteKeyedListEntry (keylIntObj_t *keylIntPtr, int entryIdx)
if (keylIntPtr->hashTbl != NULL) {
Tcl_HashEntry *entryPtr;
Tcl_HashSearch search;
int nidx;
uintptr_t nidx;

entryPtr = Tcl_FindHashEntry(keylIntPtr->hashTbl,
keylIntPtr->entries [entryIdx].key);
Expand All @@ -354,7 +354,7 @@ DeleteKeyedListEntry (keylIntObj_t *keylIntPtr, int entryIdx)
*/
for (entryPtr = Tcl_FirstHashEntry(keylIntPtr->hashTbl, &search);
entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&search)) {
nidx = (int) Tcl_GetHashValue(entryPtr);
nidx = (uintptr_t) Tcl_GetHashValue(entryPtr);
if (nidx > entryIdx) {
Tcl_SetHashValue(entryPtr, (ClientData) (uintptr_t) (nidx - 1));
}
Expand Down Expand Up @@ -394,7 +394,7 @@ FindKeyedListEntry (keylIntObj_t *keylIntPtr,
char **nextSubKeyPtr)
{
char *keySeparPtr;
int keyLen, findIdx = -1;
uintptr_t keyLen, findIdx = -1;

keySeparPtr = strchr (key, '.');
if (keySeparPtr != NULL) {
Expand All @@ -416,7 +416,7 @@ FindKeyedListEntry (keylIntObj_t *keylIntPtr,
}
entryPtr = Tcl_FindHashEntry(keylIntPtr->hashTbl, key);
if (entryPtr != NULL) {
findIdx = (int) Tcl_GetHashValue(entryPtr);
findIdx = (uintptr_t) Tcl_GetHashValue(entryPtr);
}
if (keySeparPtr != NULL) {
key[keyLen] = tmp;
Expand Down
7 changes: 3 additions & 4 deletions generic/tclXlgets.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,7 @@ ReadListElement (Tcl_Interp *interp,

case '\\': {
char bsChar;

bsChar = Tcl_Backslash(p, &numChars);
Tcl_UtfBackslash(p, &numChars, &bsChar);
if (openBraces > 0) {
p += (numChars - 1); /* Advanced again at end of loop */
} else {
Expand Down Expand Up @@ -470,7 +469,7 @@ TclX_LgetsObjCmd (ClientData clientData,
int resultLen;

if (Tcl_ObjSetVar2(interp, objv[2], NULL, dataObj,
TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) == NULL) {
TCL_LEAVE_ERR_MSG) == NULL) {
goto errorExit;
}

Expand Down Expand Up @@ -512,7 +511,7 @@ TclX_LgetsObjCmd (ClientData clientData,
* FIX: Need functions to save/restore error state.
*/
if (Tcl_ObjSetVar2(interp, objv[2], NULL, dataObj,
TCL_PARSE_PART1|TCL_LEAVE_ERR_MSG) != NULL) {
TCL_LEAVE_ERR_MSG) != NULL) {
Tcl_SetObjResult (interp, saveResult); /* Restore old message */
}
Tcl_DecrRefCount (saveResult);
Expand Down
2 changes: 1 addition & 1 deletion generic/tclXlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ ProcessIndexFile (Tcl_Interp *interp,

if ((Tcl_SplitList (interp, lineBuffer.string, &lineArgc,
&lineArgv) != TCL_OK) || (lineArgc < 4))
goto formatError;
goto reachedEOF;

/*
* lineArgv [0] is the package name.
Expand Down
Loading