Fix doxy comments and some other warnings 75/31775/1
authorPiotr Bartosiewicz <p.bartosiewi@partner.samsung.com>
Tue, 9 Dec 2014 16:08:00 +0000 (17:08 +0100)
committerPiotr Bartosiewicz <p.bartosiewi@partner.samsung.com>
Tue, 9 Dec 2014 16:08:00 +0000 (17:08 +0100)
[Bug/Feature]   N/A
[Cause]         N/A
[Solution]      N/A
[Verification]  Build

Change-Id: I5cff5b198d533ec256d551d9e8280a5c117e06d4

13 files changed:
CMakeLists.txt
cli/main.cpp
client/utils.cpp
client/vasum-client-impl.cpp
client/vasum-client.h
common/ipc/client.hpp
common/ipc/internals/event-queue.hpp
common/ipc/internals/processor.cpp
common/ipc/service.hpp
common/utils/initctl.cpp
server/zones-manager.cpp
tests/unit_tests/client/ut-client.cpp
tests/unit_tests/server/ut-zones-manager.cpp

index 34573cc..cd999d7 100644 (file)
@@ -77,7 +77,6 @@ ADD_DEFINITIONS(-DPROJECT_SOURCE_DIR="${PROJECT_SOURCE_DIR}")
 IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
     # Warn about documentation problems
     ADD_DEFINITIONS("-Wdocumentation")
-    ADD_DEFINITIONS("-Wno-error=documentation")
 
     IF(ALL_WARNINGS)
         # turn on every -W flags except a few explicitly mentioned
index e837d86..448d32d 100644 (file)
@@ -32,6 +32,8 @@
 
 using namespace vasum::cli;
 
