Changeset 131
- Timestamp:
- Mar 2, 2004, 10:52:58 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/misc/codeConventions.tex (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/misc/codeConventions.tex
r129 r131 1145 1145 \code{psEquatorialToEcliptic} (\emph{not} \code{psEquatorial2Ecliptic}). 1146 1146 1147 \subsection{ \label{LArgumentOrder}Order of I/O Arguments}1147 \subsection{Order of I/O Arguments} 1148 1148 1149 1149 Functions that assign to a variable should list that argument 1150 1150 \textit{first} (i.e. following the pattern of \code{strcpy}): 1151 1151 1152 \subsection{ \label{LConstRestrict}Type Qualifiers (const and restrict)}1152 \subsection{Type Qualifiers (const and restrict)} 1153 1153 1154 1154 All interfaces and type definitions should use \code{const} and … … 1165 1165 \textit{N.b. compilers are free to ignore the \code{restrict} keyword, 1166 1166 so all code should be written to explicitly handle aliasing}. 1167 1168 \subsection{\code{struct}s and \code{typedef}s} 1169 1170 All structs should be defined as \code{typedef}s. 1171 1172 A struct should not include a struct 1173 tag unless it's self-referential; E.g. 1174 \begin{verbatim} 1175 typedef struct myStruct { // Omit "myStruct" 1176 int x; 1177 } myStruct; 1178 1179 typedef struct yourStruct { // OK 1180 struct yourStruct *next; 1181 int x; 1182 } yourStruct; 1183 \end{verbatim} 1167 1184 1168 1185 %------------------------------------------------------------------------------ … … 1343 1360 specified as \code{(void)} (avoiding complaints on some compilers, 1344 1361 e.g. on SGIs). 1345 1362 1363 \item 1364 Added rules on typedefing structs, and on struct tags. 1365 1346 1366 \end{itemize} 1347 1367
Note:
See TracChangeset
for help on using the changeset viewer.
