From 380ae136f98671a81feb6095a66ac5401b1ff29e Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Sat, 11 Feb 2017 00:00:44 +0300
Subject: Rename define DEBUG_PHYSFS into DEBUG_VIRTFS

---
 src/debug.h                   |  4 +---
 src/localconsts.h             |  2 +-
 src/maingui.cpp               |  4 ++--
 src/utils/debugmemoryobject.h |  4 ++--
 src/utils/virtfsrwops.cpp     | 26 +++++++++++++-------------
 src/utils/virtfsrwops.h       | 10 ++++------
 6 files changed, 23 insertions(+), 27 deletions(-)

diff --git a/src/debug.h b/src/debug.h
index edfe0408d..47ccfc2bb 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -64,8 +64,6 @@
 #endif  // ENABLE_SDL_DEBUG
 
 
-#ifdef DEBUG_PHYSFS
+#ifdef DEBUG_VIRTFS
 #define RWopsOpenRead(name) RWopsOpenRead(name, __FILE__, __LINE__)
-#else  // DEBUG_PHYSFS
-
 #endif  // DEBUG_PHYSFS
diff --git a/src/localconsts.h b/src/localconsts.h
index 072b063d0..11c120ee2 100644
--- a/src/localconsts.h
+++ b/src/localconsts.h
@@ -338,7 +338,7 @@ PRAGMA45(GCC diagnostic pop)
 // #define DEBUG_SDL_SURFACES 1
 
 // debug RWops usage
-// #define DEBUG_PHYSFS 1
+// #define DEBUG_VIRTFS 1
 
 // use file access fuzzer
 // #define USE_FUZZER 1
diff --git a/src/maingui.cpp b/src/maingui.cpp
index f34cfeb31..a8a06cf9a 100644
--- a/src/maingui.cpp
+++ b/src/maingui.cpp
@@ -133,9 +133,9 @@ int mainGui(int argc, char *argv[])
 #ifdef DUMP_LEAKED_RESOURCES
     VirtFs::reportRWops();
 #endif  // DUMP_LEAKED_RESOURCES
-#ifdef DEBUG_PHYSFS
+#ifdef DEBUG_VIRTFS
     VirtFs::reportLeaks();
-#endif  // DEBUG_PHYSFS
+#endif  // DEBUG_VIRTFS
 
     return ret;
 }
diff --git a/src/utils/debugmemoryobject.h b/src/utils/debugmemoryobject.h
index 3f1f0501e..e415cb59e 100644
--- a/src/utils/debugmemoryobject.h
+++ b/src/utils/debugmemoryobject.h
@@ -21,7 +21,7 @@
 #ifndef UTILS_DEBUGMEMORYOBJECT_H
 #define UTILS_DEBUGMEMORYOBJECT_H
 
-#ifdef DEBUG_PHYSFS
+#ifdef DEBUG_VIRTFS
 
 #include "utils/stringutils.h"
 
@@ -46,5 +46,5 @@ namespace VirtFs
     };
 }  // VirtFs
 
-#endif  // DEBUG_PHYSFS
+#endif  // DEBUG_VIRTFS
 #endif  // UTILS_DEBUGMEMORYOBJECT_H
diff --git a/src/utils/virtfsrwops.cpp b/src/utils/virtfsrwops.cpp
index 81c8b4726..b6f7feec8 100644
--- a/src/utils/virtfsrwops.cpp
+++ b/src/utils/virtfsrwops.cpp
@@ -45,7 +45,7 @@
 static int openedRWops = 0;
 #endif  // DUMP_LEAKED_RESOURCES
 
-#ifdef DEBUG_PHYSFS
+#ifdef DEBUG_VIRTFS
 namespace
 {
     std::map<void*, VirtFs::DebugMemoryObject*> mRWops;
@@ -105,7 +105,7 @@ void VirtFs::reportLeaks()
         mRWops.clear();
     }
 }
