Skip to content
Snippets Groups Projects
Commit b5d01e0d authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony
Browse files

Fix static analysis and formatting

Refs #0
parent f27b0dda
No related merge requests found
......@@ -12,20 +12,18 @@ namespace {
class PyObjectNewReference {
public:
PyObjectNewReference(PyObject *object) : m_object(object) {}
explicit PyObjectNewReference(PyObject *object) : m_object(object) {}
~PyObjectNewReference() { Py_XDECREF(m_object); }
PyObjectNewReference(const PyObjectNewReference &) = delete;
PyObjectNewReference &operator=(const PyObjectNewReference &) = delete;
PyObjectNewReference(PyObjectNewReference &&o) {
*this = std::move(o);
}
PyObjectNewReference(PyObjectNewReference &&o) { *this = std::move(o); }
PyObjectNewReference &operator=(PyObjectNewReference &&other) {
this->m_object = other.m_object;
other.m_object = nullptr;
return *this;
this->m_object = other.m_object;
other.m_object = nullptr;
return *this;
}
inline PyObject *ptr() const { return m_object; }
......@@ -46,7 +44,7 @@ PyObjectNewReference attr(PyObject *source, const char *name) {
if (attr.ptr()) {
return attr;
} else {
PyErr_Print();
PyErr_Print();
throw std::runtime_error(std::string("Process: No attribute ") + name +
" found");
}
......@@ -65,7 +63,7 @@ PyObjectNewReference call(PyObject *source, const char *name) {
if (result)
return PyObjectNewReference(result);
else {
PyErr_Print();
PyErr_Print();
throw std::runtime_error(std::string("Process: Error calling function ") +
name);
}
......@@ -92,9 +90,7 @@ namespace Process {
* @return True if another instance is running
* @throws std::runtime_error if the PID list cannot be determined
*/
bool isAnotherInstanceRunning() {
return !otherInstancePIDs().empty();
}
bool isAnotherInstanceRunning() { return !otherInstancePIDs().empty(); }
/**
* @brief Return a list of process IDs for other instances of this process.
......
......@@ -64,7 +64,8 @@ boost::optional<bool> getConfigBool(const std::string &key) {
/// Returns a string to the current top level recovery folder
std::string getRecoveryFolder() {
static std::string appData = Mantid::Kernel::ConfigService::Instance().getAppDataDir();
static std::string appData =
Mantid::Kernel::ConfigService::Instance().getAppDataDir();
static std::string hostname = Poco::Environment::nodeName();
static std::string recoverFolder = appData + "/recovery/" + hostname + '/';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment