Instead of copying the whole formula, it could be done as
ULONG Height;
if (lpbmi->bmiHeader.biHeight >=0 )
Height = lpbmi->bmiHeader.biHeight;
else
Height = -lpbmi->bmiHeader.biHeight;
retSize = Height * ((lpbmi->bmiHeader.biWidth *
lpbmi->bmiHeader.biPlanes * lpbmi-
bmiHeader.biBitCount + 31) & -32) / 8;
Also comments contain typos
/* Make height postiive if it negitve then calc the bits Size and
align it*/
postiive, negitive
WBR,
Aleksey.
On Nov 30, 2008, at 4:17 PM, jimtabor(a)svn.reactos.org wrote:
> Author: jimtabor
> Date: Sun Nov 30 07:17:19 2008
> New Revision: 37766
> + if (lpbmi->bmiHeader.biHeight >=0 )
> + {
> + /* Calc the bits Size and align it*/
> + retSize = lpbmi->bmiHeader.biHeight * ((lpbmi-
> >bmiHeader.biWidth *
> + lpbmi->bmiHeader.biPlanes * lpbmi-
>
bmiHeader.biBitCount + 31) & -32) / 8;
> +
}
> + else
> + {
> + /* Make height postiive if it negitve then calc
> the bits Size and align it*/
> + retSize = (-lpbmi->bmiHeader.biHeight) * ((lpbmi-
> >bmiHeader.biWidth *
> + lpbmi->bmiHeader.biPlanes * lpbmi-
>
bmiHeader.biBitCount + 31) & -32) / 8;
> +
}