Update of bug #13848 (project freeciv):
Status: Ready For Test = In Progress
___
Follow-up Comment #11:
Now, http://freeciv.wikia.com/wiki/Coding_Style needs to be updated.
Update of bug #13848 (project freeciv):
Status: In Progress = Ready For Test
___
Additional Item Attachment:
File name: trunk_CodingStyle.diff Size:23 KB
Follow-up Comment #7, bug #13848 (project freeciv):
update doc/CodingStyle
* based on patch by Madeline Book mbook
* including all comments since this patch:
- no more than 2 empty lines
- prefix 'fc_'
- '_new' / '_destroy' to allocated / free pointer variables
- '_init' / '_free' to
Follow-up Comment #8, bug #13848 (project freeciv):
missed one comment wrt assert()
(file #8047)
___
Additional Item Attachment:
File name: version2-20100211-trunk-update-doc-CodingStyle.patch Size:20 KB
Update of bug #13848 (project freeciv):
Status:None = In Progress
Assigned to: mbook = pepeto
___
Reply to this item at:
On Fri, Jul 3, 2009 at 2:00 AM, Madeline
Bookno-reply.invalid-addr...@gna.org wrote:
I also prefer the 0 rule because if we realize that
case labels are essentially the same as goto labels,
Yesterday I was genuinely tempted for a minute to write some map
guessing code as:
switch
While on the topic of asserts, I recommend using a macro similar to
the ASSERT_OR_RETURN that I wrote for Warzone2100 --
http://warzone2100.svn.sourceforge.net/viewvc/warzone2100/trunk/lib/framework/debug.h?revision=7821view=markup
The reason for this is that 1) you avoid having to do such double
Follow-up Comment #1, bug #13848 (project freeciv):
Looks good in most part.
- I don't like switch and case at same indentation level. I would vote
for half indent step (2/2 = 1) for case
- Could you add assert() rule that instead of assert(FALSE) assert with
more verbose error message should
Follow-up Comment #4, bug #13848 (project freeciv):
Some rules I was just reminded of:
- No more than 2 empty lines between any sections
in the code.
- #include the header corresponding to the current
c source file after all other headers.
Follow-up Comment #3, bug #13848 (project freeciv):
Could you add assert() rule that instead of
assert(FALSE) assert with more verbose error
message should be used when possible: [...]
There is the die() function which can be used
if the assert condition is not descriptive
enough. I'll add a
Follow-up Comment #5, bug #13848 (project freeciv):
Reason why I want case labels intendet is that having ending } as first
line starting at the same level as switch itself makes it easier to see at
one glance where current switch ends. My eyes (and brain) just work that
way :-)
Follow-up Comment #6, bug #13848 (project freeciv):
I discourage use of die() in most cases. I don't think CodingStyle should
advertise it.
Note that die() kills even release builds (those with NDEBUG) when assert()
does not. Of course failing assert() sometimes indicates problem that causes
URL:
http://gna.org/bugs/?13848
Summary: [Patch] More detailed coding style guidelines
Project: Freeciv
Submitted by: mbook
Submitted on: Thursday 07/02/2009 at 02:33
Category: docs
Severity: 4 -
13 matches
Mail list logo