Changeset 137 for trunk/doc/misc/codeConventions.tex
- Timestamp:
- Mar 3, 2004, 11:53:57 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/misc/codeConventions.tex (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/misc/codeConventions.tex
r135 r137 263 263 same level on the previous line (for emacs users, this means the 264 264 indentation that \code{<tab>} produces. If this isn't helpful to 265 the majority of the people writing code for pan-STARRS, we can265 the majority of the people writing code for \PS{}, we can 266 266 be more formal about what this rule means). 267 267 … … 276 276 \begin{verbatim} 277 277 someFunc(longExpression1, longExpression2, longExpression3, 278 longExpression4, longExpression5);278 longExpression4, longExpression5); 279 279 280 280 var = someFunc1(longExpression1, 281 281 someFunc2(longExpression2, 282 longExpression3));282 longExpression3)); 283 283 \end{verbatim} 284 284 … … 786 786 \item Between the local variables in a function and its first statement 787 787 788 \item Before a block (sec. \ref{ImplBlockComments}) or789 single-line (sec. \ref{SingleLineComment}) comment790 791 788 \item Between logical sections inside a function to improve readability 792 789 \end{itemize} … … 940 937 be uppercase with words separated by underscores (\code{_}). In the case of 941 938 system utilities implemented as macros, the names may conform to the 942 usual Pan-STARRSconventions (e.g. \code{psAlloc}).939 usual \PS{} conventions (e.g. \code{psAlloc}). 943 940 944 941 & … … 967 964 968 965 Avoid assigning several variables to the same value in a single 969 statement, unless the variables are intimately related. Example:970 971 \begin{verbatim} 972 fChar = lchar = 'c'; // AVOID! 973 row0 = col0 = 0; // OK 966 statement, unless the variables are intimately related. Acceptable examples: 967 968 \begin{verbatim} 969 row0 = col0 = 0; 970 sum = sumx = sumy = 0; 974 971 \end{verbatim} 975 972 … … 1142 1139 1143 1140 When defining a function to convert from one type to another, the 1144 name should be of the form \code{psOldToNew}, e.g. 1141 name should be of the form \code{psOldToNew}, e.g.\hfil\break 1145 1142 \code{psEquatorialToEcliptic} (\emph{not} \code{psEquatorial2Ecliptic}). 1146 1143 … … 1148 1145 1149 1146 Functions that assign to a variable should list that argument 1150 \textit{first} (i.e. following the pattern of \code{strcpy}): 1147 \textit{first} (i.e. following the pattern of \code{strcpy}); e.g. 1148 \begin{verbatim} 1149 void psAddToVector(restrict psVec *outVec, const restrict psVec *inVec, 1150 int val); 1151 \end{verbatim} 1151 1152 1152 1153 \subsection{Type Qualifiers (const and restrict)} … … 1401 1402 \label{dot_emacs} 1402 1403 1403 \textit{This section is provided for your convenience , it is of course1404 \textit{This section is provided for your convenience; it is, of course, 1404 1405 not part of the coding standards.} 1405 1406
Note:
See TracChangeset
for help on using the changeset viewer.
