On 04/10/18 02:40, Antonio Scuri wrote:
  Hi,

  I may have solve the problem. At least at the system I was testing were
the problem is reproduced using that sample it was solved.

  It is on SVN. But it is actually very simple in iupgtk_dialog.c:

#define iupABS(_x) ((_x)<0? -(_x): (_x))
[...]

G'day,

Note that this macro evaluates its argument twice, which may be a
problem if its parameter has side effects (e.g. calls a
third-party function, or perhaps is something like iupABS(c++).
Modern compilers are quite capable of inlining short functions,
(I believe that gcc now virtually ignores the "inline" keyword,
and simply uses its own heuristics), and so there would be no loss
of efficiency in coding it as a short function, where it is
guaranteed to only be evaluated once.

Also, there's no need to have an underscore on a argument name
within a macro parameter list, and, while it is valid ISO
C/POSIX.1, my personal preference is to see the underscore-prefix
namespace strictly reserved for external toolchain/OS use, even
in cases such as this where it conforms -- my eyes still do a
double-take.  (See gcc's Info manual, Section 1.3.3, "Reserved
Names", for a detailed discussion of this... there's quite a bit
of stuff there that surprised me, mainly in possible future name
formats that may be claimed by future standards revisions.)

cheers,

s-b etc.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to