POV-Ray : Newsgroups : povray.beta-test : Sphere sweep: Experimental version : Re: Sphere sweep: Experimental version Server Time
18 Apr 2024 23:22:00 EDT (-0400)
  Re: Sphere sweep: Experimental version  
From: clipka
Date: 16 May 2017 07:25:01
Message: <web.591ae15988adb668350257320@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> On 05/15/2017 12:46 PM, clipka wrote:
> > Folks,
> >
> > I'm trying out a new approach at fixing the sphere sweep issues; please
> > give this version a thorough test:
> >
> > https://github.com/POV-Ray/povray/tree/experimental/sphere_sweep
> >
> > I'll build Windows binaries as soon as I find the time.
> >
> Christoph,
>
> Isn't your use of 'i' in the for loop at line 627 of spheresweep.cpp
> muddling with the 'i' (DBL) used later at line 648 ?

I confess I didn't pay attention to that, but it shouldn't be a problem, as the
C++ standard is pretty clear about what should happen in this situation: The
scope of any variable declared in a `for` statement is limited to that `for`
statement.

If I remember correctly, in old versions of MSVC the scope of such variables
would continue after the loop, but modern versions are standard-compliant by
default.


But yes, it might be prettier to rename that variable to `n` instead.


Post a reply to this message

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