From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11853 invoked by alias); 8 Aug 2012 13:37:16 -0000 Received: (qmail 11768 invoked by uid 22791); 8 Aug 2012 13:37:14 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from outdoor.onevision.de (HELO outdoor.onevision.de) (212.77.172.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 08 Aug 2012 13:37:00 +0000 Received: from sanders.onevision.de (moonrace [212.77.172.62]) by outdoor.onevision.de (8.14.3/8.13.7/ROSCH/DDB) with ESMTP id q78DamHF015392; Wed, 8 Aug 2012 15:36:54 +0200 Received: from [192.168.5.32] ([192.168.5.32]) by sanders.onevision.de (Lotus Domino Release 8.5.1FP3) with ESMTP id 2012080815364375-116582 ; Wed, 8 Aug 2012 15:36:43 +0200 Message-ID: <50226B6B.9030208@onevision.com> Date: Wed, 08 Aug 2012 13:37:00 -0000 From: Roland Schwingel User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: insight@sourceware.org, Keith Seitz Subject: Re: [PATCH] libgui: Make it compileable on windows with recent gcc versions and also on win64 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-15; format=flowed Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org X-SW-Source: 2012-q3/txt/msg00003.txt.bz2 Hi, Finally I found some air to commit this... Keith Seitz wrote on 04.06.2012 03:13:15: > Thanks for the patch. I only have a (very) minor few nits... I addressed all of your notes beside of 2 (see below). > > @@ -631,6 +638,31 @@ > > (rowPtr), (colPtr)) > > > > /* > > + * Macros used to cast between pointers and integers (e.g. when > storing an int > > + * in ClientData), on 64-bit architectures they avoid gcc warning > about "cast > > + * to/from pointer from/to integer of different size". > > + */ > > + > > +#if !defined(INT2PTR)&& !defined(PTR2INT) > > +# if defined(HAVE_INTPTR_T) || defined(intptr_t) > > +# define INT2PTR(p) ((void *)(intptr_t)(p)) > > +# define PTR2INT(p) ((int)(intptr_t)(p)) > > +# else > > +# define INT2PTR(p) ((void *)(p)) > > +# define PTR2INT(p) ((int)(p)) > > +# endif > > +#endif > > +#if !defined(UINT2PTR)&& !defined(PTR2UINT) > > +# if defined(HAVE_UINTPTR_T) || defined(uintptr_t) > > +# define UINT2PTR(p) ((void *)(uintptr_t)(p)) > > +# define PTR2UINT(p) ((unsigned int)(uintptr_t)(p)) > > +# else > > +# define UINT2PTR(p) ((void *)(p)) > > +# define PTR2UINT(p) ((unsigned int)(p)) > > +# endif > > +#endif > > I'm not going to force this file to the GNU Coding Standard. > Just please be consistent with the surrounding code. For example, > "!defined(INT2PTR) && !defined(PTR2INT)" seems more natural. I left this on purpose as the above construct was directly taken from tcl itself and I would like to see this to be in sync for better overview. The definition is done if you compile against older tcl which has some of these definitions not in place. > > diff -ruN libgui_orig/src/tkWinPrintText.c libgui/src/tkWinPrintText.c > > --- libgui_orig/src/tkWinPrintText.c 2001-09-09 00:34:48.000000000 +0200 > > +++ libgui/src/tkWinPrintText.c 2012-03-22 13:56:42.037502500 +0100 > > +#if (TCL_MAJOR_VERSION>= 8)&& (TCL_MINOR_VERSION>= 5) > > + numLines = TkBTreeNumLines(textPtr->sharedTextPtr->tree,textPtr); > > + TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, textPtr, 0,0,&first); > > + TkTextMakeByteIndex(textPtr->sharedTextPtr->tree, textPtr, > numLines, 100,&last); > > + TkTextChanged(textPtr->sharedTextPtr, textPtr,&first,&last); > > +#elif (TCL_MAJOR_VERSION>= 8)&& (TCL_MINOR_VERSION>= 1) > > numLines = TkBTreeNumLines(textPtr->tree); > > -#if (TCL_MAJOR_VERSION>= 8)&& (TCL_MINOR_VERSION>= 1) > > TkTextMakeByteIndex(textPtr->tree, 0, 0,&first); > > TkTextMakeByteIndex(textPtr->tree, numLines, 100,&last); > > + TkTextChanged(textPtr,&first,&last); > > #else > > + numLines = TkBTreeNumLines(textPtr->tree); > > TkTextMakeIndex(textPtr->tree, 0, 0,&first); > > TkTextMakeIndex(textPtr->tree, numLines, 100,&last); > > -#endif > > TkTextChanged(textPtr,&first,&last); > > - > > +#endif > > /* > > * Set the display info flag to out-of-date. > > */ > > I'd like to see spaces before/after "&&", "||", ">", "<", ">=", etc. > This happens in a few places. This might have been an issue of your editor in my patch it appeared to be correct. (????) As already outlined some time ago this patch is just a first starting point in cleaning up libgui to ensure compileability with newer tcl/tk versions and current mingw/mingw-w64 compilers. Roland