POV-Ray : Newsgroups : povray.programming : A little trouble with structs : A little trouble with structs Server Time
28 Jul 2024 06:18:34 EDT (-0400)
  A little trouble with structs  
From: Slime
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

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