From 323aa4abba62961106ce051fabe282c18ac21fb6 Mon Sep 17 00:00:00 2001 From: dpasukhi Date: Sat, 6 Apr 2024 10:34:27 +0000 Subject: [PATCH] 0033669: Coding - Processing Clang-19 warnings Fixed issue with not-used variables Fixed issue with function casting --- src/Draw/Draw.cxx | 2 +- src/Image/Image_AlienPixMap.cxx | 3 +++ src/OpenGl/OpenGl_Context.cxx | 2 +- src/Plugin/Plugin.cxx | 3 +-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Draw/Draw.cxx b/src/Draw/Draw.cxx index 8bf5fbf036..02ecc2df5c 100644 --- a/src/Draw/Draw.cxx +++ b/src/Draw/Draw.cxx @@ -719,7 +719,7 @@ void Draw::Load (Draw_Interpretor& theDI, } void (*fp) (Draw_Interpretor&) = NULL; - fp = (void (*)(Draw_Interpretor&) )aFunc; + fp = (void (*)(Draw_Interpretor&) )(void*)aFunc; (*fp) (theDI); } diff --git a/src/Image/Image_AlienPixMap.cxx b/src/Image/Image_AlienPixMap.cxx index f869e8fc16..1b486111c8 100644 --- a/src/Image/Image_AlienPixMap.cxx +++ b/src/Image/Image_AlienPixMap.cxx @@ -1251,6 +1251,7 @@ bool Image_AlienPixMap::Save (Standard_Byte* theBuffer, } return true; #else + (void)theLength; if (theBuffer != NULL) { Message::SendFail ("Error: no image library available"); @@ -1450,6 +1451,8 @@ bool Image_AlienPixMap::Save (std::ostream& theStream, const TCollection_AsciiSt } return true; #else + (void)theStream; + (void)theExtension; Message::SendFail ("Error: no image library available"); return false; #endif diff --git a/src/OpenGl/OpenGl_Context.cxx b/src/OpenGl/OpenGl_Context.cxx index 9380b93672..d48ce54df6 100644 --- a/src/OpenGl/OpenGl_Context.cxx +++ b/src/OpenGl/OpenGl_Context.cxx @@ -813,7 +813,7 @@ Standard_Boolean OpenGl_Context::SetSwapInterval (const Standard_Integer theInte && myFuncs->glXSwapIntervalEXT != NULL) { typedef int (*glXSwapIntervalEXT_t_x)(Display* theDisplay, GLXDrawable theDrawable, int theInterval); - glXSwapIntervalEXT_t_x aFuncPtr = (glXSwapIntervalEXT_t_x )myFuncs->glXSwapIntervalEXT; + glXSwapIntervalEXT_t_x aFuncPtr = (glXSwapIntervalEXT_t_x )(void*)myFuncs->glXSwapIntervalEXT; aFuncPtr ((Display* )myDisplay, (GLXDrawable )myWindow, theInterval); return Standard_True; } diff --git a/src/Plugin/Plugin.cxx b/src/Plugin/Plugin.cxx index 6ad8b23451..acee3d6d02 100644 --- a/src/Plugin/Plugin.cxx +++ b/src/Plugin/Plugin.cxx @@ -94,9 +94,8 @@ Handle(Standard_Transient) Plugin::Load (const Standard_GUID& aGUID, } else f = theMapOfFunctions(pid); - Standard_Transient* (*fp) (const Standard_GUID&) = NULL; - fp = (Standard_Transient* (*)(const Standard_GUID&)) f; + fp = (Standard_Transient* (*)(const Standard_GUID&))(void*)f; Handle(Standard_Transient) theServiceFactory = (*fp) (aGUID); return theServiceFactory; -- 2.39.5