Although you explicitly state the hyphenations of the variables (via \-), you leave the variable types (typeset using {\bf ...}) as is. This is a problem, since LaTeX does not know where these "words" need to be hyphenated at the end of a line. This is also evident from LaTeX's attempt to hyphenate DataWidth as DataW\-idth in your second example; something that is obviously wrong.
One solution might be impose a \raggedright formatting in the \subsubsection{...} definition that would allow words to be wrapped (instead of hyphenated) at the end of \linewidth:
\subsubsection[{j1939\_\-initialize\_\-stack}]{\raggedright%
void j1939\_\-initialize\_\-stack (
\begin{DoxyParamCaption}
\item[{{\bf j1939\_\-stack\_\-id\_\-t}}]{stack\_\-id, }
\item[{{\bf ProtocolRXTablePtr}}]{rx\_\-table\_\-ptr, }
\item[{{\bf J1939TransmitMessagePtr}}]{tx\_\-table\_\-ptr, }
\item[{{\bf uint16}}]{tx\_\-table\_\-size, }
\item[{{\bf uchar8} $\ast$}]{rx\_\-buff, }
\item[{{\bf uint16}}]{rx\_\-buff\_\-size}
\end{DoxyParamCaption}
)}
However, this actually makes the use of manual hyphenation unnecessary. Regardless, some cleanup is also encouraged in the code:
- As suggested by
l2tabu, the use of {\bf ...} is considered obsolete. Rather use \textbf{...} for local font changes, or {\bfseries ...} for global font changes.
- There's no need for double-nesting the descriptor field of
\item[...]. It would suffice to have \item[\textbf{uint16}]{rx\_\-buff\_\-size}.
- Edit:
The redefinition of \item does not require using ##1 and ##2; so change it to #1 and #2. Not sure whether this is possible, since your document may contain other uses and/or redefinitions, so you're keeping it this way for consistency.
- You could include the boldface font change for the variable type in the redefinition of
\item.
Using the above suggestions your code example could be simplified to
% is used for parameters within a detailed function description
\newenvironment{DoxyParamCaption}{%
\renewcommand{\item}[2][]{\textbf{##1} {\normalfont\em ##2}}%
}{%
}
\subsubsection[j1939\_initialize\_stack]{\raggedright%
void j1939\_initialize\_stack (
\begin{DoxyParamCaption}
\item[j1939\_stack\_id\_t]{stack\_id, }
\item[ProtocolRXTablePtr]{rx\_table\_ptr, }
\item[J1939TransmitMessagePtr]{tx\_table\_ptr, }
\item[uint16]{tx\_table\_size, }
\item[uchar8 $\ast$]{rx\_buff, }
\item[uint16]{rx\_buff\_size}
\end{DoxyParamCaption})}
which is a little easier to read. Since the scope/extent of the use is not clearly specified, defining a more solid definition of \subsubsection to automatically perform a \raggedright justification via (say) titlesec was not implemented.
\bfor\itany longer. Usebfseriesinstead. See e.g. Does it matter if I use \textit or \it for more details. – Martin Scharrer Jul 29 '11 at 20:13