Resolve compilation errors and warnings with MSVC

This commit is contained in:
Paul Hollinsky
2018-11-13 16:18:57 -05:00
parent f05f96822e
commit 0cf1e7fe7f
9 changed files with 39 additions and 40 deletions
+5 -2
View File
@@ -26,6 +26,9 @@ class Device;
class APIError {
public:
typedef std::chrono::system_clock ErrorClock;
typedef std::chrono::time_point<ErrorClock> ErrorTimePoint;
enum ErrorType : uint32_t {
Any = 0, // Used for filtering, should not appear in data
@@ -73,7 +76,7 @@ public:
Severity getSeverity() const noexcept { return Severity(errorStruct.severity); }
std::string getDescription() const noexcept { return std::string(errorStruct.description); }
const Device* getDevice() const noexcept { return device; } // Will return nullptr if this is an API-wide error
std::chrono::time_point<std::chrono::high_resolution_clock> getTimestamp() const noexcept { return timepoint; }
ErrorTimePoint getTimestamp() const noexcept { return timepoint; }
bool isForDevice(const Device* forDevice) const noexcept { return forDevice == device; }
bool isForDevice(std::string serial) const noexcept;
@@ -91,7 +94,7 @@ public:
private:
neoerror_t errorStruct;
std::string serial;
std::chrono::time_point<std::chrono::high_resolution_clock> timepoint;
ErrorTimePoint timepoint;
const Device* device;
void init(ErrorType error);
+3 -3
View File
@@ -26,9 +26,9 @@ public:
get(ret, filter, max);
return ret;
}
void get(std::vector<APIError>& errors, ErrorFilter filter, size_t max = 0) { get(errors, max, filter); }
void get(std::vector<APIError>& errors, size_t max = 0, ErrorFilter filter = ErrorFilter());
bool getLastError(APIError& error, ErrorFilter filter = ErrorFilter());
void get(std::vector<APIError>& outErrors, ErrorFilter filter, size_t max = 0) { get(outErrors, max, filter); }
void get(std::vector<APIError>& outErrors, size_t max = 0, ErrorFilter filter = ErrorFilter());
bool getLastError(APIError& outErrors, ErrorFilter filter = ErrorFilter());
void add(APIError error) {
std::lock_guard<std::mutex> lk(mutex);