aboutsummaryrefslogtreecommitdiff
path: root/docs/style-guide.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/style-guide.txt')
-rw-r--r--docs/style-guide.txt12
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/style-guide.txt b/docs/style-guide.txt
index 25c676ca2..915d9b27d 100644
--- a/docs/style-guide.txt
+++ b/docs/style-guide.txt
@@ -266,7 +266,7 @@ these steps:
266 conversion. 266 conversion.
267 267
268 - Compile and see if everything still works. 268 - Compile and see if everything still works.
269 269
270Please be aware of changes that have cascading effects into other files. For 270Please be aware of changes that have cascading effects into other files. For
271example, if you're changing the name of something in, say utility.c, you 271example, if you're changing the name of something in, say utility.c, you
272should probably run 'examples/mk2knr.pl utility.c' at first, but when you run 272should probably run 'examples/mk2knr.pl utility.c' at first, but when you run
@@ -293,13 +293,13 @@ Use 'const <type> var' for declaring constants.
293 #define var 80 293 #define var 80
294 294
295 Do this instead, when the variable is in a header file and will be used in 295 Do this instead, when the variable is in a header file and will be used in
296 several source files: 296 several source files:
297 297
298 const int var = 80; 298 const int var = 80;
299 299
300 Or do this when the variable is used only in a single source file: 300 Or do this when the variable is used only in a single source file:
301 301
302 static const int var = 80; 302 static const int var = 80;
303 303
304Declaring variables as '[static] const' gives variables an actual type and 304Declaring variables as '[static] const' gives variables an actual type and
305makes the compiler do type checking for you; the preprocessor does _no_ type 305makes the compiler do type checking for you; the preprocessor does _no_ type
@@ -336,7 +336,7 @@ The Folly of #ifdef
336Code cluttered with ifdefs is difficult to read and maintain. Don't do it. 336Code cluttered with ifdefs is difficult to read and maintain. Don't do it.
337Instead, put your ifdefs at the top of your .c file (or in a header), and 337Instead, put your ifdefs at the top of your .c file (or in a header), and
338conditionally define 'static inline' functions, (or *maybe* macros), which are 338conditionally define 'static inline' functions, (or *maybe* macros), which are
339used in the code. 339used in the code.
340 340
341 Don't do this: 341 Don't do this:
342 342
@@ -650,7 +650,7 @@ line in the midst of your #includes:
650And a code block similar to the following near the top of your applet_main() 650And a code block similar to the following near the top of your applet_main()
651routine: 651routine:
652 652
653 while ((opt = getopt(argc, argv, "abc")) > 0) { 653 while ((opt = getopt(argc, argv, "abc")) > 0) {
654 switch (opt) { 654 switch (opt) {
655 case 'a': 655 case 'a':
656 do_a_opt = 1; 656 do_a_opt = 1;