POV-Ray : Newsgroups : povray.programming : A little trouble with structs Server Time
23 Dec 2024 11:29:53 EST (-0500)
  A little trouble with structs (Message 1 to 2 of 2)  
From: Slime
Subject: A little trouble with structs
Date: 18 Oct 2002 19:51:06
Message: <3db09e6a$1@news.povray.org>
My experience with C is limited to what I've seen in the POV-Ray source
code. (Most of my programming experience is in C++.) As a result, this
typecasting of structs into other types of structs is confusing to me.
Anyway, is there a simple explanation for the fact that whenever I add a
property to something like OBJECT_FIELDS, I get an error in some random
place when another property of OBJECT_FIELDS is accessed?

Specifically, I added a DBL into OBJECT_FIELDS:

#define OBJECT_FIELDS        \
  ...
  SNGL Ph_Density;           \
  DBL My_DBL; \
  unsigned long Flags;

And then, later in the code, when I try to render a scene, a line in
parse.cpp causes an error:

  if (Object->Type & LT_SRC_UNION_OBJECT)

Obviously I'm screwing up the Object struct somehow, and it must have to do
with some sort of subtle memory issue. Is this something that someone could
easily explain? I'd appreciate any help anyone could give as to what causes
this.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

From: Slime
Subject: Re: A little trouble with structs
Date: 18 Oct 2002 20:23:45
Message: <3db0a611$1@news.povray.org>
Oooh, I'm sorry... Apparently frame.h wasn't getting built, so it was trying
to use the old Object definition with new code. Rebuilding all made it work.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

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