mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
0023904: Multiple warning on Windows x86_64 target concerning WinAPI usage
This commit is contained in:
parent
f14190252b
commit
6a7d83c480
@ -81,10 +81,9 @@ HWND CreateCommandWindow(HWND hWnd, int nitem)
|
|||||||
/*--------------------------------------------------------*\
|
/*--------------------------------------------------------*\
|
||||||
| COMMAND WINDOW PROCEDURE
|
| COMMAND WINDOW PROCEDURE
|
||||||
\*--------------------------------------------------------*/
|
\*--------------------------------------------------------*/
|
||||||
LONG APIENTRY CommandProc(HWND hWnd, UINT wMsg, WPARAM wParam, LONG lParam )
|
LRESULT APIENTRY CommandProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam )
|
||||||
{
|
{
|
||||||
HWND hWndEdit;
|
HWND hWndEdit;
|
||||||
int index; // Nb of characters in the buffer of hWndEdit
|
|
||||||
MINMAXINFO* lpmmi;
|
MINMAXINFO* lpmmi;
|
||||||
|
|
||||||
switch(wMsg)
|
switch(wMsg)
|
||||||
@ -102,12 +101,15 @@ LONG APIENTRY CommandProc(HWND hWnd, UINT wMsg, WPARAM wParam, LONG lParam )
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_SIZE :
|
case WM_SIZE :
|
||||||
|
{
|
||||||
hWndEdit = (HWND)GetWindowLong(hWnd, CLIENTWND);
|
hWndEdit = (HWND)GetWindowLong(hWnd, CLIENTWND);
|
||||||
MoveWindow(hWndEdit, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
|
MoveWindow(hWndEdit, 0, 0, LOWORD(lParam), HIWORD(lParam), TRUE);
|
||||||
// Place the cursor at the end of the buffer
|
// Place the cursor at the end of the buffer
|
||||||
index = SendMessage(hWnd, WM_GETTEXTLENGTH, 0l, 0l);
|
// Nb of characters in the buffer of hWndEdit
|
||||||
|
LRESULT index = SendMessage(hWnd, WM_GETTEXTLENGTH, 0l, 0l);
|
||||||
SendMessage(hWnd, EM_SETSEL, index, index);
|
SendMessage(hWnd, EM_SETSEL, index, index);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case WM_SETFOCUS :
|
case WM_SETFOCUS :
|
||||||
hWndEdit = (HWND)GetWindowLong(hWnd, CLIENTWND);
|
hWndEdit = (HWND)GetWindowLong(hWnd, CLIENTWND);
|
||||||
@ -122,7 +124,7 @@ LONG APIENTRY CommandProc(HWND hWnd, UINT wMsg, WPARAM wParam, LONG lParam )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
LONG APIENTRY EditProc(HWND, UINT, WPARAM, LONG);
|
LRESULT APIENTRY EditProc(HWND, UINT, WPARAM, LPARAM);
|
||||||
/*--------------------------------------------------------*\
|
/*--------------------------------------------------------*\
|
||||||
| COMMAND CREATE PROCEDURE
|
| COMMAND CREATE PROCEDURE
|
||||||
\*--------------------------------------------------------*/
|
\*--------------------------------------------------------*/
|
||||||
@ -176,7 +178,7 @@ int GetCommand(HWND hWnd, char* buffer)
|
|||||||
int again = 1;
|
int again = 1;
|
||||||
char temp[COMMANDSIZE]="";
|
char temp[COMMANDSIZE]="";
|
||||||
|
|
||||||
int nbLine = SendMessage(hWnd, EM_GETLINECOUNT, 0l, 0l);
|
int nbLine = (int )SendMessage(hWnd, EM_GETLINECOUNT, 0l, 0l);
|
||||||
|
|
||||||
int nbChar = 0;
|
int nbChar = 0;
|
||||||
buffer[0]='\0';
|
buffer[0]='\0';
|
||||||
@ -187,7 +189,7 @@ int GetCommand(HWND hWnd, char* buffer)
|
|||||||
WORD* nbMaxChar = (WORD*)temp;
|
WORD* nbMaxChar = (WORD*)temp;
|
||||||
*nbMaxChar = COMMANDSIZE-1;
|
*nbMaxChar = COMMANDSIZE-1;
|
||||||
|
|
||||||
int nbCharRead = SendMessage(hWnd, EM_GETLINE, nbLine-1, (LPARAM)temp);
|
int nbCharRead = (int )SendMessage(hWnd, EM_GETLINE, nbLine-1, (LPARAM)temp);
|
||||||
nbChar += nbCharRead ;
|
nbChar += nbCharRead ;
|
||||||
int cmp = strncmp(temp, PROMPT, 10);
|
int cmp = strncmp(temp, PROMPT, 10);
|
||||||
temp[nbCharRead]='\0';
|
temp[nbCharRead]='\0';
|
||||||
@ -208,13 +210,13 @@ extern char console_command[1000];
|
|||||||
/*--------------------------------------------------------*\
|
/*--------------------------------------------------------*\
|
||||||
| EDIT WINDOW PROCEDURE
|
| EDIT WINDOW PROCEDURE
|
||||||
\*--------------------------------------------------------*/
|
\*--------------------------------------------------------*/
|
||||||
LONG APIENTRY EditProc(HWND hWnd, UINT wMsg, WPARAM wParam, LONG lParam )
|
LRESULT APIENTRY EditProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam )
|
||||||
{
|
{
|
||||||
char buffer[COMMANDSIZE];
|
char buffer[COMMANDSIZE];
|
||||||
POINT pos;
|
POINT pos;
|
||||||
BOOL rep;
|
BOOL rep;
|
||||||
static int nbline; // Process the buffer of the edit window
|
static LRESULT nbline; // Process the buffer of the edit window
|
||||||
int index;
|
LRESULT index;
|
||||||
|
|
||||||
switch(wMsg)
|
switch(wMsg)
|
||||||
{
|
{
|
||||||
|
@ -1365,7 +1365,7 @@ HWND DrawWindow::CreateDrawWindow(HWND hWndClient, int nitem)
|
|||||||
/*--------------------------------------------------------*\
|
/*--------------------------------------------------------*\
|
||||||
| DRAW WINDOW PROCEDURE
|
| DRAW WINDOW PROCEDURE
|
||||||
\*--------------------------------------------------------*/
|
\*--------------------------------------------------------*/
|
||||||
LONG APIENTRY DrawWindow::DrawProc(HWND hWnd, UINT wMsg, WPARAM wParam, LONG lParam )
|
LRESULT APIENTRY DrawWindow::DrawProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam )
|
||||||
{
|
{
|
||||||
DrawWindow* localObjet = (DrawWindow*)GetWindowLong(hWnd, CLIENTWND);
|
DrawWindow* localObjet = (DrawWindow*)GetWindowLong(hWnd, CLIENTWND);
|
||||||
if (!localObjet)
|
if (!localObjet)
|
||||||
@ -1490,15 +1490,15 @@ DrawWindow::~DrawWindow()
|
|||||||
void DrawWindow::Init(Standard_Integer theXLeft, Standard_Integer theYTop,
|
void DrawWindow::Init(Standard_Integer theXLeft, Standard_Integer theYTop,
|
||||||
Standard_Integer theWidth, Standard_Integer theHeight)
|
Standard_Integer theWidth, Standard_Integer theHeight)
|
||||||
{
|
{
|
||||||
if (win == 0)
|
if (win == NULL)
|
||||||
{
|
{
|
||||||
win = CreateDrawWindow(hWndClientMDI, 0);
|
win = CreateDrawWindow(hWndClientMDI, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// include decorations in the window dimensions
|
// include decorations in the window dimensions
|
||||||
// to reproduce same behaviour of Xlib window.
|
// to reproduce same behaviour of Xlib window.
|
||||||
DWORD aWinStyle = GetWindowLongPtr (win, GWL_STYLE);
|
DWORD aWinStyle = GetWindowLong (win, GWL_STYLE);
|
||||||
DWORD aWinStyleEx = GetWindowLongPtr (win, GWL_EXSTYLE);
|
DWORD aWinStyleEx = GetWindowLong (win, GWL_EXSTYLE);
|
||||||
HMENU aMenu = GetMenu (win);
|
HMENU aMenu = GetMenu (win);
|
||||||
|
|
||||||
RECT aRect;
|
RECT aRect;
|
||||||
@ -1820,7 +1820,7 @@ void DrawWindow::DrawString(int x,int y, char* text)
|
|||||||
HDC hDC = GetDC(win);
|
HDC hDC = GetDC(win);
|
||||||
HDC aWorkDC = myUseBuffer ? GetMemDC(hDC) : hDC;
|
HDC aWorkDC = myUseBuffer ? GetMemDC(hDC) : hDC;
|
||||||
|
|
||||||
TextOut(aWorkDC, x, y, text, strlen(text));
|
TextOut(aWorkDC, x, y, text, (int )strlen(text));
|
||||||
|
|
||||||
if (myUseBuffer) ReleaseMemDC(aWorkDC);
|
if (myUseBuffer) ReleaseMemDC(aWorkDC);
|
||||||
ReleaseDC(win,hDC);
|
ReleaseDC(win,hDC);
|
||||||
|
@ -435,7 +435,7 @@ public:
|
|||||||
__Draw_API static void SelectNoWait (HANDLE&,int&,int&,int&);
|
__Draw_API static void SelectNoWait (HANDLE&,int&,int&,int&);
|
||||||
|
|
||||||
// Procedure de fenetre
|
// Procedure de fenetre
|
||||||
__Draw_API static LONG APIENTRY DrawProc (HWND,UINT,WPARAM,LONG);
|
__Draw_API static LRESULT APIENTRY DrawProc (HWND,UINT,WPARAM,LPARAM);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
*/
|
*/
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
|
||||||
LONG APIENTRY WndProc(HWND, UINT, WPARAM, LONG);
|
LRESULT APIENTRY WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||||
BOOL CreateProc(HWND);
|
BOOL CreateProc(HWND);
|
||||||
VOID DestroyProc(HWND);
|
VOID DestroyProc(HWND);
|
||||||
BOOL CommandProc(HWND, WPARAM, LPARAM);
|
BOOL CommandProc(HWND, WPARAM, LPARAM);
|
||||||
|
@ -41,7 +41,7 @@ extern Standard_Boolean Draw_IsConsoleSubsystem;
|
|||||||
|
|
|
|
||||||
|
|
|
|
||||||
\*--------------------------------------------------------*/
|
\*--------------------------------------------------------*/
|
||||||
LONG APIENTRY WndProc(HWND hWndFrame, UINT wMsg, WPARAM wParam, LONG lParam )
|
LRESULT APIENTRY WndProc(HWND hWndFrame, UINT wMsg, WPARAM wParam, LPARAM lParam )
|
||||||
{
|
{
|
||||||
HWND hWndClient;
|
HWND hWndClient;
|
||||||
switch(wMsg)
|
switch(wMsg)
|
||||||
|
@ -329,7 +329,7 @@ bool Image_AlienPixMap::savePPM (const TCollection_AsciiString& theFileName) con
|
|||||||
for (Standard_Size aCol = 0; aCol < SizeY(); ++aCol)
|
for (Standard_Size aCol = 0; aCol < SizeY(); ++aCol)
|
||||||
{
|
{
|
||||||
// extremely SLOW but universal (implemented for all supported pixel formats)
|
// extremely SLOW but universal (implemented for all supported pixel formats)
|
||||||
aColor = PixelColor (aCol, aRow, aDummy);
|
aColor = PixelColor ((Standard_Integer )aCol, (Standard_Integer )aRow, aDummy);
|
||||||
aByte = Standard_Byte(aColor.Red() * 255.0); fwrite (&aByte, 1, 1, aFile);
|
aByte = Standard_Byte(aColor.Red() * 255.0); fwrite (&aByte, 1, 1, aFile);
|
||||||
aByte = Standard_Byte(aColor.Green() * 255.0); fwrite (&aByte, 1, 1, aFile);
|
aByte = Standard_Byte(aColor.Green() * 255.0); fwrite (&aByte, 1, 1, aFile);
|
||||||
aByte = Standard_Byte(aColor.Blue() * 255.0); fwrite (&aByte, 1, 1, aFile);
|
aByte = Standard_Byte(aColor.Blue() * 255.0); fwrite (&aByte, 1, 1, aFile);
|
||||||
|
@ -299,7 +299,7 @@ Standard_Boolean OpenGl_Context::CheckExtension (const char* theExtName) const
|
|||||||
std::cerr << "CheckExtension called with NULL string!\n";
|
std::cerr << "CheckExtension called with NULL string!\n";
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
int anExtNameLen = strlen (theExtName);
|
const size_t anExtNameLen = strlen (theExtName);
|
||||||
|
|
||||||
// available since OpenGL 3.0
|
// available since OpenGL 3.0
|
||||||
// and the ONLY way to check extensions with OpenGL 3.1+ core profile
|
// and the ONLY way to check extensions with OpenGL 3.1+ core profile
|
||||||
@ -333,7 +333,7 @@ Standard_Boolean OpenGl_Context::CheckExtension (const char* theExtName) const
|
|||||||
const char* aPtrEnd = aPtrIter + strlen (anExtString);
|
const char* aPtrEnd = aPtrIter + strlen (anExtString);
|
||||||
while (aPtrIter < aPtrEnd)
|
while (aPtrIter < aPtrEnd)
|
||||||
{
|
{
|
||||||
int n = strcspn (aPtrIter, " ");
|
const size_t n = strcspn (aPtrIter, " ");
|
||||||
if ((n == anExtNameLen) && (strncmp (aPtrIter, theExtName, anExtNameLen) == 0))
|
if ((n == anExtNameLen) && (strncmp (aPtrIter, theExtName, anExtNameLen) == 0))
|
||||||
{
|
{
|
||||||
return Standard_True;
|
return Standard_True;
|
||||||
|
@ -1389,7 +1389,7 @@ void OpenGl_View::CreateBackgroundTexture (const Standard_CString theFilePath,
|
|||||||
{
|
{
|
||||||
for (Standard_Size aCol = 0; aCol < anImage.SizeX(); ++aCol)
|
for (Standard_Size aCol = 0; aCol < anImage.SizeX(); ++aCol)
|
||||||
{
|
{
|
||||||
aSrcColor = anImageLoaded.PixelColor (aCol, aRow);
|
aSrcColor = anImageLoaded.PixelColor ((Standard_Integer )aCol, (Standard_Integer )aRow);
|
||||||
Image_ColorRGB& aColor = aDataNew.ChangeValue (aRow, aCol);
|
Image_ColorRGB& aColor = aDataNew.ChangeValue (aRow, aCol);
|
||||||
aColor.r() = int(255.0 * aSrcColor.Red());
|
aColor.r() = int(255.0 * aSrcColor.Red());
|
||||||
aColor.g() = int(255.0 * aSrcColor.Green());
|
aColor.g() = int(255.0 * aSrcColor.Green());
|
||||||
|
@ -429,27 +429,25 @@ void WNT_Window :: doCreate (
|
|||||||
const Quantity_NameOfColor aBackColor
|
const Quantity_NameOfColor aBackColor
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
LONG uData;
|
|
||||||
WINDOWPLACEMENT wp;
|
|
||||||
|
|
||||||
ZeroMemory (&myExtraData, sizeof (WNT_WindowData));
|
ZeroMemory (&myExtraData, sizeof (WNT_WindowData));
|
||||||
|
|
||||||
myHWindow = aHandle;
|
myHWindow = aHandle;
|
||||||
myHParentWindow = GetParent ((HWND )aHandle);
|
myHParentWindow = GetParent ((HWND )aHandle);
|
||||||
uData = GetWindowLongPtr ((HWND )aHandle, GWLP_USERDATA);
|
LONG_PTR uData = GetWindowLongPtr ((HWND )aHandle, GWLP_USERDATA);
|
||||||
myUsrData = Standard_Address(-1);
|
myUsrData = Standard_Address(-1);
|
||||||
|
|
||||||
SetBackground (aBackColor);
|
SetBackground (aBackColor);
|
||||||
|
|
||||||
myExtraData.WNT_Window_Ptr = (void* )this;
|
myExtraData.WNT_Window_Ptr = (void* )this;
|
||||||
|
|
||||||
if (uData != (LONG )&myExtraData)
|
if (uData != (LONG_PTR )&myExtraData)
|
||||||
{
|
{
|
||||||
myUsrData = (Standard_Address )SetWindowLongPtr ((HWND )myHWindow, GWLP_USERDATA, (LONG_PTR )&myExtraData);
|
myUsrData = (Standard_Address )SetWindowLongPtr ((HWND )myHWindow, GWLP_USERDATA, (LONG_PTR )&myExtraData);
|
||||||
}
|
}
|
||||||
|
|
||||||
myExtraData.dwFlags = WDF_FOREIGN;
|
myExtraData.dwFlags = WDF_FOREIGN;
|
||||||
|
|
||||||
|
WINDOWPLACEMENT wp;
|
||||||
wp.length = sizeof (WINDOWPLACEMENT);
|
wp.length = sizeof (WINDOWPLACEMENT);
|
||||||
GetWindowPlacement ((HWND )myHWindow, &wp);
|
GetWindowPlacement ((HWND )myHWindow, &wp);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user