| Re: [AD] New patch for `const'-correctness |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
In reply to Peter Wang (Peter Wang <tjaden@xxxxxxxxxx>):
>There are a couple of references to `const' which I think should be
>`AL_CONST'.
You are right; that is me being lazy.
> Attached is another patch (against CVS) to be applied which
>fixes some `const'-related warnings on Linux/X. Tested by compiling
>with first with AL_CONST defined then not.
Out of interest, do you think it would be wiser to simply enable
AL_CONST for all compilers, only deselecting when it does not work?
Feedback from several people has indicated that all the compilers they
know about support const.
> Someone else will probably
>have to do the same for DOS and Windows.
No warnings on DOS / DJGPP (gcc 2.95.2).
>BTW, according to ahack, "(PTR*)" should be "(PTR *)".
Sorry; this is a C++ convention. Guess which language I write in? :-)
However, declaring pointers as:
type* ptr = 0;
and not
type *ptr = 0;
is better, since you can see that `*' is part of the typename and not
part of the variable (ie. the dereferencing operator). From some of the
source code I have looked at, many experienced C programmers also use
this notation.
On an off-topic note, is there some utility available for reformatting
whitespace? I find Allegro's source unreadable at times due to the way
the indentation jumps all over the place...
Bye for now,
--
Laurence Withers, lwithers@xxxxxxxxxx
http://www.lwithers.demon.co.uk/
Attachment:
signature.asc
Description: PGP signature
| Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |