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
using namespace vasum::cli;
+namespace {
+
std::map<std::string, CommandLineInterface> commands = {
{
"set_active_zone", {
}
}
+} // namespace
+
int main(const int argc, const char** argv)
{
if (argc < 2) {
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 {
} else if (strcmp(state, "ACTIVATING") == 0) {
return ACTIVATING;
}
- assert(!"UNKNOWN STATE");
+ assert(0 && "UNKNOWN STATE");
return (VsmZoneState)-1;
}
* @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
* @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,
* 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,
* 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>
*
*
* @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>
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
}
}
}
-
- return false;
}
std::shared_ptr<Processor::EmptyData> Processor::onNewSignals(const FileDescriptor peerFD,
* 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,
*
*
* @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>
}
return false;
}
- size -= r;
+ size -= static_cast<size_t>(r);
data = reinterpret_cast<const char*>(data) + r;
}
return true;
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) {
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) {
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) {
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;
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;
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) {
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