POV-Ray : Newsgroups : povray.bugreports : Bug in #default directive parsing Server Time
14 May 2024 18:52:44 EDT (-0400)
  Bug in #default directive parsing (Message 1 to 1 of 1)  
From: Christophe Bouffartigue
Subject: Bug in #default directive parsing
Date: 8 Mar 2001 18:37:32
Message: <3aa817bc@news.povray.org>
Hi all.

There's a bug in the #default directive parsing, that may be put in
evidence with the following code:

#declare Use_Rad = off;

#if (Use_Rad = off)
#debug "\nUse_Rad = off\n"
#default { texture { finish { ambient 0.4 diffuse 0.6 } } }
#else
#debug "\nUse_Rad = on\n"
#default { texture { finish { ambient 0.0 diffuse 1.0 } } }
#end

camera {
  location <1, 2, -6>
  look_at <0, 1, 0>
}
plane { y, 0
  texture {
    pigment { checker color rgb 0, color rgb 1 }
  }
}
sphere { y, 1
  texture {
    pigment { color rgb <1, .2, .2> }
  }
}
light_source { <10, 10, -10>, color rgb 1 }


Whether Use_Rad is on or off, the default texture applied is always the
seconde one.

Vahur Krouverk found that the bug is in tokenize.c:

    CASE (DEFAULT_TOKEN)
+      if (Skipping)
+      {
+          UNGET
+          EXIT
+      }
+      else
+      {
          Parse_Default();
          EXIT
+      }
    END_CASE

The lines with a "+" must be added to correct the bug.

He also saw that this bug is present with INIT_SPLINE_TOKEN, etc...

Bye.

Bouf.


Post a reply to this message

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