Hi everybody ,
Just want to know how "to get out of" for (pp=PartHeadp->pt_forw; pp != PartHeadp; pp = pp->pt_forw)
pp= PartHeadp; doesn't work .
Sorry for my english.
Where'd you get the struct partition from? Testing for pp != PartHeadp is sufficient on a ray-trace partition hit callback. If that's not working, you probably have a mistake somewhere else.
(note you said pp= PartHeadp which is an assignment that will always be true)
"man librt" or "brlman librt" has an example of a hit callback that iterates over the partitions (although it's old, see raytrace.h for the current callback signature).
Timothy Van Ruitenbeek
If you are trying to exit the for loop early, setting "pp = PartHeadp" inside the loop won't work because the increment part of the for loop will execute before the test. That means "pp = pp->pt_forw" will be executed before the test "pp != PartHeadp".
If you don't have nested loops, using "break" should work for you instead of "pp = PartHeadp"