]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[trac3706] Clean up some issues from cpp check
authorShawn Routhier <sar@isc.org>
Fri, 27 Feb 2015 03:25:47 +0000 (19:25 -0800)
committerShawn Routhier <sar@isc.org>
Fri, 27 Feb 2015 03:25:47 +0000 (19:25 -0800)
Remove or comment out some variables that aren't read after they are written.

Tag the process classes as noncopyable to avoid external code trying
to copy them and to avoid an issue for cpp check

src/lib/dhcp/pkt6.cc
src/lib/log/logger_unittest_support.cc
src/lib/util/process_spawn.cc
src/lib/util/process_spawn.h

index 5b750e73853d8428309b993ad43a827f8a4f0e40..0cf28534c70e70a1900035659d331aaf60a0b175 100755 (executable)
@@ -313,7 +313,10 @@ Pkt6::unpackMsg(OptionBuffer::const_iterator begin,
         ((*begin++) << 8) + (*begin++);
     transid_ = transid_ & 0xffffff;
 
-    size -= sizeof(uint32_t); // We just parsed 4 bytes header
+    // See below about invoking Postel's law, as we aren't using
+    // size we don't need to update it.  If we do so in the future
+    // perhaps for stats gathering we can uncomment this.
+    //    size -= sizeof(uint32_t); // We just parsed 4 bytes header
 
     OptionBuffer opt_buffer(begin, end);
 
index 268feccd6ef6a1ca65780253591d311972db69c9..2caeeb14c76216f680ea98355291419e6166e385 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011,2014  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011,2014,2015  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -80,7 +80,6 @@ void initLogger(isc::log::Severity severity, int dbglevel) {
 
     // Root logger name is defined by the environment variable KEA_LOGGER_ROOT.
     // If not present, the name is "kea".
-    const char* DEFAULT_ROOT = "kea";
     const char* root = getenv("KEA_LOGGER_ROOT");
     if (! root) {
         // If not present, the name is "kea".
index c1cb83436a54029846d16204c926987cbab6fe16..3f55282ed58c2ec08670720444e47c831b12b9de 100644 (file)
@@ -30,7 +30,9 @@ namespace util {
 /// avoid exposing the internals of the implementation, such as
 /// custom handling of a SIGCHLD signal, and the conversion of the
 /// arguments of the executable from the STL container to the array.
-class ProcessSpawnImpl {
+///
+/// Made noncopyable to avoid problems with global operations
+class ProcessSpawnImpl : boost::noncopyable {
 public:
 
     /// @brief Constructor.
index a5f593c2d21cd2d4e682c6a3e86fe247d34710fc..6f726f766dd4ec3ec5ed507f4f28b4b3cd488536 100644 (file)
@@ -16,6 +16,7 @@
 #define PROCESS_SPAWN_H
 
 #include <exceptions/exceptions.h>
+#include <boost/noncopyable.hpp>
 #include <string>
 #include <sys/types.h>
 #include <vector>
@@ -53,10 +54,13 @@ typedef std::vector<std::string> ProcessArgs;
 /// attempt to register a new SIGCHLD signal handler and, as a
 /// consequence, the new @c ProcessSpawn object will fail to create.
 ///
+/// Made noncopyable to avoid problems with global operations
+///
 /// @todo The SIGCHLD handling logic should be moved to the @c SignalSet
 /// class so as multiple instances of the @c ProcessSpawn use the same
 /// SIGCHLD signal handler.
-class ProcessSpawn {
+
+class ProcessSpawn : boost::noncopyable {
 public:
 
     /// @brief Constructor.