Index: doc/generic_types/generic_types.tex
===================================================================
--- doc/generic_types/generic_types.tex	(revision 4635c79a022bb51f9d27be57797c6b4484139ff9)
+++ doc/generic_types/generic_types.tex	(revision 1dc6df001ee514a009bfc103942e0b4dbe92ea61)
@@ -257,5 +257,5 @@
 For example, it is possible to write a type-safe \CFA wrapper @malloc@ based on the C @malloc@:
 \begin{lstlisting}
-forall( dtype T | sized(T) ) T * malloc( void ) { return (T *)(void *)malloc( (size_t)sizeof(T) ); }
+forall( dtype T | sized(T) ) T * malloc( void ) { return (T *)malloc( sizeof(T) ); }
 int * ip = malloc();						$\C{// select type and size from left-hand side}$
 double * dp = malloc();
@@ -505,5 +505,5 @@
 Consider C's @div@ and @remquo@ functions, which return the quotient and remainder for a division of integer and floating-point values, respectively.
 \begin{lstlisting}
-typedef struct { int quo, rem; } div_t;
+typedef struct { int quo, rem; } div_t;		$\C{// from include stdlib.h}$
 div_t div( int num, int den );
 double remquo( double num, double den, int * quo );
@@ -759,6 +759,5 @@
 \begin{lstlisting}
 int f( [int, double], double );
-forall(otype T, otype U | { T f( T, U, U ); })
-void g( T, U );
+forall(otype T, otype U | { T f( T, U, U ); }) void g( T, U );
 g( 5, 10.21 );
 \end{lstlisting}
@@ -767,7 +766,5 @@
 Whenever a candidate's parameter structure does not exactly match the formal parameter's structure, a thunk is generated to specialize calls to the actual function:
 \begin{lstlisting}
-int _thunk( int _p0, double _p1, double _p2 ) {
-	return f( [_p0, _p1], _p2 );
-}
+int _thunk( int _p0, double _p1, double _p2 ) { return f( [_p0, _p1], _p2 ); }
 \end{lstlisting}
 so the thunk provides flattening and structuring conversions to inferred functions, improving the compatibility of tuples and polymorphism.
