1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0023947: Eliminate trivial compiler warnings in MSVC++ with warning level 4

Fix first subset of warnings (about 100)
- while(1) and similar constructs replaced by for(;;)
- some uninitialized variables corrected
Got rid of Warning C4189: local variable is initialised but not referenced
Corrected mistakes after getting rid of C4189 compiler warning
Corrected some mistakes that led to compiling errors
Fixed test case because of improvement message - removed unnecessary TODO.
Small fix: tabs have been replaced with whitespaces.
Added TODO for Windows platform
removed last TODO
Corrected mistakes, returned some #ifdef DEB code, fixed test case .
Restoring a few places which have been modified too much
Small grammar fix
Deleted unnecessary puts in bugs/end
This commit is contained in:
omy
2013-07-12 12:37:38 +04:00
parent a8195d65ba
commit 302f96fb0d
189 changed files with 455 additions and 1010 deletions

View File

@@ -287,45 +287,6 @@ Standard_Boolean WNT_Window :: DoMapping () const {
return Standard_True;
}
static Standard_Boolean ConvertBitmap (HBITMAP theHBitmap,
Image_PixMap& thePixMap)
{
// Get informations about the bitmap
BITMAP aBitmap;
if (GetObject (theHBitmap, sizeof(BITMAP), (LPSTR )&aBitmap) == 0)
{
return Standard_False;
}
const Standard_Size aSizeRowBytes = Standard_Size(aBitmap.bmWidth) * 4;
if (!thePixMap.InitTrash (Image_PixMap::ImgBGR32, Standard_Size(aBitmap.bmWidth), Standard_Size(aBitmap.bmHeight), aSizeRowBytes))
{
return Standard_False;
}
thePixMap.SetTopDown (false);
// Setup image data
BITMAPINFOHEADER aBitmapInfo;
memset (&aBitmapInfo, 0, sizeof(BITMAPINFOHEADER));
aBitmapInfo.biSize = sizeof(BITMAPINFOHEADER);
aBitmapInfo.biWidth = aBitmap.bmWidth;
aBitmapInfo.biHeight = aBitmap.bmHeight; // positive means bottom-up!
aBitmapInfo.biPlanes = 1;
aBitmapInfo.biBitCount = 32; // use 32bit for automatic word-alignment per row
aBitmapInfo.biCompression = BI_RGB;
// Copy the pixels
HDC aDC = GetDC (NULL);
Standard_Boolean isSuccess = GetDIBits (aDC, theHBitmap,
0, // first scan line to set
aBitmap.bmHeight, // number of scan lines to copy
thePixMap.ChangeData(), // array for bitmap bits
(LPBITMAPINFO )&aBitmapInfo, // bitmap data info
DIB_RGB_COLORS) != 0;
ReleaseDC (NULL, aDC);
return isSuccess;
}
//***//
//******************************* Ratio **********************************//
//***//