Re: inconsistency in PROP_TYPE macro declarations ...



On 4/29/07, Lars Clausen <lars raeder dk> wrote:

On Tue, 2007-04-24 at 10:29 +0530, Sameer Sahasrabuddhe wrote:
>
> Also, do_set_props_from_offsets() searches for a matching offset for
> each property that it tries to set. It ignores if no offset is found.
> Should we introduce an assertion instead? It might not work if there
> is code that tries to set a property without really checking if it is
> defined. We could a throw a warning in that case, but that could
> result in a lot of clutter on stderr.

Definitely not an assertion, that's way too brutal.  A warning may be a
good idea, and then a round of fixing the current ones.

I think I have a mid-way solution that should do the trick. I have
modified the above function, so that it asserts that the type is same
for a property and its offset, if the name matches. This implies that
across all objects in a diagram, if two objects declare a property
with the same name, then the type should also be the same.

Attaching a patch. Please comment! I think this is a good thing for
general peace of mind when changing property types.

Sameer.
--
Research Scholar, KReSIT, IIT Bombay
http://www.it.iitb.ac.in/~sameerds/

Attachment: offset_assert.patch
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]