use of div_t.quot and div_t.rem were changed to / and %

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3156 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Unknown (AN)
1999-07-26 19:22:21 +00:00
parent e9158f7d8b
commit bae41ce192

View File

@@ -592,11 +592,11 @@ wxBitmap wxImage::ConvertToBitmap() const
// calc the number of bytes per scanline and padding // calc the number of bytes per scanline and padding
int bytePerLine = width*3; int bytePerLine = width*3;
int sizeDWORD = sizeof( DWORD ); int sizeDWORD = sizeof( DWORD );
div_t lineBoundary = div( bytePerLine, sizeDWORD ); int lineBoundary = bytePerLine % sizeDWORD;
int padding = 0; int padding = 0;
if( lineBoundary.rem > 0 ) if( lineBoundary > 0 )
{ {
padding = sizeDWORD - lineBoundary.rem; padding = sizeDWORD - lineBoundary;
bytePerLine += padding; bytePerLine += padding;
} }
// calc the number of DIBs and heights of DIBs // calc the number of DIBs and heights of DIBs
@@ -607,9 +607,8 @@ wxBitmap wxImage::ConvertToBitmap() const
height = bmpHeight; height = bmpHeight;
else else
{ {
div_t result = div( bmpHeight, height ); numDIB = bmpHeight / height;
numDIB = result.quot; hRemain = bmpHeight % height;
hRemain = result.rem;
if( hRemain >0 ) numDIB++; if( hRemain >0 ) numDIB++;
} }
@@ -805,11 +804,11 @@ wxImage::wxImage( const wxBitmap &bitmap )
// calc the number of bytes per scanline and padding in the DIB // calc the number of bytes per scanline and padding in the DIB
int bytePerLine = width*3; int bytePerLine = width*3;
int sizeDWORD = sizeof( DWORD ); int sizeDWORD = sizeof( DWORD );
div_t lineBoundary = div( bytePerLine, sizeDWORD ); int lineBoundary = bytePerLine % sizeDWORD;
int padding = 0; int padding = 0;
if( lineBoundary.rem > 0 ) if( lineBoundary > 0 )
{ {
padding = sizeDWORD - lineBoundary.rem; padding = sizeDWORD - lineBoundary;
bytePerLine += padding; bytePerLine += padding;
} }