Re: SF.net SVN: vnc-tight:[3337] trunk/win/vncviewer/DesktopWindow.cxx

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: SF.net SVN: vnc-tight:[3337] trunk/win/vncviewer/DesktopWindow.cxx

Adam Tkac
On Tue, Dec 09, 2008 at 11:17:28AM +0000, [hidden email] wrote:

> Revision: 3337
>           http://vnc-tight.svn.sourceforge.net/vnc-tight/?rev=3337&view=rev
> Author:   astrand
> Date:     2008-12-09 11:17:28 +0000 (Tue, 09 Dec 2008)
>
> Log Message:
> -----------
> MinGW tweak: use __rfbmax/__rfbmin instead of max/min, just like most
> other files. (There are other variants in use as well: vncmax/vncmin,
> max/min, MAX/MIN.)
>

Sorry about pedantry but symbols which start with __ should not be
used in client programs AFAIK. They are reserved for usage in kernel
space or in standard C/C++ library.

I think we should prefer min/max macros. In C++ code they are already
defined in STL and in C code we can define simple macro.

Regards, Adam

--
Adam Tkac, Red Hat, Inc.

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
VNC-Tight-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vnc-tight-devel
Reply | Threaded
Open this post in threaded view
|

Re: SF.net SVN: vnc-tight:[3337] trunk/win/vncviewer/DesktopWindow.cxx

astrand (Bugzilla)
On Tue, 9 Dec 2008, Adam Tkac wrote:

Hi,

> > MinGW tweak: use __rfbmax/__rfbmin instead of max/min, just like most
> > other files. (There are other variants in use as well: vncmax/vncmin,
> > max/min, MAX/MIN.)
> >
>
> Sorry about pedantry but symbols which start with __ should not be
> used in client programs AFAIK. They are reserved for usage in kernel
> space or in standard C/C++ library.
>
> I think we should prefer min/max macros. In C++ code they are already
> defined in STL and in C code we can define simple macro.
I know about the __ reservation and basically agrees with you, but I
figured it was best to use the most commonly used macros in this source
tree. Also, it's not just a matter of activating STL, since STL has
additional requirements: It complains if you are mixing unsigned/signed,
for example, if I remember correctly.

In any case, feel free to clean this up, if you want. We should also
replace the other variants (vncmax etc), so that we are using the same
macros everywhere.


Best regards,
---
Peter Åstrand ThinLinc Chief Developer
Cendio AB http://www.cendio.com
Wallenbergs gata 4
583 30 Linköping Phone: +46-13-21 46 00
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
VNC-Tight-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/vnc-tight-devel