Hello all,
I have some discussion points on code cleanup topics:
1. isnormal.h is not used anywhere in the code, can we remove it?
2. isinf.h defines a lower-case macro. Can I add to the coding standard that all #defines should be capitalized?
3. sigil spacing. Apparently most of Inkscape's code puts no space between sigil (*/&) and the following variable name. The coding style document doesn't explicitly mention this, shall I add it? So: "int const * get_int(double &johan);"
Cheers, Johan
It's better to ask for forgiveness than permission ;-)
from the sounds of it, isnormal.h can be blown away for good. I deleted it locally and built. it seems everything works just fine. I'm not the guy to ask about the other two things
Andy
On Mon, Jul 14, 2008 at 3:40 AM, <J.B.C.Engelen@...1578...> wrote:
Hello all,
I have some discussion points on code cleanup topics:
isnormal.h is not used anywhere in the code, can we remove it?
isinf.h defines a lower-case macro. Can I add to the coding
standard that all #defines should be capitalized?
- sigil spacing. Apparently most of Inkscape's code puts no space
between sigil (*/&) and the following variable name. The coding style document doesn't explicitly mention this, shall I add it? So: "int const * get_int(double &johan);"
Cheers, Johan
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Sun, Jul 13, 2008 at 07:40:16PM +0200, J.B.C.Engelen@...1578... wrote:
I have some discussion points on code cleanup topics:
- isinf.h defines a lower-case macro. Can I add to the coding
standard that all #defines should be capitalized?
C.f. macros like putc and stderr. If callers don't need to know that it's a macro (most importantly, it evaluates each of its arguments exactly once, and the definition is wrapped in parens), then it's fine for the macro to be in lower-case -- and in fact is better, in order to draw extra attention to macros that need special care ("the boy who cried wolf").
In the case of isinf, one of the definitions (on Solaris) evaluates the argument twice in some executions, so it should either be changed to an inline function or indeed changed to an uppercase name. I'd have thought that the former would be better.
- sigil spacing. Apparently most of Inkscape's code puts no space
between sigil (*/&) and the following variable name. The coding style document doesn't explicitly mention this, shall I add it? So: "int const * get_int(double &johan);"
Excerpt from http://www.inkscape.org/doc/coding_style.php :
# Space between a type name/qualifier and pointer/reference sigil # # - e.g. "char *" and "int &", versus "char*" and "int&" # # - Doing so promotes better understanding of C/C++'s parsing rules for cases # like int *a, b: the sigil applies only to a in that example, not to b. # # - It is sometimes argued that the sigil is part of the type, but even # primitive types may have space between their tokens (e.g. unsigned long).
It indeed does not explicitly say no space between sigil and following identifier [contrary to what I've privately said to Johan without checking -- sorry].
OTOH, the example code in the second point does have no space between the sigil and the identifier, and the rationale of the second point supports that (i.e. makes it clear that syntactically the sigil belongs to the identifier, and that in `int *a(), b()' the return type of b is int rather than int*).
On the third/first hand, the question is not properly addressed: there is no listing of counterarguments on this matter either in this document or the corresponding wiki page (linked to from the top of this page).
I've now added a section to the wiki discussing the question. Or rather, I've tried to add such a section, but the final "Save changes" isn't working... I'll try again later.
pjrm.
participants (3)
-
unknown@example.com
-
Andy Fitzsimon
-
Peter Moulder