From: Piotr Bartosiewicz
Date: Tue, 9 Dec 2014 16:08:00 +0000 (+0100)
Subject: Fix doxy comments and some other warnings
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d8fedce7b248e5d57038882889354c617a08ab85;p=platform%2Fcore%2Fsecurity%2Fvasum.git
Fix doxy comments and some other warnings
[Bug/Feature] N/A
[Cause] N/A
[Solution] N/A
[Verification] Build
Change-Id: I5cff5b198d533ec256d551d9e8280a5c117e06d4
---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 34573cc..cd999d7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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
diff --git a/cli/main.cpp b/cli/main.cpp
index e837d86..448d32d 100644
--- a/cli/main.cpp
+++ b/cli/main.cpp
@@ -32,6 +32,8 @@
using namespace vasum::cli;
+namespace {
+
std::map 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) {
diff --git a/client/utils.cpp b/client/utils.cpp
index a5ff48e..305b848 100644
--- a/client/utils.cpp
+++ b/client/utils.cpp
@@ -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 {
diff --git a/client/vasum-client-impl.cpp b/client/vasum-client-impl.cpp
index c16c9d2..41898c7 100644
--- a/client/vasum-client-impl.cpp
+++ b/client/vasum-client-impl.cpp
@@ -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;
}
diff --git a/client/vasum-client.h b/client/vasum-client.h
index 3e1f66d..eb4cbba 100644
--- a/client/vasum-client.h
+++ b/client/vasum-client.h
@@ -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,
diff --git a/common/ipc/client.hpp b/common/ipc/client.hpp
index 5233e29..5751812 100644
--- a/common/ipc/client.hpp
+++ b/common/ipc/client.hpp
@@ -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
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
@@ -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
diff --git a/common/ipc/internals/event-queue.hpp b/common/ipc/internals/event-queue.hpp
index 74a4923..2c591f7 100644
--- a/common/ipc/internals/event-queue.hpp
+++ b/common/ipc/internals/event-queue.hpp
@@ -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
diff --git a/common/ipc/internals/processor.cpp b/common/ipc/internals/processor.cpp
index aa21675..be1060d 100644
--- a/common/ipc/internals/processor.cpp
+++ b/common/ipc/internals/processor.cpp
@@ -340,8 +340,6 @@ bool Processor::handleInput(const Socket& socket)
}
}
}
-
- return false;
}
std::shared_ptr Processor::onNewSignals(const FileDescriptor peerFD,
diff --git a/common/ipc/service.hpp b/common/ipc/service.hpp
index 5038398..1f9aee3 100644
--- a/common/ipc/service.hpp
+++ b/common/ipc/service.hpp
@@ -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
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
diff --git a/common/utils/initctl.cpp b/common/utils/initctl.cpp
index f4a778b..5986799 100644
--- a/common/utils/initctl.cpp
+++ b/common/utils/initctl.cpp
@@ -54,7 +54,7 @@ namespace {
}
return false;
}
- size -= r;
+ size -= static_cast(r);
data = reinterpret_cast(data) + r;
}
return true;
diff --git a/server/zones-manager.cpp b/server/zones-manager.cpp
index 6744c30..981556b 100644
--- a/server/zones-manager.cpp
+++ b/server/zones-manager.cpp
@@ -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) {
diff --git a/tests/unit_tests/client/ut-client.cpp b/tests/unit_tests/client/ut-client.cpp
index e8060be..1e23e81 100644
--- a/tests/unit_tests/client/ut-client.cpp
+++ b/tests/unit_tests/client/ut-client.cpp
@@ -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 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 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) {
diff --git a/tests/unit_tests/server/ut-zones-manager.cpp b/tests/unit_tests/server/ut-zones-manager.cpp
index 33d7c50..07c03dd 100644
--- a/tests/unit_tests/server/ut-zones-manager.cpp
+++ b/tests/unit_tests/server/ut-zones-manager.cpp
@@ -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