Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] (PR#2623) A minor style issue
Home

[Freeciv-Dev] (PR#2623) A minor style issue

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2623) A minor style issue
From: "Gregory Berkolaiko via RT" <rt@xxxxxxxxxxxxxx>
Date: Fri, 20 Dec 2002 12:05:47 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Following the discussion concerning the use of 
        if (i > 0) {
vs
        if(i > 0) {

I introduced the corresponding amendment to the CodingStyle.

Strangely, indent -kr will also introduce space after a "while" and a 
"for":
        while (i > 0) {
and
        for (i = 0; i < 10; i++) {

I don't think we should enforce it now, but at least the CodingStyle 
itself should comply to what it proclaims to be the case.

? pitfight.sh
? pitfight_g.sh
? score.log
? test.c
Index: doc/CodingStyle
===================================================================
RCS file: /home/freeciv/CVS/freeciv/doc/CodingStyle,v
retrieving revision 1.4
diff -u -r1.4 CodingStyle
--- doc/CodingStyle     2002/12/11 15:29:25     1.4
+++ doc/CodingStyle     2002/12/20 19:57:04
@@ -18,7 +18,8 @@
     - lines are at most 77 chars long
     - spaces are inserted before and after operators ("int i, j, k;"
       instead of "int a,b,c;" and "if (foo <= bar) c = a + b;" instead
-      of "if(foo<=bar) c=a+b;")
+      of "if(foo<=bar) c=a+b;" -- note the space between "if" and the 
+      bracket)
     - function braces begin and end in the first column.
         int foo()
         {
@@ -77,7 +78,7 @@
 - Comments in conditionals. If you need a comment to show program flow,
   it should be below the if or else:
 
-  if(is_barbarian(pplayer)) {
+  if (is_barbarian(pplayer)) {
     x++;
   } else {
     /* If not barbarian, ... */
@@ -160,7 +161,7 @@
 - If an empty block is needed you should put an explanatory comment in
   an empty block (i.e. {}):
 
-  while(*i++) {
+  while (*i++) {
     /* nothing */
   }
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#2623) A minor style issue, Gregory Berkolaiko via RT <=