POV-Ray : Newsgroups : povray.general : pov source gcc3 problem : Re: pov source gcc3 problem Server Time
6 Aug 2024 02:19:57 EDT (-0400)
  Re: pov source gcc3 problem  
From: Warp
Date: 6 Aug 2002 22:23:21
Message: <3d508498@news.povray.org>
Pandora <pan### [at] pandora-softwarecom> wrote:
>     Which you can fix with brackets (which also fixes all other problems,

  Wrong. It doesn't fix the max(i++, j++) problem.

> the efficiency issue (which'll more often than not get handled by
> an optimising compiler anyway)).

  Wrong. For example if you call a function to get the value of the
parameter, eg. max(function1(), function2()), the compiler can't optimize
that double call away unless it can inline the function in question. If
it can't inline the function, it can't know if the function will return
a different value at the second call. If it takes a considerable amount of
time to execute these functions, time will be wasted in calling them twice.
(And if the function *does* return a different value when called again, the
whole max() macro will simply give the wrong result for the exact same reason
as the max(i++, j++) gives a wrong result.)
  Using the template solution fixes all problems.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.