\hypertarget{decode_8c}{
\section{decode.c File Reference}
\label{decode_8c}\index{decode.c@{decode.c}}
}
Routines to decode the event data. 

{\tt \#include \char`\"{}expand\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}decode.h\char`\"{}}\par
{\tt \#include \char`\"{}decompress.h\char`\"{}}\par
{\tt \#include \char`\"{}raw.h\char`\"{}}\par
{\tt \#include \char`\"{}QSEC\_\-ctx\_\-p.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-ctb.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-gem.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-tem.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-cal.h\char`\"{}}\par
{\tt \#include \char`\"{}EDS/EBF\_\-tkr.h\char`\"{}}\par
{\tt \#include \char`\"{}QSE/QSE\_\-ebf.h\char`\"{}}\par
{\tt \#include \char`\"{}QSE/QSE\_\-aemRepack.h\char`\"{}}\par
{\tt \#include \char`\"{}QSE/QSE\_\-aem.h\char`\"{}}\par
{\tt \#include \char`\"{}PBI/Endianness.h\char`\"{}}\par
{\tt \#include $<$string.h$>$}\par
\subsection*{Classes}
\begin{CompactItemize}
\item 
struct \hyperlink{structQSEC__acdRaw}{QSEC\_\-acdRaw}
\begin{CompactList}\small\item\em Private structure holding raw data for an ACD contribution. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
static \_\-\_\-inline void \hyperlink{decode_8c_755017c5a2903d7b266536bcd75c08e6}{fixupCtbHdr} (EBF\_\-ctbHdr $\ast$hdr)
\begin{CompactList}\small\item\em When the ACD is not included in the output stream (as it is now), the final TEM contribution must have its response bit removed. \item\end{CompactList}\item 
static \_\-\_\-inline void $\ast$ \hyperlink{decode_8c_157bd64220158a010bdfc87b3ae622e9}{roundUpPtr} (void $\ast$ptr, int r)
\begin{CompactList}\small\item\em Round the specified pointer up to a specified binary boundary. \item\end{CompactList}\item 
static \_\-\_\-inline unsigned int \hyperlink{decode_8c_ff331296d2e46df468f343e57bb1c810}{roundUpInt} (unsigned int ui, int r)
\begin{CompactList}\small\item\em Round the specified integer up to a binary boundary. \item\end{CompactList}\item 
static unsigned short $\ast$ \hyperlink{decode_8c_ba5f937b76bba64465f31f5ae8c5aef6}{decodeShorts} (unsigned short $\ast$us, int cnt, \hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$dcmp, APD\_\-dtx $\ast$dtx)
\begin{CompactList}\small\item\em Decode the required number of symbols from the compressed stream and stores them as shorts. \item\end{CompactList}\item 
static unsigned int $\ast$ \hyperlink{decode_8c_d7ef663744ad03da44566776c955e2fa}{decodeGem} (\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$exp, const \hyperlink{structQSEC__summary}{QSEC\_\-summary} $\ast$sum, unsigned int $\ast$evt)
\begin{CompactList}\small\item\em Decode the GEM contribution. \item\end{CompactList}\item 
static unsigned int $\ast$ \hyperlink{decode_8c_4c344dade5e1aab857dbddce19314bfa}{decodeAcd} (\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$exp, const \hyperlink{structQSEC__summary}{QSEC\_\-summary} $\ast$sum, unsigned int $\ast$evt)
\begin{CompactList}\small\item\em Decode an ACD event. \item\end{CompactList}\item 
static unsigned int $\ast$ \hyperlink{decode_8c_efd1ac62bfba3845f17915e6f83da1f6}{decodeCal} (\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$exp, const \hyperlink{structQSEC__summary}{QSEC\_\-summary} $\ast$sum, unsigned int $\ast$evt)
\begin{CompactList}\small\item\em Decode a CAL event. \item\end{CompactList}\item 
static unsigned int $\ast$ \hyperlink{decode_8c_1196b123bc43b9c064c7f5ada58bba1e}{decodeCalV1} (\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$exp, const \hyperlink{structQSEC__summary}{QSEC\_\-summary} $\ast$sum, unsigned int $\ast$evt)
\begin{CompactList}\small\item\em Decode a version 1 CAL event. \item\end{CompactList}\item 
static unsigned int $\ast$ \hyperlink{decode_8c_77a1c18997e42765d0daea667a7a9910}{decodeTkr} (\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$exp, const \hyperlink{structQSEC__summary}{QSEC\_\-summary} $\ast$sum, unsigned int $\ast$evt)
\begin{CompactList}\small\item\em Decode a tracker event. \item\end{CompactList}\item 
static unsigned int $\ast$ \hyperlink{decode_8c_43ecf9e1a01eac53b83c3f803d3670b1}{decodeTkrTots} (unsigned char $\ast$tot, int ntots, \hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$tots, APD\_\-dtx $\ast$dtx)
\begin{CompactList}\small\item\em Decompress the tracker TOTS. \item\end{CompactList}\item 
static void \hyperlink{decode_8c_b50dde5c3ba66503c6e4671f5e504bac}{expandGem} (\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$exp, EBF\_\-gem $\ast$gem)
\begin{CompactList}\small\item\em Populate the data portion of a GEM contribution. \item\end{CompactList}\item 
void \hyperlink{decode_8c_ba9ac8250f9a04ab05ae6aa4bdfa6a78}{QSEC\_\-update} (\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$exp, EBF\_\-gem $\ast$gem, unsigned int $\ast$seq, const unsigned int $\ast$ievt)
\begin{CompactList}\small\item\em Decode the GEM contribution and extract the 17 bit event sequence. \item\end{CompactList}\item 
unsigned int \hyperlink{decode_8c_a5f6c15dc1ca8b02d1b36696384b37c6}{QSEC\_\-decode} (\hyperlink{structQSEC__expansion__}{QSEC\_\-expansion} $\ast$exp, QSE\_\-ebfEvt $\ast$oevt, const unsigned int $\ast$ievt)
\begin{CompactList}\small\item\em Decode the event held in the expansion structure into the QSE\_\-evt structure. \item\end{CompactList}\item 
static \_\-\_\-inline void \hyperlink{decode_8c_ffa026b2734c5e05d25afc57a2f8d545}{decodeCalDiag} (EBF\_\-temDiag $\ast$diag\mbox{[}LSEC\_\-N\_\-TWR\mbox{]}, unsigned int map, \hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$dcmp, APD\_\-dtx $\ast$dtx)
\begin{CompactList}\small\item\em Decode the CAL portion of the diagnostic block. \item\end{CompactList}\item 
static \_\-\_\-inline unsigned char $\ast$ \hyperlink{decode_8c_c757120b887adbe39a87ad503ad92c4c}{calcTkrTotAdr} (unsigned char $\ast$ptr, int nstrips)
\begin{CompactList}\small\item\em Encapsulate the calculation of the TOT storage address. \item\end{CompactList}\item 
static \_\-\_\-inline void \hyperlink{decode_8c_f6bdce31f765ad1e07a845247118f393}{decodeTkrDiag} (EBF\_\-temDiag $\ast$diag\mbox{[}LSEC\_\-N\_\-TWR\mbox{]}, unsigned int map, \hyperlink{structQSEC__decompression__}{QSEC\_\-decompression} $\ast$dcmp, APD\_\-dtx $\ast$dtx)
\begin{CompactList}\small\item\em Decode the tracker portion of the diagnostic block. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Routines to decode the event data. 

\begin{Desc}
\item[Author:]James Swain \& Owen Saxton\end{Desc}
\begin{Desc}
\item[Id]\end{Desc}


\subsection{Function Documentation}
\hypertarget{decode_8c_c757120b887adbe39a87ad503ad92c4c}{
\index{decode.c@{decode.c}!calcTkrTotAdr@{calcTkrTotAdr}}
\index{calcTkrTotAdr@{calcTkrTotAdr}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline unsigned char$\ast$ calcTkrTotAdr (unsigned char $\ast$ {\em ptr}, int {\em nstrips})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8c_c757120b887adbe39a87ad503ad92c4c}


Encapsulate the calculation of the TOT storage address. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ptr}]The address of the end of the last 12-byte block of strips\item[{\em nstrips}]The number of strips stored in this 12-byte block\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The byte address to begin storing the TOTs \end{Desc}
\hypertarget{decode_8c_4c344dade5e1aab857dbddce19314bfa}{
\index{decode.c@{decode.c}!decodeAcd@{decodeAcd}}
\index{decodeAcd@{decodeAcd}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int $\ast$ decodeAcd ({\bf QSEC\_\-expansion} $\ast$ {\em exp}, const {\bf QSEC\_\-summary} $\ast$ {\em sum}, unsigned int $\ast$ {\em evt})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8c_4c344dade5e1aab857dbddce19314bfa}


Decode an ACD event. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em exp}]Expansion structure\item[{\em sum}]Pointer to the collection of contribution headers\item[{\em evt}]Pointer to the event to fill\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the end of the space occupied by this contribution \end{Desc}
\hypertarget{decode_8c_efd1ac62bfba3845f17915e6f83da1f6}{
\index{decode.c@{decode.c}!decodeCal@{decodeCal}}
\index{decodeCal@{decodeCal}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int $\ast$ decodeCal ({\bf QSEC\_\-expansion} $\ast$ {\em exp}, const {\bf QSEC\_\-summary} $\ast$ {\em sum}, unsigned int $\ast$ {\em evt})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8c_efd1ac62bfba3845f17915e6f83da1f6}


Decode a CAL event. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em exp}]Expansion structure\item[{\em sum}]Pointer to the collection of contribution headers\item[{\em evt}]Pointer to the event to fill \end{description}
\end{Desc}
\hypertarget{decode_8c_ffa026b2734c5e05d25afc57a2f8d545}{
\index{decode.c@{decode.c}!decodeCalDiag@{decodeCalDiag}}
\index{decodeCalDiag@{decodeCalDiag}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline void decodeCalDiag (EBF\_\-temDiag $\ast$ {\em diag}\mbox{[}LSEC\_\-N\_\-TWR\mbox{]}, unsigned int {\em map}, {\bf QSEC\_\-decompression} $\ast$ {\em dcmp}, APD\_\-dtx $\ast$ {\em dtx})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8c_ffa026b2734c5e05d25afc57a2f8d545}


Decode the CAL portion of the diagnostic block. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em diag}]An array of pointers to each towers diagnostic block\item[{\em map}]The map of struck towers, MSB = Tower 0\item[{\em dcmp}]The decoding tables\item[{\em dtx}]The bit stream to be decoded \end{description}
\end{Desc}
\hypertarget{decode_8c_1196b123bc43b9c064c7f5ada58bba1e}{
\index{decode.c@{decode.c}!decodeCalV1@{decodeCalV1}}
\index{decodeCalV1@{decodeCalV1}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int $\ast$ decodeCalV1 ({\bf QSEC\_\-expansion} $\ast$ {\em exp}, const {\bf QSEC\_\-summary} $\ast$ {\em sum}, unsigned int $\ast$ {\em evt})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8c_1196b123bc43b9c064c7f5ada58bba1e}


Decode a version 1 CAL event. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em exp}]Expansion structure\item[{\em sum}]Pointer to the collection of contribution headers\item[{\em evt}]Pointer to the event to fill \end{description}
\end{Desc}
\hypertarget{decode_8c_d7ef663744ad03da44566776c955e2fa}{
\index{decode.c@{decode.c}!decodeGem@{decodeGem}}
\index{decodeGem@{decodeGem}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int $\ast$ decodeGem ({\bf QSEC\_\-expansion} $\ast$ {\em exp}, const {\bf QSEC\_\-summary} $\ast$ {\em sum}, unsigned int $\ast$ {\em evt})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8c_d7ef663744ad03da44566776c955e2fa}


Decode the GEM contribution. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em exp}]Expansion structure\item[{\em sum}]Pointer to the collection of contribution headers\item[{\em evt}]Pointer to the event to fill.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the end of the space occupied by this contribution \end{Desc}
\hypertarget{decode_8c_ba5f937b76bba64465f31f5ae8c5aef6}{
\index{decode.c@{decode.c}!decodeShorts@{decodeShorts}}
\index{decodeShorts@{decodeShorts}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static unsigned short$\ast$ decodeShorts (unsigned short $\ast$ {\em us}, int {\em cnt}, {\bf QSEC\_\-decompression} $\ast$ {\em dcmp}, APD\_\-dtx $\ast$ {\em dtx})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8c_ba5f937b76bba64465f31f5ae8c5aef6}


Decode the required number of symbols from the compressed stream and stores them as shorts. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em us}]The pointer to the unsigned short storeage array\item[{\em cnt}]The number of symbols to decode and store as short integer\item[{\em dcmp}]The decompression context\item[{\em dtx}]The compressed bit stream\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The pointer to the next storage location \end{Desc}
\hypertarget{decode_8c_77a1c18997e42765d0daea667a7a9910}{
\index{decode.c@{decode.c}!decodeTkr@{decodeTkr}}
\index{decodeTkr@{decodeTkr}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int $\ast$ decodeTkr ({\bf QSEC\_\-expansion} $\ast$ {\em exp}, const {\bf QSEC\_\-summary} $\ast$ {\em sum}, unsigned int $\ast$ {\em evt})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8c_77a1c18997e42765d0daea667a7a9910}


Decode a tracker event. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em exp}]Expansion structure\item[{\em sum}]Pointer to the collection of contribution headers\item[{\em evt}]Pointer to the event to be filled. \end{description}
\end{Desc}
\hypertarget{decode_8c_f6bdce31f765ad1e07a845247118f393}{
\index{decode.c@{decode.c}!decodeTkrDiag@{decodeTkrDiag}}
\index{decodeTkrDiag@{decodeTkrDiag}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline void decodeTkrDiag (EBF\_\-temDiag $\ast$ {\em diag}\mbox{[}LSEC\_\-N\_\-TWR\mbox{]}, unsigned int {\em map}, {\bf QSEC\_\-decompression} $\ast$ {\em dcmp}, APD\_\-dtx $\ast$ {\em dtx})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8c_f6bdce31f765ad1e07a845247118f393}


Decode the tracker portion of the diagnostic block. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em diag}]An array of pointers to each towers diagnostic block\item[{\em map}]The map of struck towers, MSB = Tower 0\item[{\em dcmp}]The decoding tables\item[{\em dtx}]The bit stream to be decoded \end{description}
\end{Desc}
\hypertarget{decode_8c_43ecf9e1a01eac53b83c3f803d3670b1}{
\index{decode.c@{decode.c}!decodeTkrTots@{decodeTkrTots}}
\index{decodeTkrTots@{decodeTkrTots}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int $\ast$ decodeTkrTots (unsigned char $\ast$ {\em tot}, int {\em ntots}, {\bf QSEC\_\-decompression} $\ast$ {\em tots}, APD\_\-dtx $\ast$ {\em dtx})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8c_43ecf9e1a01eac53b83c3f803d3670b1}


Decompress the tracker TOTS. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em tot}]Pointer to where to store the decoded tots\item[{\em ntots}]The number of TOTs to decode and fill\item[{\em tots}]The decompression context for the TOTs\item[{\em dtx}]The compressed bit stream descriptor\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the next 32-bit word to be filled in \end{Desc}
\hypertarget{decode_8c_b50dde5c3ba66503c6e4671f5e504bac}{
\index{decode.c@{decode.c}!expandGem@{expandGem}}
\index{expandGem@{expandGem}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void expandGem ({\bf QSEC\_\-expansion} $\ast$ {\em exp}, EBF\_\-gem $\ast$ {\em gem})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8c_b50dde5c3ba66503c6e4671f5e504bac}


Populate the data portion of a GEM contribution. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em exp}]Pointer to the expansion structure\item[{\em gem}]Pointer to the GEM structure to populate \end{description}
\end{Desc}
\hypertarget{decode_8c_755017c5a2903d7b266536bcd75c08e6}{
\index{decode.c@{decode.c}!fixupCtbHdr@{fixupCtbHdr}}
\index{fixupCtbHdr@{fixupCtbHdr}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline void fixupCtbHdr (EBF\_\-ctbHdr $\ast$ {\em hdr})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8c_755017c5a2903d7b266536bcd75c08e6}


When the ACD is not included in the output stream (as it is now), the final TEM contribution must have its response bit removed. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em hdr}]The contribution header to patch \end{description}
\end{Desc}
\hypertarget{decode_8c_a5f6c15dc1ca8b02d1b36696384b37c6}{
\index{decode.c@{decode.c}!QSEC_decode@{QSEC\_\-decode}}
\index{QSEC_decode@{QSEC\_\-decode}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned int QSEC\_\-decode ({\bf QSEC\_\-expansion} $\ast$ {\em exp}, QSE\_\-ebfEvt $\ast$ {\em oevt}, const unsigned int $\ast$ {\em ievt})}}
\label{decode_8c_a5f6c15dc1ca8b02d1b36696384b37c6}