-#endif  // DEBUG_PHYSFS
+#endif  // DEBUG_VIRTFS
 
 static PHYSFSINT physfsrwops_seek(SDL_RWops *const rw,
                                   const PHYSFSINT offset,
@@ -251,9 +251,9 @@ static int physfsrwops_close(SDL_RWops *const rw)
         logger->assertLog("physfsrwops_seek: closing already closed RWops");
     openedRWops --;
 #endif  // DUMP_LEAKED_RESOURCES
-#ifdef DEBUG_PHYSFS
+#ifdef DEBUG_VIRTFS
     deleteDebugRWops(rw);
-#endif  // DEBUG_PHYSFS
+#endif  // DEBUG_VIRTFS
 
     return 0;
 } /* physfsrwops_close */
@@ -326,14 +326,14 @@ static bool checkFilePath(const char *const fname)
 }
 #endif  // __APPLE__
 
-#ifdef DEBUG_PHYSFS
+#ifdef DEBUG_VIRTFS
 #undef RWopsOpenRead
 SDL_RWops *VirtFs::RWopsOpenRead(const char *const fname,
                                  const char *restrict const file,
                                  const unsigned line)
-#else  // DEBUG_PHYSFS
+#else  // DEBUG_VIRTFS
 SDL_RWops *VirtFs::RWopsOpenRead(const char *const fname)
-#endif  // DEBUG_PHYSFS
+#endif  // DEBUG_VIRTFS
 {
     BLOCK_START("RWopsopenRead")
 #ifdef __APPLE__
@@ -346,29 +346,29 @@ SDL_RWops *VirtFs::RWopsOpenRead(const char *const fname)
 #endif  // USE_FUZZER
 #ifdef USE_PROFILER
 
-#ifdef DEBUG_PHYSFS
+#ifdef DEBUG_VIRTFS
     SDL_RWops *const ret = addDebugRWops(
         create_rwops(VirtFs::openRead(fname)),
         fname,
         file,
         line);
-#else  // DEBUG_PHYSFS
+#else  // DEBUG_VIRTFS
     SDL_RWops *const ret = create_rwops(VirtFs::openRead(fname));
-#endif  // DEBUG_PHYSFS
+#endif  // DEBUG_VIRTFS
 
     BLOCK_END("RWopsopenRead")
     return ret;
 #else  // USE_PROFILER
 
-#ifdef DEBUG_PHYSFS
+#ifdef DEBUG_VIRTFS
     return addDebugRWops(
         create_rwops(VirtFs::openRead(fname)),
         fname,
         file,
         line);
-#else  // DEBUG_PHYSFS
+#else  // DEBUG_VIRTFS
     return create_rwops(VirtFs::openRead(fname));
-#endif  // DEBUG_PHYSFS
+#endif  // DEBUG_VIRTFS
 #endif  // USE_PROFILER
 } /* RWopsopenRead */
 
diff --git a/src/utils/virtfsrwops.h b/src/utils/virtfsrwops.h
index e9d68f044..a1b073454 100644
--- a/src/utils/virtfsrwops.h
+++ b/src/utils/virtfsrwops.h
@@ -33,13 +33,14 @@
 
 namespace VirtFs
 {
-#ifdef DEBUG_PHYSFS
+#ifdef DEBUG_VIRTFS
     SDL_RWops *RWopsOpenRead(const char *const fname,
                              const char *restrict const file,
                              const unsigned line);
-#else  // DEBUG_PHYSFS
+    void reportLeaks();
+#else  // DEBUG_VIRTFS
     SDL_RWops *RWopsOpenRead(const char *const fname);
-#endif  // DEBUG_PHYSFS
+#endif  // DEBUG_VIRTFS
 
     SDL_RWops *RWopsOpenWrite(const char *const fname) A_WARN_UNUSED;
     SDL_RWops *RWopsOpenAppend(const char *const fname) A_WARN_UNUSED;
@@ -47,9 +48,6 @@ namespace VirtFs
 #ifdef DUMP_LEAKED_RESOURCES
     void reportRWops();
 #endif  // DUMP_LEAKED_RESOURCES
-#ifdef DEBUG_PHYSFS
-    void reportLeaks();
-#endif  // DEBUG_PHYSFS
 }  // namespace VirtFs
 
 #endif  // UTILS_PHYSFSRWOPS_H
-- 
cgit v1.2.3-70-g09d2