+namespace {
+
 std::map<std::string, CommandLineInterface> commands = {
     {
         "set_active_zone", {
@@ -93,6 +95,8 @@ void printUsage(std::ostream& out, const std::string& name)
     }
 }
 
+} // namespace
+
 int main(const int argc, const char** argv)
 {
     if (argc < 2) {
index a5ff48e..305b848 100644 (file)
@@ -87,8 +87,8 @@ void unescape(std::string& value)
         if (c == '-') {
             value[outPos++] = '/';
         } else if (c == '\\' && value[inPos] == 'x') {
-            const char a = unhex(value[inPos+1]);
-            const char b = unhex(value[inPos+2]);
+            const int a = unhex(value[inPos+1]);
+            const int b = unhex(value[inPos+2]);
             value[outPos++] = (char) ((a << 4) | b);
             inPos += 3;
         } else {
index c16c9d2..41898c7 100644 (file)
@@ -113,7 +113,7 @@ VsmZoneState getZoneState(const char* state)
     } else if (strcmp(state, "ACTIVATING") == 0) {
         return ACTIVATING;
     }
-    assert(!"UNKNOWN STATE");
+    assert(0 && "UNKNOWN STATE");
     return (VsmZoneState)-1;
 }
 
index 3e1f66d..eb4cbba 100644 (file)
@@ -390,7 +390,7 @@ VsmStatus vsm_create_zone(VsmClient client, const char* id, const char* tname);
  * @param[in] force if 0 data will be kept, otherwise data will be lost
  * @return status of this function call
  */
-VsmStatus vsm_destroy_zone(VsmClient clent, const char* id, int force);
+VsmStatus vsm_destroy_zone(VsmClient client, const char* id, int force);
 
 /**
  * Shutdown zone
@@ -624,7 +624,7 @@ VsmStatus vsm_declare_file(VsmClient client,
  * @param[in] target mount point (path in zone)
  * @param[in] type filesystem type
  * @param[in] flags mount flags as in mount function
- * @patam[in] data additional data as in mount function
+ * @param[in] data additional data as in mount function
  * @return status of this function call
  */
 VsmStatus vsm_declare_mount(VsmClient client,
index 5233e29..5751812 100644 (file)
@@ -89,7 +89,7 @@ public:
      * the data will be parsed and passed to this callback.
      *
      * @param methodID API dependent id of the method
-     * @param methodCallback method handling implementation
+     * @param method method handling implementation
      */
     template<typename SentDataType, typename ReceivedDataType>
     void addMethodHandler(const MethodID methodID,
@@ -101,7 +101,7 @@ public:
      * the data will be parsed and passed to this callback.
      *
      * @param methodID API dependent id of the method
-     * @param SignalHandler signal handling implementation
+     * @param signal signal handling implementation
      * @tparam ReceivedDataType data type to serialize
      */
     template<typename ReceivedDataType>
@@ -134,7 +134,7 @@ public:
      *
      *
      * @param methodID API dependent id of the method
-     * @param sendCallback callback for data serialization
+     * @param data data to send
      * @param resultCallback callback for result serialization and handling
      */
     template<typename SentDataType, typename ReceivedDataType>
index 74a4923..2c591f7 100644 (file)
@@ -57,14 +57,14 @@ public:
     int getFD() const;
 
     /**
-     * Send an event of a given value
+     * Send an event
      *
-     * @param value size of the buffer
+     * @param message mesage to send
      */
-    void send(const MessageType& mess);
+    void send(const MessageType& message);
 
     /**
-     * Receives the signal.
+     * Receives the event.
      * Blocks if there is no event.
      *
      * @return event's value
index aa21675..be1060d 100644 (file)
@@ -340,8 +340,6 @@ bool Processor::handleInput(const Socket& socket)
             }
         }
     }
-
-    return false;
 }
 
 std::shared_ptr<Processor::EmptyData> Processor::onNewSignals(const FileDescriptor peerFD,
index 5038398..1f9aee3 100644 (file)
@@ -94,7 +94,7 @@ public:
      * the data will be parsed and passed to this callback.
      *
      * @param methodID API dependent id of the method
-     * @param methodCallback method handling implementation
+     * @param method method handling implementation
      */
     template<typename SentDataType, typename ReceivedDataType>
     void addMethodHandler(const MethodID methodID,
@@ -139,7 +139,7 @@ public:
      *
      *
      * @param methodID API dependent id of the method
-     * @param sendCallback callback for data serialization
+     * @param data data to send
      * @param resultCallback callback for result serialization and handling
      */
     template<typename SentDataType, typename ReceivedDataType>
index f4a778b..5986799 100644 (file)
@@ -54,7 +54,7 @@ namespace {
                 }
                 return false;
             }
-            size -= r;
+            size -= static_cast<size_t>(r);
             data = reinterpret_cast<const char*>(data) + r;
         }
         return true;
index 6744c30..981556b 100644 (file)
@@ -593,7 +593,7 @@ void ZonesManager::handleDeclareFileCall(const std::string& zone,
     try {
         mZones.at(zone)->declareFile(type, path, flags, mode);
         result->setVoid();
-    } catch (const std::out_of_range& ex) {
+    } catch (const std::out_of_range&) {
         LOGE("No zone with id=" << zone);
         result->setError(api::ERROR_INVALID_ID, "No such zone id");
     } catch (const config::ConfigException& ex) {
@@ -614,7 +614,7 @@ void ZonesManager::handleDeclareMountCall(const std::string& source,
     try {
         mZones.at(zone)->declareMount(source, target, type, flags, data);
         result->setVoid();
-    } catch (const std::out_of_range& ex) {
+    } catch (const std::out_of_range&) {
         LOGE("No zone with id=" << zone);
         result->setError(api::ERROR_INVALID_ID, "No such zone id");
     } catch (const config::ConfigException& ex) {
@@ -632,7 +632,7 @@ void ZonesManager::handleDeclareLinkCall(const std::string& source,
     try {
         mZones.at(zone)->declareLink(source, target);
         result->setVoid();
-    } catch (const std::out_of_range& ex) {
+    } catch (const std::out_of_range&) {
         LOGE("No zone with id=" << zone);
         result->setError(api::ERROR_INVALID_ID, "No such zone id");
     } catch (const config::ConfigException& ex) {
index e8060be..1e23e81 100644 (file)
@@ -145,9 +145,9 @@ BOOST_AUTO_TEST_CASE(GetZoneDbusesTest)
     status = vsm_get_zone_dbuses(client, &keys, &values);
     BOOST_REQUIRE_EQUAL(VSMCLIENT_SUCCESS, status);
 
-    BOOST_CHECK_EQUAL(getArrayStringLength(keys, EXPECTED_DBUSES_STARTED.size() + 1),
+    BOOST_CHECK_EQUAL(getArrayStringLength(keys, EXPECTED_DBUSES_STARTED.size() + 1u),
                       EXPECTED_DBUSES_STARTED.size());
-    BOOST_CHECK_EQUAL(getArrayStringLength(values, EXPECTED_DBUSES_STARTED.size() + 1),
+    BOOST_CHECK_EQUAL(getArrayStringLength(values, EXPECTED_DBUSES_STARTED.size() + 1u),
                       EXPECTED_DBUSES_STARTED.size());
 
     std::map<std::string, std::string> zones;
@@ -166,7 +166,7 @@ BOOST_AUTO_TEST_CASE(GetZoneIdsTest)
     VsmArrayString values;
     status = vsm_get_zone_ids(client, &values);
     BOOST_REQUIRE_EQUAL(VSMCLIENT_SUCCESS, status);
-    BOOST_CHECK_EQUAL(getArrayStringLength(values, EXPECTED_DBUSES_STARTED.size() + 1),
+    BOOST_CHECK_EQUAL(getArrayStringLength(values, EXPECTED_DBUSES_STARTED.size() + 1u),
                       EXPECTED_DBUSES_STARTED.size());
 
     std::set<std::string> zones;
@@ -291,7 +291,7 @@ BOOST_AUTO_TEST_CASE(NotificationTest)
         BOOST_REQUIRE_EQUAL(VSMCLIENT_SUCCESS, status);
     }
 
-    BOOST_CHECK(callbackData.signalReceivedLatch.waitForN(clients.size() - 1, EVENT_TIMEOUT));
+    BOOST_CHECK(callbackData.signalReceivedLatch.waitForN(clients.size() - 1u, EVENT_TIMEOUT));
     BOOST_CHECK(callbackData.signalReceivedLatch.empty());
 
     for (const auto& msg : callbackData.receivedSignalMsg) {
index 33d7c50..07c03dd 100644 (file)
@@ -620,7 +620,7 @@ BOOST_AUTO_TEST_CASE(NotifyActiveZoneTest)
         dbus.second->callMethodNotify();
     }
 
-    BOOST_CHECK(signalReceivedLatch.waitForN(dbuses.size() - 1, EVENT_TIMEOUT));
+    BOOST_CHECK(signalReceivedLatch.waitForN(dbuses.size() - 1u, EVENT_TIMEOUT));
     BOOST_CHECK(signalReceivedLatch.empty());
 
     //check if there are no signals that was received more than once