all retval replacements
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
#include <sstream>
|
||||
#include <type_traits>
|
||||
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
#include "fsfw/returnvalues/returnvalue.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
#include "linux/utility/utility.h"
|
||||
#include "returnvalues/classIds.h"
|
||||
@ -21,7 +21,7 @@ static constexpr char PREFERED_SDC_KEY[] = "PREFSD";
|
||||
static constexpr char ALLOC_FAILURE_COUNT[] = "ALLOCERR";
|
||||
|
||||
static constexpr uint8_t INTERFACE_ID = CLASS_ID::SCRATCH_BUFFER;
|
||||
static constexpr ReturnValue_t KEY_NOT_FOUND = HasReturnvaluesIF::makeReturnCode(INTERFACE_ID, 0);
|
||||
static constexpr ReturnValue_t KEY_NOT_FOUND = returnvalue::makeCode(INTERFACE_ID, 0);
|
||||
|
||||
ReturnValue_t clearValue(std::string key);
|
||||
|
||||
@ -83,11 +83,11 @@ ReturnValue_t readToFile(std::string name, std::ifstream& file, std::string& fil
|
||||
} else {
|
||||
utility::handleSystemError(result, "scratch::readToFile");
|
||||
std::remove(filename.c_str());
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
}
|
||||
file.open(filename);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
} // End of anonymous namespace
|
||||
@ -99,9 +99,9 @@ inline ReturnValue_t writeNumber(std::string key, T num) noexcept {
|
||||
int result = std::system(oss.str().c_str());
|
||||
if (result != 0) {
|
||||
utility::handleSystemError(result, "scratch::writeNumber");
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
template <typename T, class = typename std::enable_if<std::is_integral<T>::value>::type>
|
||||
@ -110,7 +110,7 @@ inline ReturnValue_t readNumber(std::string key, T& num) noexcept {
|
||||
ifstream file;
|
||||
std::string filename;
|
||||
ReturnValue_t result = readToFile(key, file, filename);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
std::remove(filename.c_str());
|
||||
return result;
|
||||
}
|
||||
@ -118,7 +118,7 @@ inline ReturnValue_t readNumber(std::string key, T& num) noexcept {
|
||||
string line;
|
||||
if (not std::getline(file, line)) {
|
||||
std::remove(filename.c_str());
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
|
||||
size_t pos = line.find("=");
|
||||
@ -138,7 +138,7 @@ inline ReturnValue_t readNumber(std::string key, T& num) noexcept {
|
||||
}
|
||||
|
||||
std::remove(filename.c_str());
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
} // namespace scratch
|
||||
|
Reference in New Issue
Block a user