public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Roland Schwingel <roland@onevision.com>
To: insight@sourceware.org, Keith Seitz <keiths@redhat.com>
Subject: Re: [PATCH] libgui: Make it compileable on windows with recent gcc versions and also on win64
Date: Wed, 08 Aug 2012 13:37:00 -0000	[thread overview]
Message-ID: <50226B6B.9030208@onevision.com> (raw)

Hi,

Finally I found some air to commit this...

Keith Seitz <keiths@redhat.com> 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

             reply	other threads:[~2012-08-08 13:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-08 13:37 Roland Schwingel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-05-25 12:00 Roland Schwingel
2012-06-04  1:13 ` Keith Seitz
2012-03-23 10:22 Roland Schwingel
2012-05-24 21:35 ` Keith Seitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50226B6B.9030208@onevision.com \
    --to=roland@onevision.com \
    --cc=insight@sourceware.org \
    --cc=keiths@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).