> #define ARC_LOOP(element) do { \
> Cardinal n; \
> ArcTypePtr arc; \
> for (n = (element)->ArcN-1; n != -1; n--) \
> { \
> arc = &(element)->Arc[n]
> Question: Shouldn't the ARC_LOOP look like the following snippet ?
> #define ARC_LOOP(layer) do { \
> Cardinal n; \
> ArcTypePtr arc; \
> for (n = (layer)->ArcN-1; n != -1; n--) \
> { \
> arc = &(layer)->Arc[n]
There is no semantic difference between the two; changing a formal
parameter name in a macro never changes the semantics, provided neither
name occurs elsewhere in the macro expansion (and, possibly, also
provided neither is a reserved word, though I'd have to check carefully
to be sure that matters).
> As it is now, ARC_LOOP and ELEMENTARC_LOOP both only work on
> elements, while ARC_LOOP probably should work on layers.
Actually, either one works on anything with suitable ArcN and Arc
fields; the only difference between them is a human-level difference.
Which is not to say that the human-level difference is negligible.
When I write
#define MAX_LINE_SIZE 1024
and
#define FLG_SAW_EOF 0x00000400
I consider it a bug to use one of those where I mean the other, even
though the semantics are identical as far as the language is concerned.
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML [EMAIL PROTECTED]
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev