IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 3, 2004, 11:53:57 AM (22 years ago)
Author:
rhl
Message:

Some minor corrections from Paul Price

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/misc/codeConventions.tex

    r135 r137  
    263263same level on the previous line (for emacs users, this means the
    264264indentation that \code{<tab>} produces. If this isn't helpful to
    265 the majority of the people writing code for pan-STARRS, we can
     265the majority of the people writing code for \PS{}, we can
    266266be more formal about what this rule means).
    267267
     
    276276\begin{verbatim}
    277277someFunc(longExpression1, longExpression2, longExpression3,
    278         longExpression4, longExpression5);
     278         longExpression4, longExpression5);
    279279 
    280280var = someFunc1(longExpression1,
    281281                someFunc2(longExpression2,
    282                         longExpression3));
     282                          longExpression3));
    283283\end{verbatim}
    284284
     
    786786\item Between the local variables in a function and its first statement
    787787
    788 \item Before a block (sec. \ref{ImplBlockComments}) or
    789   single-line (sec. \ref{SingleLineComment}) comment
    790 
    791788\item Between logical sections inside a function to improve readability
    792789\end{itemize}
     
    940937be uppercase with words separated by underscores (\code{_}). In the case of
    941938system utilities implemented as macros, the names may conform to the
    942 usual Pan-STARRS conventions (e.g. \code{psAlloc}).
     939usual \PS{} conventions (e.g. \code{psAlloc}).
    943940
    944941&
     
    967964
    968965Avoid 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
     966statement, unless the variables are intimately related. Acceptable examples:
     967
     968\begin{verbatim}
     969row0 = col0 = 0;
     970sum = sumx = sumy = 0;
    974971\end{verbatim}
    975972
     
    11421139
    11431140When defining a function to convert from one type to another, the
    1144 name should be of the form \code{psOldToNew}, e.g.
     1141name should be of the form \code{psOldToNew}, e.g.\hfil\break
    11451142\code{psEquatorialToEcliptic} (\emph{not} \code{psEquatorial2Ecliptic}).
    11461143
     
    11481145
    11491146Functions 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}
     1149void psAddToVector(restrict psVec *outVec, const restrict psVec *inVec,
     1150                   int val);
     1151\end{verbatim}
    11511152
    11521153\subsection{Type Qualifiers (const and restrict)}
     
    14011402  \label{dot_emacs}
    14021403
    1403 \textit{This section is provided for your convenience, it is of course
     1404\textit{This section is provided for your convenience; it is, of course,
    14041405not part of the coding standards.}
    14051406
Note: See TracChangeset for help on using the changeset viewer.