]> OCCT Git - occt.git/commitdiff
0025750: Coding rules - eliminate GCC warning -Wunused-but-set-variable in OSD_signal...
authoribs <ibs@opencascade.com>
Wed, 13 May 2015 08:59:36 +0000 (11:59 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 14 May 2015 14:43:49 +0000 (17:43 +0300)
Move variable aSigInfo to the proper scope.

src/OSD/OSD_signal.cxx

index ef2979150d295dd0c0e22abb66f6c62be556b08b..115f5dbcc4006fbb1b0b82957f4bbbb5662a50f5 100644 (file)
@@ -129,11 +129,6 @@ static void Handler (const int theSignal)
     perror ("sigaction");
   }
 
-  siginfo_t * aSigInfo = NULL;
-#ifdef SA_SIGINFO
-  aSigInfo = theSigInfo;
-#endif
-
 #if defined(HAVE_PTHREAD_H) && defined(NO_CXX_EXCEPTION)
   if (pthread_self() != getOCCThread()  || !Standard_ErrorHandler::IsInTryBlock()) {
     // use the previous signal handler
@@ -143,6 +138,12 @@ static void Handler (const int theSignal)
 
     if (asigacthandler.sa_flags & SA_SIGINFO) {
       void (*aCurInfoHandle)(int, siginfo_t *, void *) = asigacthandler.sa_sigaction;
+
+      siginfo_t * aSigInfo = NULL;
+#ifdef SA_SIGINFO
+      aSigInfo = theSigInfo;
+#endif
+
       if (aSigInfo) {
         switch (aSigInfo->si_signo) {
           case SIGFPE: