[Freeciv-Dev] Coding Guideline RFC
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
--- Gregor Zeitlinger <zeitling@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Sun, 25 Nov 2001, Petr Baudis wrote:
> <snip>
>
> I agree on all issues with Petr, but I thought the "indent -kr -2" has
> already defined that? Am I mistaken?
indent -kr -i2 fixes some of the issues Petr raised (mostly amount of
whitespace around).
Below is a list of questions that indent _does_not_ address. This list
is "indent -kr -i2"-invariant.
So shall we:
1. Think hard about other possible issues.
2. Vote (or, given that Raimar is the formatting Kerberos, just let him
decide).
3. Put the answers in "How to contribute" on www.freeciv.org
?
Best,
G.
P.S. I vote 1A 2B 3B 4A 5- 6A
========================================================================
/***************
* 1: init vars
***************/
/* A */
int foo1a(struct city *punit)
{
int x = punit->x;
}
/* B */
int foo1b(struct city *punit)
{
int x;
x = punit->x;
}
/**************************
* 2: empty line after vars
**************************/
/* A */
int foo2a(void)
{
int x;
x = 3;
}
/* B */
int foo2b(void)
{
int x;
x = 3;
}
/****************
* 3: comments
****************/
/* A */
int foo3a(int x)
{
x = 3; /* assign 3 to x */
}
/* B */
int foo3b(int x)
{
/* assign 3 to x */
x = 3;
}
/**************************
* 4: extra {} on iterates
**************************/
int foo4(struct city *pcity)
{
/* A */
unit_list_iterate(pcity->units_supported, punit) {
kill(punit);
} unit_list_iterate_end;
/* B */
unit_list_iterate(pcity->units_supported, punit)
kill(punit);
unit_list_iterate_end;
}
/******************************************
* 5: unnecessary braces after conditionals
******************************************/
int foo5(int x)
{
/* A */
if (x == 3) {
return;
}
/* B */
if (x == 4)
return;
}
/****************************************************
* 6: unnecessary braces after conditionals with else
****************************************************/
int foo6(int x)
{
/* A */
if (x == 3) {
return 1;
} else {
return 0;
}
/* B */
if (x == 4)
return 1;
else
return 0;
}
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and
Music Charts
http://uk.my.yahoo.com
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, (continued)
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raimar Falke, 2001/11/23
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Petr Baudis, 2001/11/23
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raahul Kumar, 2001/11/23
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raimar Falke, 2001/11/24
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Petr Baudis, 2001/11/24
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raimar Falke, 2001/11/24
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Petr Baudis, 2001/11/24
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raimar Falke, 2001/11/25
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Petr Baudis, 2001/11/25
- [Freeciv-Dev] Coding Guideline, Gregor Zeitlinger, 2001/11/25
- [Freeciv-Dev] Coding Guideline RFC,
Gregory Berkolaiko <=
- [Freeciv-Dev] Re: Coding Guideline RFC, Greg Wooledge, 2001/11/25
- [Freeciv-Dev] Re: Coding Guideline RFC, Daniel Sjölie, 2001/11/25
- [Freeciv-Dev] Re: Coding Guideline RFC, Raimar Falke, 2001/11/26
- [Freeciv-Dev] Re: Coding Guideline RFC, Raimar Falke, 2001/11/26
- [Freeciv-Dev] Re: Coding Guideline RFC, Petr Baudis, 2001/11/26
- [Freeciv-Dev] Coding Guideline Updated RFC, Gregory Berkolaiko, 2001/11/26
- [Freeciv-Dev] Re: Coding Guideline Updated RFC, Gregory Berkolaiko, 2001/11/26
- [Freeciv-Dev] Re: Coding Guideline Updated RFC, Andrew Sutton, 2001/11/26
- [Freeciv-Dev] Re: Coding Guideline Updated RFC, Raimar Falke, 2001/11/26
- [Freeciv-Dev] Re: Coding Guideline Updated RFC, Andrew Sutton, 2001/11/26
|
|