[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4cxx-dev
Subject:    svn commit: r1707550 - /incubator/log4cxx/trunk/src/main/cpp/telnetappender.cpp
From:       tschoening () apache ! org
Date:       2015-10-08 14:35:33
Message-ID: 20151008143534.0287A3A03C8 () svn01-us-west ! apache ! org
[Download RAW message or body]

Author: tschoening
Date: Thu Oct  8 14:35:33 2015
New Revision: 1707550

URL: http://svn.apache.org/viewvc?rev=1707550&view=rev
Log:
Removed warning about unreachable code by making it reachable. Normally I do prefer \
early returns as wlel, but I guess the return NULL in this case has been left by \
purpose because some compilers7IDEs warn about the method should return some value \
else. Ignoring the warnign with #pragma seemed to much overhead, because that would \
need to be compiler specific.

Modified:
    incubator/log4cxx/trunk/src/main/cpp/telnetappender.cpp

Modified: incubator/log4cxx/trunk/src/main/cpp/telnetappender.cpp
URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/telnetappender.cpp?rev=1707550&r1=1707549&r2=1707550&view=diff
 ==============================================================================
--- incubator/log4cxx/trunk/src/main/cpp/telnetappender.cpp (original)
+++ incubator/log4cxx/trunk/src/main/cpp/telnetappender.cpp Thu Oct  8 14:35:33 2015
@@ -204,7 +204,8 @@ void* APR_THREAD_FUNC TelnetAppender::ac
                         Pool p;
                         pThis->writeStatus(newClient, LOG4CXX_STR("Log \
closed.\r\n"), p);  newClient->close();
-                        return NULL;
+
+                        break;
                 }
 
                 size_t count = pThis->activeConnections;
@@ -223,6 +224,7 @@ void* APR_THREAD_FUNC TelnetAppender::ac
                                 if (*iter == NULL) {
                                     *iter = newClient;
                                     pThis->activeConnections++;
+
                                     break;
                                 }
                         }
@@ -235,13 +237,13 @@ void* APR_THREAD_FUNC TelnetAppender::ac
                 }
         } catch(InterruptedIOException &e) {
                 if (pThis->closed) {
-                    return NULL;
+                    break;
                 }
         } catch(Exception& e) {
                 if (!pThis->closed) {
                     LogLog::error(LOG4CXX_STR("Encountered error while in \
SocketHandler loop."), e);  } else {
-                    return NULL;
+                    break;
                 }
         }
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic