diff options
| author | 2018-07-02 10:20:50 -0600 | |
|---|---|---|
| committer | 2018-07-02 21:45:47 -0400 | |
| commit | 0d46f0df122dbc9b9a9d9f97e2da6b1953ef939b (patch) | |
| tree | aba03bf491181cf741420dd1445bd5399e48a3af /src/common | |
| parent | Rename logging macro back to LOG_* (diff) | |
| download | yuzu-0d46f0df122dbc9b9a9d9f97e2da6b1953ef939b.tar.gz yuzu-0d46f0df122dbc9b9a9d9f97e2da6b1953ef939b.tar.xz yuzu-0d46f0df122dbc9b9a9d9f97e2da6b1953ef939b.zip | |
Update clang format
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/assert.h | 5 | ||||
| -rw-r--r-- | src/common/file_util.cpp | 18 | ||||
| -rw-r--r-- | src/common/logging/filter.cpp | 2 |
3 files changed, 11 insertions, 14 deletions
diff --git a/src/common/assert.h b/src/common/assert.h index fbe87273b..655446f34 100644 --- a/src/common/assert.h +++ b/src/common/assert.h | |||
| @@ -30,15 +30,14 @@ __declspec(noinline, noreturn) | |||
| 30 | #define ASSERT(_a_) \ | 30 | #define ASSERT(_a_) \ |
| 31 | do \ | 31 | do \ |
| 32 | if (!(_a_)) { \ | 32 | if (!(_a_)) { \ |
| 33 | assert_noinline_call([] { LOG_CRITICAL(Debug, "Assertion Failed!"); }); \ | 33 | assert_noinline_call([] { LOG_CRITICAL(Debug, "Assertion Failed!"); }); \ |
| 34 | } \ | 34 | } \ |
| 35 | while (0) | 35 | while (0) |
| 36 | 36 | ||
| 37 | #define ASSERT_MSG(_a_, ...) \ | 37 | #define ASSERT_MSG(_a_, ...) \ |
| 38 | do \ | 38 | do \ |
| 39 | if (!(_a_)) { \ | 39 | if (!(_a_)) { \ |
| 40 | assert_noinline_call( \ | 40 | assert_noinline_call([&] { LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \ |
| 41 | [&] { LOG_CRITICAL(Debug, "Assertion Failed!\n" __VA_ARGS__); }); \ | ||
| 42 | } \ | 41 | } \ |
| 43 | while (0) | 42 | while (0) |
| 44 | 43 | ||
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 40b633092..2152e3fea 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp | |||
| @@ -257,7 +257,7 @@ bool Rename(const std::string& srcFilename, const std::string& destFilename) { | |||
| 257 | return true; | 257 | return true; |
| 258 | #endif | 258 | #endif |
| 259 | LOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename, | 259 | LOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename, |
| 260 | GetLastErrorMsg()); | 260 | GetLastErrorMsg()); |
| 261 | return false; | 261 | return false; |
| 262 | } | 262 | } |
| 263 | 263 | ||
| @@ -270,7 +270,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { | |||
| 270 | return true; | 270 | return true; |
| 271 | 271 | ||
| 272 | LOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename, | 272 | LOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename, |
| 273 | GetLastErrorMsg()); | 273 | GetLastErrorMsg()); |
| 274 | return false; | 274 | return false; |
| 275 | #else | 275 | #else |
| 276 | 276 | ||
| @@ -283,7 +283,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { | |||
| 283 | FILE* input = fopen(srcFilename.c_str(), "rb"); | 283 | FILE* input = fopen(srcFilename.c_str(), "rb"); |
| 284 | if (!input) { | 284 | if (!input) { |
| 285 | LOG_ERROR(Common_Filesystem, "opening input failed {} --> {}: {}", srcFilename, | 285 | LOG_ERROR(Common_Filesystem, "opening input failed {} --> {}: {}", srcFilename, |
| 286 | destFilename, GetLastErrorMsg()); | 286 | destFilename, GetLastErrorMsg()); |
| 287 | return false; | 287 | return false; |
| 288 | } | 288 | } |
| 289 | 289 | ||
| @@ -292,7 +292,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { | |||
| 292 | if (!output) { | 292 | if (!output) { |
| 293 | fclose(input); | 293 | fclose(input); |
| 294 | LOG_ERROR(Common_Filesystem, "opening output failed {} --> {}: {}", srcFilename, | 294 | LOG_ERROR(Common_Filesystem, "opening output failed {} --> {}: {}", srcFilename, |
| 295 | destFilename, GetLastErrorMsg()); | 295 | destFilename, GetLastErrorMsg()); |
| 296 | return false; | 296 | return false; |
| 297 | } | 297 | } |
| 298 | 298 | ||
| @@ -303,7 +303,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { | |||
| 303 | if (rnum != BSIZE) { | 303 | if (rnum != BSIZE) { |
| 304 | if (ferror(input) != 0) { | 304 | if (ferror(input) != 0) { |
| 305 | LOG_ERROR(Common_Filesystem, "failed reading from source, {} --> {}: {}", | 305 | LOG_ERROR(Common_Filesystem, "failed reading from source, {} --> {}: {}", |
| 306 | srcFilename, destFilename, GetLastErrorMsg()); | 306 | srcFilename, destFilename, GetLastErrorMsg()); |
| 307 | goto bail; | 307 | goto bail; |
| 308 | } | 308 | } |
| 309 | } | 309 | } |
| @@ -312,7 +312,7 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { | |||
| 312 | size_t wnum = fwrite(buffer, sizeof(char), rnum, output); | 312 | size_t wnum = fwrite(buffer, sizeof(char), rnum, output); |
| 313 | if (wnum != rnum) { | 313 | if (wnum != rnum) { |
| 314 | LOG_ERROR(Common_Filesystem, "failed writing to output, {} --> {}: {}", srcFilename, | 314 | LOG_ERROR(Common_Filesystem, "failed writing to output, {} --> {}: {}", srcFilename, |
| 315 | destFilename, GetLastErrorMsg()); | 315 | destFilename, GetLastErrorMsg()); |
| 316 | goto bail; | 316 | goto bail; |
| 317 | } | 317 | } |
| 318 | } | 318 | } |
| @@ -371,14 +371,12 @@ u64 GetSize(FILE* f) { | |||
| 371 | // can't use off_t here because it can be 32-bit | 371 | // can't use off_t here because it can be 32-bit |
| 372 | u64 pos = ftello(f); | 372 | u64 pos = ftello(f); |
| 373 | if (fseeko(f, 0, SEEK_END) != 0) { | 373 | if (fseeko(f, 0, SEEK_END) != 0) { |
| 374 | LOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", fmt::ptr(f), | 374 | LOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", fmt::ptr(f), GetLastErrorMsg()); |
| 375 | GetLastErrorMsg()); | ||
| 376 | return 0; | 375 | return 0; |
| 377 | } | 376 | } |
| 378 | u64 size = ftello(f); | 377 | u64 size = ftello(f); |
| 379 | if ((size != pos) && (fseeko(f, pos, SEEK_SET) != 0)) { | 378 | if ((size != pos) && (fseeko(f, pos, SEEK_SET) != 0)) { |
| 380 | LOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", fmt::ptr(f), | 379 | LOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", fmt::ptr(f), GetLastErrorMsg()); |
| 381 | GetLastErrorMsg()); | ||
| 382 | return 0; | 380 | return 0; |
| 383 | } | 381 | } |
| 384 | return size; | 382 | return size; |
diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index fdfb66696..733247b51 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp | |||
| @@ -66,7 +66,7 @@ bool Filter::ParseFilterRule(const std::string::const_iterator begin, | |||
| 66 | auto level_separator = std::find(begin, end, ':'); | 66 | auto level_separator = std::find(begin, end, ':'); |
| 67 | if (level_separator == end) { | 67 | if (level_separator == end) { |
| 68 | LOG_ERROR(Log, "Invalid log filter. Must specify a log level after `:`: %s", | 68 | LOG_ERROR(Log, "Invalid log filter. Must specify a log level after `:`: %s", |
| 69 | std::string(begin, end).c_str()); | 69 | std::string(begin, end).c_str()); |
| 70 | return false; | 70 | return false; |
| 71 | } | 71 | } |
| 72 | 72 | ||