Decode the event held in the expansion structure into the QSE\_\-evt structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em exp}]Pointer to the expansion structure holding the histograms and encoder context\item[{\em oevt}]Pointer to the location to output the decoded event\item[{\em ievt}]Pointer to the location to input the encoded event\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Length, in bytes, of the event data \end{Desc}
\hypertarget{decode_8c_ba9ac8250f9a04ab05ae6aa4bdfa6a78}{
\index{decode.c@{decode.c}!QSEC_update@{QSEC\_\-update}}
\index{QSEC_update@{QSEC\_\-update}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void QSEC\_\-update ({\bf QSEC\_\-expansion} $\ast$ {\em exp}, EBF\_\-gem $\ast$ {\em gem}, unsigned int $\ast$ {\em seq}, const unsigned int $\ast$ {\em ievt})}}
\label{decode_8c_ba9ac8250f9a04ab05ae6aa4bdfa6a78}


Decode the GEM contribution and extract the 17 bit event sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em exp}]Pointer to the expansion structure holding the histograms and encoder context\item[{\em gem}]Pointer to the location to place the decoded GEM contribution\item[{\em seq}]Pointer to the location to place the 17-bit event sequence number\item[{\em ievt}]Pointer to the location to input the encoded event number for use in QSE\_\-ctxUpdateAtEvent \end{description}
\end{Desc}
\hypertarget{decode_8c_ff331296d2e46df468f343e57bb1c810}{
\index{decode.c@{decode.c}!roundUpInt@{roundUpInt}}
\index{roundUpInt@{roundUpInt}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline unsigned int roundUpInt (unsigned int {\em ui}, int {\em r})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8c_ff331296d2e46df468f343e57bb1c810}


Round the specified integer up to a binary boundary. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ui}]The integer to round\item[{\em r}]The boundary to round to. This must be a power of 2, i.e. 1, 2, 4, 8 etc\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The rounded integer \end{Desc}
\hypertarget{decode_8c_157bd64220158a010bdfc87b3ae622e9}{
\index{decode.c@{decode.c}!roundUpPtr@{roundUpPtr}}
\index{roundUpPtr@{roundUpPtr}!decode.c@{decode.c}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}static \_\-\_\-inline void$\ast$ roundUpPtr (void $\ast$ {\em ptr}, int {\em r})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{decode_8c_157bd64220158a010bdfc87b3ae622e9}


Round the specified pointer up to a specified binary boundary. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ptr}]The pointer to round\item[{\em r}]The boundary to round to. This must be a power of 2, i.e. 1, 2, 4, 8 etc\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The rounded pointer \end{Desc}
