summaryrefslogtreecommitdiff
path: root/Source/Core/Common/FileUtil.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2014-08-30 16:14:56 -0400
committerLioncash <mathew1800@gmail.com>2014-08-30 18:06:35 -0400
commitba4934b75eb13cc04a54efd54a9d6f286d255083 (patch)
treed6cf1cc67a447e8b68aed719f3161119f8a45258 /Source/Core/Common/FileUtil.cpp
parent77aef014a0352d819e8ea63bafb6262b9af485cb (diff)
Common: Clean up brace placements
Diffstat (limited to 'Source/Core/Common/FileUtil.cpp')
-rw-r--r--Source/Core/Common/FileUtil.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp
index e84bc6c50b..bac3814185 100644
--- a/Source/Core/Common/FileUtil.cpp
+++ b/Source/Core/Common/FileUtil.cpp
@@ -95,7 +95,8 @@ bool IsDirectory(const std::string &filename)
int result = stat64(copy.c_str(), &file_info);
#endif
- if (result < 0) {
+ if (result < 0)
+ {
WARN_LOG(COMMON, "IsDirectory: stat failed on %s: %s",
filename.c_str(), GetLastErrorMsg());
return false;
@@ -133,7 +134,8 @@ bool Delete(const std::string &filename)
return false;
}
#else
- if (unlink(filename.c_str()) == -1) {
+ if (unlink(filename.c_str()) == -1)
+ {
WARN_LOG(COMMON, "Delete: unlink failed on %s: %s",
filename.c_str(), GetLastErrorMsg());
return false;
@@ -413,7 +415,8 @@ u64 GetSize(const std::string &filename)
u64 GetSize(const int fd)
{
struct stat64 buf;
- if (fstat64(fd, &buf) != 0) {
+ if (fstat64(fd, &buf) != 0)
+ {
ERROR_LOG(COMMON, "GetSize: stat failed %i: %s",
fd, GetLastErrorMsg());
return 0;
@@ -426,17 +429,21 @@ u64 GetSize(FILE *f)
{
// can't use off_t here because it can be 32-bit
u64 pos = ftello(f);
- if (fseeko(f, 0, SEEK_END) != 0) {
+ if (fseeko(f, 0, SEEK_END) != 0)
+ {
ERROR_LOG(COMMON, "GetSize: seek failed %p: %s",
f, GetLastErrorMsg());
return 0;
}
+
u64 size = ftello(f);
- if ((size != pos) && (fseeko(f, pos, SEEK_SET) != 0)) {
+ if ((size != pos) && (fseeko(f, pos, SEEK_SET) != 0))
+ {
ERROR_LOG(COMMON, "GetSize: seek failed %p: %s",
f, GetLastErrorMsg());
return 0;
}
+
return size;
}
@@ -658,8 +665,8 @@ std::string GetCurrentDir()
{
char *dir;
// Get the current working directory (getcwd uses malloc)
- if (!(dir = __getcwd(nullptr, 0))) {
-
+ if (!(dir = __getcwd(nullptr, 0)))
+ {
ERROR_LOG(COMMON, "GetCurrentDirectory failed: %s",
GetLastErrorMsg());
return nullptr;