[Freeciv-Dev] Re: Coding Guideline --- more variants
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
freeciv development list <freeciv-dev@xxxxxxxxxxx> |
Subject: |
[Freeciv-Dev] Re: Coding Guideline --- more variants |
From: |
Reinier Post <rp@xxxxxxxxxx> |
Date: |
Thu, 29 Nov 2001 16:25:55 +0100 |
> 11a: always braces
> switch(a) {
> case 2:
> {
> return 2;
> }
> case 3:
> {
> int x;
> ....
> }
This (11a) is my preference.
BTW I seem to remember some C compilers or standards don't allow
such intra-block variable declarations, while I much prefer them myself,
I even create blocks to introduce them:
int foo()
{
int i;
i=changing(i);
{
int j;
for (j=0; j<i; ++j) {
i=foo(j);
}
}
return i;
}
Has this been sorted out? Have we voted on this?
QUESTION 11.5: declarations within blocks
/* A */ all declarations at start
/* B */ declarations within block if possible
/* C */ even create blocks to scope declarations where appropriate
My preference: C.
--
Reinier
- [Freeciv-Dev] Re: Please vote!, (continued)
- [Freeciv-Dev] Re: Please vote!, Reinier Post, 2001/11/29
- [Freeciv-Dev] Re: Please vote!, Gregor Zeitlinger, 2001/11/30
- [Freeciv-Dev] Re: Please vote!, Vasco Alexandre Da Silva Costa, 2001/11/29
- [Freeciv-Dev] Re: Please vote!, Ross W. Wetmore, 2001/11/30
- [Freeciv-Dev] Coding Guideline --- more variants, Gregory Berkolaiko, 2001/11/28
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Raimar Falke, 2001/11/28
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Raimar Falke, 2001/11/28
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Petr Baudis, 2001/11/28
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Raahul Kumar, 2001/11/29
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Petr Baudis, 2001/11/29
- [Freeciv-Dev] Re: Coding Guideline --- more variants,
Reinier Post <=
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Raimar Falke, 2001/11/29
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Reinier Post, 2001/11/29
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Daniel L Speyer, 2001/11/28
- [Freeciv-Dev] Re: Coding Guideline --- more variants, Raahul Kumar, 2001/11/29
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raimar Falke, 2001/11/25
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raahul Kumar, 2001/11/26
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raimar Falke, 2001/11/26
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Tony Stuckey, 2001/11/26
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raimar Falke, 2001/11/26
- [Freeciv-Dev] Re: PATCH: AI cleanup Version 2, Raahul Kumar, 2001/11/24
|
|