[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/geas STANDARDS
From: |
Reinhard Mueller |
Subject: |
gnue/geas STANDARDS |
Date: |
Sun, 06 May 2001 12:32:12 -0700 |
CVSROOT: /cvs
Module name: gnue
Changes by: Reinhard Mueller <address@hidden> 01/05/06 12:32:12
Modified files:
geas : STANDARDS
Log message:
Changed statement about indentation
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/geas/STANDARDS.diff?cvsroot=OldCVS&tr1=1.1&tr2=1.2&r1=text&r2=text
Patches:
Index: gnue/geas/STANDARDS
diff -u gnue/geas/STANDARDS:1.1 gnue/geas/STANDARDS:1.2
--- gnue/geas/STANDARDS:1.1 Sat May 5 02:35:13 2001
+++ gnue/geas/STANDARDS Sun May 6 12:32:12 2001
@@ -1,15 +1,30 @@
Code
-Code should in general follow the gnu coding standards. No line of code
-should exceed 80 characters.
+Code should in general follow the gnu coding standards.
+No line of code should exceed 80 characters.
Indentation should be 2 characters (according to gnu coding standards).
Indentation should be done with blank characters, not with tabstops.
-If the code doesn't conform, you can run it through GNU indent with no
-additional parameters (simply "indent codefile.c"). GNU indent 2.2.5 is
-known to work properly, but actually any version since 1.2 should work.
-But make sure that you use GNU indent, since other versions have other
-defaults.
+Write
+ if (foo)
+ {
+ do_something;
+ }
+and not
+ if (foo)
+ do_something;
+or
+ if (foo) do_something;
+(but there could be special cases where the latter is acceptable, e.g.
+error handling like "if (!param) exit 0;".
+
+If the code doesn't conform, using "indent -nut codefile.c" could save
+you a big deal of work in changing the code. (Be sure to use GNU indent
+2.2.6 or later).
+But probably indent can't do everything. Especially it won't insert braces
+where they miss.
+Additional hints on parameters for indent to make the code cleaner are
+always appreciated.
Namespaces
- gnue/geas STANDARDS,
Reinhard Mueller <=