1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030609: Coding - eliminate warnings issued by gcc 8.1.0

Warnings issued by gcc 8.1.0 are eliminated.

New Standard_WarningDisableFunctionCast.hxx header file is introduced to disable GCC warning "-Wcast-function-type" in those files *.cxx where it is issued. This warning is issued when the conversion from the pointer to one function type to the pointer to another function type takes places, it was added in gcc 8.1.0.

The function MyVISEDG in SWDRAW_ShapeAnalysis.cxx is removed as it does not seem to do anything useful and relevant DRAW command K_VISEDG is never used in tests.
This commit is contained in:
tiv
2019-10-25 16:01:09 +03:00
committed by apn
parent 53d770b3a2
commit f4a7308f61
15 changed files with 137 additions and 138 deletions

View File

@@ -37,6 +37,9 @@
#include <TCollection_AsciiString.hxx>
#include <tcl.h>
#include <Standard_WarningDisableFunctionCast.hxx>
// on MSVC, use #pragma to define name of the Tcl library to link with,
// depending on Tcl version number
#ifdef _MSC_VER

View File

@@ -2003,7 +2003,7 @@ void Segment::Init(Standard_Integer a1, Standard_Integer a2,
y2=a4;
}
static DWORD WINAPI tkLoop(VOID);
static DWORD WINAPI tkLoop (LPVOID theThreadParameter);
#ifdef _TK
static Tk_Window mainWindow;
#endif
@@ -2027,12 +2027,12 @@ Standard_Boolean Init_Appli(HINSTANCE hInst,
dwMainThreadId = GetCurrentThreadId();
//necessary for normal Tk operation
hThread = CreateThread(NULL, // no security attributes
0, // use default stack size
(LPTHREAD_START_ROUTINE) tkLoop, // thread function
NULL, // no thread function argument
0, // use default creation flags
&IDThread);
hThread = CreateThread (NULL, // no security attributes
0, // use default stack size
tkLoop, // thread function
NULL, // no thread function argument
0, // use default creation flags
&IDThread);
if (!hThread) {
std::cout << "Failed to create Tcl/Tk main loop thread. Switching to batch mode..." << std::endl;
Draw_Batch = Standard_True;
@@ -2082,8 +2082,9 @@ Standard_Boolean Draw_Interprete (const char*);
/*--------------------------------------------------------*\
| readStdinThreadFunc
\*--------------------------------------------------------*/
static DWORD WINAPI readStdinThreadFunc()
static DWORD WINAPI readStdinThreadFunc (const LPVOID theThreadParameter)
{
(void)theThreadParameter;
if (!Draw_IsConsoleSubsystem)
{
return 1;
@@ -2246,8 +2247,9 @@ static void ResetStdChannel (int type)
/*--------------------------------------------------------*\
| tkLoop: implements Tk_Main()-like behaviour in a separate thread
\*--------------------------------------------------------*/
static DWORD WINAPI tkLoop(VOID)
static DWORD WINAPI tkLoop (const LPVOID theThreadParameter)
{
(void)theThreadParameter;
Tcl_CreateExitHandler(exitProc, 0);
Draw_Interpretor& aCommands = Draw::GetInterpretor();
@@ -2309,7 +2311,7 @@ static DWORD WINAPI tkLoop(VOID)
#endif
}
}
catch (Standard_Failure)
catch (const Standard_Failure&)
{
std::cout << "tkLoop: exception in TK_Init\n";
}
@@ -2389,12 +2391,12 @@ void Run_Appli(HWND hWnd)
DWORD IDThread;
HANDLE hThread;
if (Draw_IsConsoleSubsystem) {
hThread = CreateThread(NULL, // no security attributes
0, // use default stack size
(LPTHREAD_START_ROUTINE) readStdinThreadFunc, // thread function
NULL, // no thread function argument
0, // use default creation flags
&IDThread); // returns thread identifier
hThread = CreateThread (NULL, // no security attributes
0, // use default stack size
readStdinThreadFunc, // thread function
NULL, // no thread function argument
0, // use default creation flags
&IDThread); // returns thread identifier
if (!hThread) {
std::cout << "pb in creation of the thread reading stdin" << std::endl;
Draw_IsConsoleSubsystem = Standard_False;