]> OCCT Git - occt.git/commitdiff
0033669: Coding - Processing Clang-19 warnings
authordpasukhi <dmitry.pasukhin@opencascade.com>
Sat, 6 Apr 2024 10:34:27 +0000 (10:34 +0000)
committerdpasukhi <dmitry.pasukhin@opencascade.com>
Sat, 6 Apr 2024 10:34:27 +0000 (10:34 +0000)
Fixed issue with not-used variables
Fixed issue with function casting

src/Draw/Draw.cxx
src/Image/Image_AlienPixMap.cxx
src/OpenGl/OpenGl_Context.cxx
src/Plugin/Plugin.cxx

index 8bf5fbf0361694601ad535ebc3a123bb76657b5a..02ecc2df5ceae7adf9c9cc89b2cf84ecdb070587 100644 (file)
@@ -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);
 }
 
index f869e8fc16dc868ac2aec7db76292b503aaeeba2..1b486111c80a66eb3613fa7050c99e4b2e497377 100644 (file)
@@ -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
index 9380b93672f9f2613b185eae15ff2696c773c559..d48ce54df6c993a560b94219ba4e9242c02241f7 100644 (file)
@@ -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;
   }
index 6ad8b2345116f4785be62135874b384c68db6fdc..acee3d6d021b252f7b3e92368f1a4cf302febb60 100644 (file)
@@ -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;