Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Apr 2009 02:40:04 GMT
From:      "Mikhail T." <mi+thun@aldan.algebra.com>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/133555: fix for lang/tclX
Message-ID:  <200904100240.n3A2e40m003423@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/133555; it has been noted by GNATS.

From: "Mikhail T." <mi+thun@aldan.algebra.com>
To: bug-followup@FreeBSD.org, mitsuru@riken.jp
Cc:  
Subject: Re: ports/133555: fix for lang/tclX
Date: Thu, 09 Apr 2009 22:35:48 -0400

 This is a multi-part message in MIME format.
 --------------010308030905090308060705
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 I was looking at this problem at a different angle -- if the top-level
 Makefile does not see Tcl's man-pages, it will treat the situation as if
 NOPORTDOCS were specified. Can you check the attached diff, please? I
 think, it is simpler than yours... The diff also includes two new
 patches, which quite down some warnings (perhaps, even fix bugs).
 
 Thank you! Yours,
 
     -mi
 
 P.S. Sadly, simply switching to Tcl 8.5 is not an option -- one of the
 self-tests crashes with seg-fault, which is very bad... I wish, somebody
 fixed /that/...
 
 --------------010308030905090308060705
 Content-Type: text/plain;
  name="tclX-ubreak.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="tclX-ubreak.diff"
 
 Index: Makefile
 ===================================================================
 RCS file: /home/pcvs/ports/lang/tclX/Makefile,v
 retrieving revision 1.60
 diff -U2 -r1.60 Makefile
 --- Makefile	16 Mar 2009 23:03:12 -0000	1.60
 +++ Makefile	10 Apr 2009 02:33:54 -0000
 @@ -8,5 +8,5 @@
  PORTNAME=	tclX
  PORTVERSION=	8.4
 -PORTREVISION=	1
 +PORTREVISION=	2
  CATEGORIES=	lang tcl devel
  MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 @@ -17,6 +17,4 @@
  COMMENT=	Extended TCL
  
 -BROKEN=		does not compile
 -
  USE_BZIP2=	yes
  USE_TCL_BUILD=	84
 @@ -31,10 +29,6 @@
  		--with-tcl="${TCL_LIBDIR}"
  PLIST_SUB=	TCLX_VER=${PORTVERSION}
 -ALL_TARGET=	binaries libraries	# test
 +ALL_TARGET=	-j`${SYSCTL} -n hw.ncpu` binaries libraries	# test
  INSTALL_TARGET=	install-binaries install-libraries
 -.ifndef(NOPORTDOCS)
 -ALL_TARGET+=	doc
 -INSTALL_TARGET+=install-help
 -.endif
  
  MAN3=	CmdWrite.3 Handles.3 Keylist.3 ObjCmdWrite.3 TclXInit.3
 @@ -75,2 +69,9 @@
  
  .include <bsd.port.post.mk>
 +
 +.ifndef(NOPORTDOCS) && exists(${MANPREFIX}/man/mann/Tcl.n.gz)
 +ALL_TARGET+=	doc
 +INSTALL_TARGET+=install-help
 +.else
 +PLIST_SUB:=	${PLIST_SUB:NPORTDOCS=*} PORTDOCS='@comment '
 +.endif
 Index: files/patch-const
 ===================================================================
 RCS file: files/patch-const
 diff -N files/patch-const
 --- /dev/null	1 Jan 1970 00:00:00 -0000
 +++ files/patch-const	10 Apr 2009 02:33:54 -0000
 @@ -0,0 +1,184 @@
 +Submitted to TclX developers as:
 +
 +https://sourceforge.net/tracker/index.php?func=detail&aid=2687373&group_id=13247&atid=313247
 +
 +	-mi
 +
 +--- generic/tclExtend.h	2002-09-25 20:23:29.000000000 -0400
 ++++ generic/tclExtend.h	2009-03-14 17:57:46.000000000 -0400
 +@@ -123,19 +123,19 @@
 + EXTERN int	TclX_KeyedListGet _ANSI_ARGS_((Tcl_Interp *interp,
 + 			       Tcl_Obj	  *keylPtr,
 +-			       char	  *key,
 ++			       const char *key,
 + 			       Tcl_Obj	 **valuePtrPtr));
 + 
 + EXTERN int	TclX_KeyedListSet _ANSI_ARGS_((Tcl_Interp *interp,
 + 			       Tcl_Obj	  *keylPtr,
 +-			       char	  *key,
 ++			       const char *key,
 + 			       Tcl_Obj	  *valuePtr));
 + 
 + EXTERN int	TclX_KeyedListDelete _ANSI_ARGS_((Tcl_Interp *interp,
 + 				  Tcl_Obj    *keylPtr,
 +-				  char	     *key));
 ++				  const char *key));
 + 
 + EXTERN int	TclX_KeyedListGetKeys _ANSI_ARGS_((Tcl_Interp *interp,
 + 				   Tcl_Obj    *keylPtr,
 +-				   char	      *key,
 ++				   const char *key,
 + 				   Tcl_Obj   **listObjPtrPtr));
 + 
 +--- generic/tclXkeylist.c	2005-11-21 13:54:13.000000000 -0500
 ++++ generic/tclXkeylist.c	2009-03-15 00:43:31.000000000 -0400
 +@@ -121,9 +121,9 @@
 + 				  int		entryIdx));
 + 
 +-static int
 ++static intptr_t
 + FindKeyedListEntry _ANSI_ARGS_((keylIntObj_t *keylIntPtr,
 +-				char	     *key,
 ++				const char   *key,
 + 				int	     *keyLenPtr,
 +-				char	    **nextSubKeyPtr));
 ++				const char  **nextSubKeyPtr));
 + 
 + static void
 +@@ -342,5 +342,5 @@
 +     int		  entryIdx;
 + {
 +-    int idx;
 ++    intptr_t idx;
 + 
 + #ifndef NO_KEYLIST_HASH_TABLE
 +@@ -348,5 +348,5 @@
 + 	Tcl_HashEntry *entryPtr;
 + 	Tcl_HashSearch search;
 +-	int nidx;
 ++	intptr_t nidx;
 + 
 + 	entryPtr = Tcl_FindHashEntry(keylIntPtr->hashTbl,
 +@@ -364,5 +364,5 @@
 + 	for (entryPtr = Tcl_FirstHashEntry(keylIntPtr->hashTbl, &search);
 + 	     entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&search)) {
 +-	    nidx = (int) Tcl_GetHashValue(entryPtr);
 ++	    nidx = (intptr_t) Tcl_GetHashValue(entryPtr);
 + 	    if (nidx > entryIdx) {
 + 		Tcl_SetHashValue(entryPtr, (ClientData) (nidx - 1));
 +@@ -397,13 +397,14 @@
 +  *-----------------------------------------------------------------------------
 +  */
 +-static int
 ++static intptr_t
 + FindKeyedListEntry (keylIntPtr, key, keyLenPtr, nextSubKeyPtr)
 +     keylIntObj_t *keylIntPtr;
 +-    char	 *key;
 ++    const char	 *key;
 +     int		 *keyLenPtr;
 +-    char	**nextSubKeyPtr;
 ++    const char	**nextSubKeyPtr;
 + {
 +-    char *keySeparPtr;
 +-    int keyLen, findIdx = -1;
 ++    const char *keySeparPtr;
 ++    int keyLen;
 ++    intptr_t findIdx = -1;
 + 
 +     keySeparPtr = strchr (key, '.');
 +@@ -417,18 +418,17 @@
 +     if (keylIntPtr->hashTbl != NULL) {
 + 	Tcl_HashEntry *entryPtr;
 +-	char tmp = key[keyLen];
 ++	char *tmp;
 ++	const char *_key;
 ++
 + 	if (keySeparPtr != NULL) {
 +-	    /*
 +-	     * A few extra guards in setting this, as if we are passed
 +-	     * a const char, this can crash.
 +-	     */
 +-	    key[keyLen] = '\0';
 +-	}
 +-	entryPtr = Tcl_FindHashEntry(keylIntPtr->hashTbl, key);
 ++	    tmp = alloca(keyLen + 1);
 ++	    strncpy(tmp, key, keyLen);
 ++	    tmp[keyLen] = '\0';
 ++	    _key = tmp;
 ++	} else
 ++	    _key = key;
 ++	entryPtr = Tcl_FindHashEntry(keylIntPtr->hashTbl, _key);
 + 	if (entryPtr != NULL) {
 +-	    findIdx = (int) Tcl_GetHashValue(entryPtr);
 +-	}
 +-	if (keySeparPtr != NULL) {
 +-	    key[keyLen] = tmp;
 ++	    findIdx = (intptr_t)Tcl_GetHashValue(entryPtr);
 + 	}
 +     }
 +@@ -556,5 +556,6 @@
 +     keylEntry_t *keyEntryPtr;
 +     char *key;
 +-    int keyLen, idx, objc, subObjc;
 ++    int keyLen, objc, subObjc;
 ++    intptr_t idx;
 +     Tcl_Obj **objv, **subObjv;
 + #ifndef NO_KEYLIST_HASH_TABLE
 +@@ -720,9 +721,9 @@
 +     Tcl_Interp *interp;
 +     Tcl_Obj    *keylPtr;
 +-    char       *key;
 ++    const char *key;
 +     Tcl_Obj   **valuePtrPtr;
 + {
 +     keylIntObj_t *keylIntPtr;
 +-    char *nextSubKey;
 ++    const char *nextSubKey;
 +     int findIdx;
 + 
 +@@ -775,11 +776,12 @@
 +     Tcl_Interp *interp;
 +     Tcl_Obj    *keylPtr;
 +-    char       *key;
 ++    const char *key;
 +     Tcl_Obj    *valuePtr;
 + {
 +     keylIntObj_t *keylIntPtr;
 +     keylEntry_t *keyEntryPtr;
 +-    char *nextSubKey;
 +-    int findIdx, keyLen, status = TCL_OK;
 ++    const char *nextSubKey;
 ++    intptr_t findIdx;
 ++    int keyLen, status = TCL_OK;
 +     Tcl_Obj *newKeylPtr;
 + 
 +@@ -901,9 +903,10 @@
 +     Tcl_Interp *interp;
 +     Tcl_Obj    *keylPtr;
 +-    char       *key;
 ++    const char *key;
 + {
 +     keylIntObj_t *keylIntPtr, *subKeylIntPtr;
 +-    char *nextSubKey;
 +-    int findIdx, status;
 ++    const char *nextSubKey;
 ++    intptr_t findIdx;
 ++    int status;
 + 
 +     if (Tcl_ConvertToType (interp, keylPtr, &keyedListType) != TCL_OK)
 +@@ -975,11 +978,12 @@
 +     Tcl_Interp *interp;
 +     Tcl_Obj    *keylPtr;
 +-    char       *key;
 ++    const char *key;
 +     Tcl_Obj   **listObjPtrPtr;
 + {
 +     keylIntObj_t *keylIntPtr;
 +     Tcl_Obj *listObjPtr;
 +-    char *nextSubKey;
 +-    int idx, findIdx;
 ++    const char *nextSubKey;
 ++    int idx;
 ++    intptr_t findIdx;
 + 
 +     if (Tcl_ConvertToType (interp, keylPtr, &keyedListType) != TCL_OK)
 Index: files/patch-intptr
 ===================================================================
 RCS file: files/patch-intptr
 diff -N files/patch-intptr
 --- /dev/null	1 Jan 1970 00:00:00 -0000
 +++ files/patch-intptr	10 Apr 2009 02:33:54 -0000
 @@ -0,0 +1,124 @@
 +Submitted to TclX developers as:
 +
 +https://sourceforge.net/tracker/index.php?func=detail&aid=2687373&group_id=13247&atid=313247
 +
 +	-mi
 +
 +--- unix/tclXunixDup.c	2001-10-24 19:31:50.000000000 -0400
 ++++ unix/tclXunixDup.c	2009-03-14 18:01:57.000000000 -0400
 +@@ -98,5 +98,5 @@
 +         Tcl_GetChannelHandle (srcChannel, TCL_WRITABLE, &handle);
 +     }
 +-    srcFileNum = (int) handle;
 ++    srcFileNum = (int)(intptr_t)handle;
 +     channelType = Tcl_GetChannelType (srcChannel);
 + 
 +@@ -134,7 +134,7 @@
 +     
 +     if (STREQU (channelType->typeName, "tcp")) {
 +-        newChannel = Tcl_MakeTcpClientChannel ((ClientData) newFileNum);
 ++        newChannel = Tcl_MakeTcpClientChannel ((ClientData)(intptr_t)newFileNum);
 +     } else {
 +-        newChannel = Tcl_MakeFileChannel ((ClientData) newFileNum,
 ++        newChannel = Tcl_MakeFileChannel ((ClientData)(intptr_t)newFileNum,
 +                                           mode);
 +     }
 +@@ -231,7 +231,7 @@
 + 
 +     if (isSocket) {
 +-        channel = Tcl_MakeTcpClientChannel ((ClientData) fileNum);
 ++        channel = Tcl_MakeTcpClientChannel ((ClientData)(intptr_t)fileNum);
 +     } else {
 +-        channel = Tcl_MakeFileChannel ((ClientData) fileNum,
 ++        channel = Tcl_MakeFileChannel ((ClientData)(intptr_t)fileNum,
 +                                        mode);
 +     }
 +--- generic/tclExtdInt.h	2005-07-12 15:03:15.000000000 -0400
 ++++ generic/tclExtdInt.h	2009-03-14 20:54:32.000000000 -0400
 +@@ -517,5 +517,5 @@
 +                                Tcl_Channel channel,
 +                                void       *sockaddr,
 +-                               int         sockaddrSize));
 ++                               socklen_t   sockaddrSize));
 + 
 + extern int
 +@@ -523,5 +523,5 @@
 +                                Tcl_Channel channel,
 +                                void       *sockaddr,
 +-                               int         sockaddrSize));
 ++                               socklen_t   sockaddrSize));
 + 
 + extern int
 +--- unix/tclXunixOS.c	2005-07-12 15:03:15.000000000 -0400
 ++++ unix/tclXunixOS.c	2009-03-14 20:53:03.000000000 -0400
 +@@ -118,5 +118,5 @@
 + 	}
 +     }
 +-    return (int) handle;
 ++    return (intptr_t)handle;
 + }
 + 
 +@@ -248,9 +248,9 @@
 +         return TCL_ERROR;
 +     }
 +-    channels [0] = Tcl_MakeFileChannel ((ClientData) fileNums [0],
 ++    channels [0] = Tcl_MakeFileChannel ((ClientData)(intptr_t)fileNums [0],
 +                                         TCL_READABLE);
 +     Tcl_RegisterChannel (interp, channels [0]);
 + 
 +-    channels [1] = Tcl_MakeFileChannel ((ClientData) fileNums [1],
 ++    channels [1] = Tcl_MakeFileChannel ((ClientData)(intptr_t)fileNums [1],
 +                                         TCL_WRITABLE);
 +     Tcl_RegisterChannel (interp, channels [1]);
 +@@ -958,5 +958,5 @@
 +     Tcl_Channel channel;
 +     void       *sockaddr;
 +-    int         sockaddrSize;
 ++    socklen_t   sockaddrSize;
 + {
 + 
 +@@ -988,5 +988,5 @@
 +     Tcl_Channel channel;
 +     void       *sockaddr;
 +-    int         sockaddrSize;
 ++    socklen_t   sockaddrSize;
 + {
 +     if (getsockname (ChannelToFnum (channel, 0),
 +@@ -1019,5 +1019,5 @@
 +     int         *valuePtr;
 + {
 +-    int valueLen = sizeof (*valuePtr);
 ++    socklen_t valueLen = sizeof (*valuePtr);
 + 
 +     if (getsockopt (ChannelToFnum (channel, 0), SOL_SOCKET, option, 
 +@@ -1486,5 +1486,5 @@
 +         return TCL_ERROR;
 +     }
 +-    *fnumPtr = (int) handle;
 ++    *fnumPtr = (intptr_t)handle;
 +     return TCL_OK;
 + }
 +--- unix/tclXunixSock.c	2004-11-22 19:13:14.000000000 -0500
 ++++ unix/tclXunixSock.c	2009-03-14 20:59:08.000000000 -0400
 +@@ -95,5 +95,5 @@
 +     Tcl_Channel channel;
 + 
 +-    channel = Tcl_MakeTcpClientChannel ((ClientData) socketFD);
 ++    channel = Tcl_MakeTcpClientChannel ((ClientData)(intptr_t)socketFD);
 +     Tcl_RegisterChannel (interp, channel);
 + 
 +@@ -225,5 +225,5 @@
 +         goto unixError;
 + 
 +-    channel = Tcl_MakeTcpClientChannel ((ClientData) socketFD);
 ++    channel = Tcl_MakeTcpClientChannel ((ClientData)(intptr_t)socketFD);
 +     Tcl_RegisterChannel (interp, channel);
 + 
 +@@ -267,5 +267,6 @@
 +     Tcl_Channel          channel;
 +     unsigned             options;
 +-    int                  acceptSocketFD, addrLen;
 ++    int                  acceptSocketFD;
 ++    socklen_t            addrLen;
 +     int                  socketFD = -1;
 +     int                  nextArg;
 
 --------------010308030905090308060705--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200904100240.n3A2e40m003423>