CLASS="SECT1"
><A
NAME="CODING"
->6. Coding Guidelines</A
+>4. Coding Guidelines</A
></H1
><DIV
CLASS="SECT2"
CLASS="SECT2"
><A
NAME="S1"
->6.1. Introduction</A
+>4.1. Introduction</A
></H2
><P
>This set of standards is designed to make our lives easier. It is
CLASS="SECT2"
><A
NAME="S2"
->6.2. Using Comments</A
+>4.2. Using Comments</A
></H2
><DIV
CLASS="SECT3"
CLASS="SECT3"
><A
NAME="S3"
->6.2.1. Comment, Comment, Comment</A
+>4.2.1. Comment, Comment, Comment</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S4"
->6.2.2. Use blocks for comments</A
+>4.2.2. Use blocks for comments</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S5"
->6.2.3. Keep Comments on their own line</A
+>4.2.3. Keep Comments on their own line</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S6"
->6.2.4. Comment each logical step</A
+>4.2.4. Comment each logical step</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S7"
->6.2.5. Comment All Functions Thoroughly</A
+>4.2.5. Comment All Functions Thoroughly</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S8"
->6.2.6. Comment at the end of braces if the
+>4.2.6. Comment at the end of braces if the
content is more than one screen length</A
></H3
><P
CLASS="SECT2"
><A
NAME="S9"
->6.3. Naming Conventions</A
+>4.3. Naming Conventions</A
></H2
><DIV
CLASS="SECT3"
CLASS="SECT3"
><A
NAME="S10"
->6.3.1. Variable Names</A
+>4.3.1. Variable Names</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S11"
->6.3.2. Function Names</A
+>4.3.2. Function Names</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S12"
->6.3.3. Header file prototypes</A
+>4.3.3. Header file prototypes</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S13"
->6.3.4. Enumerations, and #defines</A
+>4.3.4. Enumerations, and #defines</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S14"
->6.3.5. Constants</A
+>4.3.5. Constants</A
></H3
><P
><I
CLASS="SECT2"
><A
NAME="S15"
->6.4. Using Space</A
+>4.4. Using Space</A
></H2
><DIV
CLASS="SECT3"
CLASS="SECT3"
><A
NAME="S16"
->6.4.1. Put braces on a line by themselves.</A
+>4.4.1. Put braces on a line by themselves.</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S17"
->6.4.2. ALL control statements should have a
+>4.4.2. ALL control statements should have a
block</A
></H3
><P
CLASS="SECT3"
><A
NAME="S18"
->6.4.3. Do not belabor/blow-up boolean
+>4.4.3. Do not belabor/blow-up boolean
expressions</A
></H3
><P
CLASS="SECT3"
><A
NAME="S19"
->6.4.4. Use white space freely because it is
+>4.4.4. Use white space freely because it is
free</A
></H3
><P
CLASS="SECT3"
><A
NAME="S20"
->6.4.5. Don't use white space around structure
+>4.4.5. Don't use white space around structure
operators</A
></H3
><P
CLASS="SECT3"
><A
NAME="S21"
->6.4.6. Make the last brace of a function stand
+>4.4.6. Make the last brace of a function stand
out</A
></H3
><P
CLASS="SECT3"
><A
NAME="S22"
->6.4.7. Use 3 character indentions</A
+>4.4.7. Use 3 character indentions</A
></H3
><P
><I
CLASS="SECT2"
><A
NAME="S23"
->6.5. Initializing</A
+>4.5. Initializing</A
></H2
><DIV
CLASS="SECT3"
CLASS="SECT3"
><A
NAME="S24"
->6.5.1. Initialize all variables</A
+>4.5.1. Initialize all variables</A
></H3
><P
><I
CLASS="SECT2"
><A
NAME="S25"
->6.6. Functions</A
+>4.6. Functions</A
></H2
><DIV
CLASS="SECT3"
CLASS="SECT3"
><A
NAME="S26"
->6.6.1. Name functions that return a boolean as a
+>4.6.1. Name functions that return a boolean as a
question.</A
></H3
><P
CLASS="SECT3"
><A
NAME="S27"
->6.6.2. Always specify a return type for a
+>4.6.2. Always specify a return type for a
function.</A
></H3
><P
CLASS="SECT3"
><A
NAME="S28"
->6.6.3. Minimize function calls when iterating by
+>4.6.3. Minimize function calls when iterating by
using variables</A
></H3
><P
CLASS="SECT3"
><A
NAME="S29"
->6.6.4. Pass and Return by Const Reference</A
+>4.6.4. Pass and Return by Const Reference</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S30"
->6.6.5. Pass and Return by Value</A
+>4.6.5. Pass and Return by Value</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S31"
->6.6.6. Names of include files</A
+>4.6.6. Names of include files</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S32"
->6.6.7. Provide multiple inclusion
+>4.6.7. Provide multiple inclusion
protection</A
></H3
><P
CLASS="SECT3"
><A
NAME="S33"
->6.6.8. Use `extern "C"` when appropriate</A
+>4.6.8. Use `extern "C"` when appropriate</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S34"
->6.6.9. Where Possible, Use Forward Struct
+>4.6.9. Where Possible, Use Forward Struct
Declaration Instead of Includes</A
></H3
><P
CLASS="SECT2"
><A
NAME="S35"
->6.7. General Coding Practices</A
+>4.7. General Coding Practices</A
></H2
><DIV
CLASS="SECT3"
CLASS="SECT3"
><A
NAME="S36"
->6.7.1. Turn on warnings</A
+>4.7.1. Turn on warnings</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S37"
->6.7.2. Provide a default case for all switch
+>4.7.2. Provide a default case for all switch
statements</A
></H3
><P
CLASS="SECT3"
><A
NAME="S38"
->6.7.3. Try to avoid falling through cases in a
+>4.7.3. Try to avoid falling through cases in a
switch statement.</A
></H3
><P
CLASS="SECT3"
><A
NAME="S39"
->6.7.4. Use 'long' or 'short' Instead of
+>4.7.4. Use 'long' or 'short' Instead of
'int'</A
></H3
><P
CLASS="SECT3"
><A
NAME="S40"
->6.7.5. Don't mix size_t and other types</A
+>4.7.5. Don't mix size_t and other types</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S41"
->6.7.6. Declare each variable and struct on its
+>4.7.6. Declare each variable and struct on its
own line.</A
></H3
><P
CLASS="SECT3"
><A
NAME="S42"
->6.7.7. Use malloc/zalloc sparingly</A
+>4.7.7. Use malloc/zalloc sparingly</A
></H3
><P
><I
CLASS="SECT3"
><A
NAME="S43"
->6.7.8. The Programmer Who Uses 'malloc' is
+>4.7.8. The Programmer Who Uses 'malloc' is
Responsible for Ensuring 'free'</A
></H3
><P
CLASS="SECT3"
><A
NAME="S44"
->6.7.9. Add loaders to the `file_list' structure
+>4.7.9. Add loaders to the `file_list' structure
and in order</A
></H3
><P
CLASS="SECT3"
><A
NAME="S45"
->6.7.10. "Uncertain" new code and/or changes to
+>4.7.10. "Uncertain" new code and/or changes to
existing code, use FIXME</A
></H3
><P
CLASS="SECT2"
><A
NAME="S46"
->6.8. Addendum: Template for files and function
+>4.8. Addendum: Template for files and function
comment blocks:</A
></H2
><P
><TD
><PRE
CLASS="PROGRAMLISTING"
->const char FILENAME_rcs[] = "$Id: developer-manual.sgml,v 1.35 2002/04/17 15:16:15 oes Exp $";
+>const char FILENAME_rcs[] = "$Id: developer-manual.sgml,v 1.42 2002/05/05 20:26:02 hal9 Exp $";
/*********************************************************************
*
* File : $Source$
CLASS="PROGRAMLISTING"
>#ifndef _FILENAME_H
#define _FILENAME_H
-#define FILENAME_H_VERSION "$Id: developer-manual.sgml,v 1.35 2002/04/17 15:16:15 oes Exp $"
+#define FILENAME_H_VERSION "$Id: developer-manual.sgml,v 1.42 2002/05/05 20:26:02 hal9 Exp $"
/*********************************************************************
*
* File : $Source$