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

Re: gEDA-user: PCB Patches: Use c99 bool instead of manual typedef.



Yo,

I wrote:
> Advantages:
>       * Compiler is able to perform optimisations specific to the bool
>         type.

ineiev wrote:
> Yes, it is. I don't think the gain will be noticeable, though.
> PCB data are mostly ints, and pointers, and floats, and doubles.

The point is that there's this patch sitting here that does it.  I've
done the conversion work so no-one else has to.  No matter how small a
performance increase it gives, it can be implemented quite cheaply now.

I wrote:
>       * Crucially for me, any code in PCB used outside PCB's source
>         doesn't have to have this additional "Boolean" type cluttering
>         the place up.

ineiev wrote:
> Will "Boolean" conflict with your sources? are not you going
> to use other PCB types?

I'm working on making a PCB library that exposes PCB's element file
parsing and writing.  Having a library who's headers define the type
"Boolean" is completely superfluous.  If another library writer takes
the same attitude as you (seem) to be taking and it's included in the
same program as this PCB library, then these typedefs will conflict.

Why have a library provide a "Boolean" type when there's already a
perfectly good bool type ready for everyone to use?  Why should this
wheel be re-invented in PCB's sources?

> > On closer inspection, the build scripts in PCB don't specifically
> > require C99.  I was looking at the arguments it was feeding to the
> > compiler.  What I said earlier in this thread about adding
> > AC_HEADER_STDBOOL still applies. 
> 
> Your patches don't implement it.

No, I never said they did.  Here's what I said about this earlier in
this thread:

        if this does actually come up as an issue then I suggest we
        conditionally enable the typedef using the autoconf
        AC_HEADER_STDBOOL macro and some cpp guff

The key word being "if".  If and when the issue arises, then we fix it.
You'll also note that my patch doesn't include any things to make sure
that it compiles on a VAX ;)  If and when someone has an issue compiling
it on a VAX, then it gets fixed, not before!

> > (Also note that C99 introduced the ubiquitous '//' inline comment into
> > the C standard.)
> 
> True. oh, please don't replace all C-style comments
> with C++-style ones in PCB! it will be a real pain for some people
> on the list to rebase their local patch sets against new
> master HEAD.

You've misunderstood.  I was pointing out that this _C99_ feature is
already in use in the PCB source code, not that it should be changed to
be compliant with C89 (my bet is that exceptionally few PCB builders use
a C89 compiler).

What are the advantages of keeping this Boolean typedef?

Cheers,

Rob

Attachment: signature.asc
Description: This is a digitally signed message part


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user