General tidying, addressing issues found by static analysis tool.

This commit is contained in:
Nav
2021-06-22 23:52:31 +01:00
parent 69cee4d579
commit d365f6348b
151 changed files with 386 additions and 420 deletions

View File

@@ -20,8 +20,8 @@ namespace Bloom
class BiMap
{
private:
std::unordered_map<TypeA, TypeB> map;
std::unordered_map<TypeB, typename std::unordered_map<TypeA, TypeB>::iterator> flippedMap;
std::unordered_map<TypeA, TypeB> map = {};
std::unordered_map<TypeB, typename std::unordered_map<TypeA, TypeB>::iterator> flippedMap = {};
public:
BiMap(std::initializer_list<std::pair<TypeA, TypeB>> elements) {
@@ -68,4 +68,4 @@ namespace Bloom
return this->map;
}
};
}
}

View File

@@ -56,7 +56,7 @@ namespace Bloom
}
}
int getFileDescriptor() {
int getFileDescriptor() const {
return this->fileDescriptor;
}

View File

@@ -31,13 +31,12 @@ namespace Bloom
* files such as QT stylesheets and UI templates.
* @return
*/
static inline const std::string compiledResourcesPath() {
static inline std::string compiledResourcesPath() {
#ifdef BLOOM_COMPILED_RESOURCES_PATH_OVERRIDE
return std::string(BLOOM_COMPILED_RESOURCES_PATH_OVERRIDE);
#else
return std::string(":/compiled");
#endif
}
};
}

View File

@@ -20,11 +20,11 @@ namespace Bloom
private:
std::mutex mutex;
Type value;
public:
SyncSafe() = default;
explicit SyncSafe(Type value): value(value) {
};
explicit SyncSafe(Type value): value(value) {};
void setValue(Type value) {
auto lock = std::unique_lock(this->mutex);
@@ -52,4 +52,4 @@ namespace Bloom
return std::unique_lock(this->mutex);
};
};
}
}