[aseprite] 134/308: Replace DLOG() with TRACE()

Tobias Hansen thansen at moszumanska.debian.org
Tue Mar 8 02:45:01 UTC 2016


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 3bcda8c1b129d8a45a408bfff609fa285d01a813
Author: David Capello <davidcapello at gmail.com>
Date:   Mon Dec 21 12:30:21 2015 -0300

    Replace DLOG() with TRACE()
---
 src/app/cmd.cpp              |  6 +++---
 src/app/file/gif_format.cpp  | 50 ++++++++++++++++++++++----------------------
 src/config.h                 |  5 -----
 src/updater/check_update.cpp |  4 ++--
 4 files changed, 30 insertions(+), 35 deletions(-)

diff --git a/src/app/cmd.cpp b/src/app/cmd.cpp
index 5d96313..f447277 100644
--- a/src/app/cmd.cpp
+++ b/src/app/cmd.cpp
@@ -28,7 +28,7 @@ Cmd::~Cmd()
 
 void Cmd::execute(Context* ctx)
 {
-  DLOG("Cmd: Executing cmd '%s'\n", typeid(*this).name());
+  TRACE("Cmd: Executing cmd '%s'\n", typeid(*this).name());
   ASSERT(m_state == State::NotExecuted);
 
   m_ctx = ctx;
@@ -43,7 +43,7 @@ void Cmd::execute(Context* ctx)
 
 void Cmd::undo()
 {
-  DLOG("Cmd: Undo cmd '%s'\n", typeid(*this).name());
+  TRACE("Cmd: Undo cmd '%s'\n", typeid(*this).name());
   ASSERT(m_state == State::Executed || m_state == State::Redone);
 
   onUndo();
@@ -56,7 +56,7 @@ void Cmd::undo()
 
 void Cmd::redo()
 {
-  DLOG("Cmd: Redo cmd '%s'\n", typeid(*this).name());
+  TRACE("Cmd: Redo cmd '%s'\n", typeid(*this).name());
   ASSERT(m_state == State::Undone);
 
   onRedo();
diff --git a/src/app/file/gif_format.cpp b/src/app/file/gif_format.cpp
index c702102..b774d11 100644
--- a/src/app/file/gif_format.cpp
+++ b/src/app/file/gif_format.cpp
@@ -189,10 +189,10 @@ public:
     , m_remap(256)
     , m_hasLocalColormaps(false)
     , m_firstLocalColormap(nullptr) {
-    DLOG("[GifDecoder] GIF background index=%d\n", (int)m_gifFile->SBackGroundColor);
-    DLOG("[GifDecoder] GIF global colormap=%d, ncolors=%d\n",
-         (m_gifFile->SColorMap ? 1: 0),
-         (m_gifFile->SColorMap ? m_gifFile->SColorMap->ColorCount: 0));
+    TRACE("[GifDecoder] GIF background index=%d\n", (int)m_gifFile->SBackGroundColor);
+    TRACE("[GifDecoder] GIF global colormap=%d, ncolors=%d\n",
+          (m_gifFile->SColorMap ? 1: 0),
+          (m_gifFile->SColorMap ? m_gifFile->SColorMap->ColorCount: 0));
   }
 
   ~GifDecoder() {
@@ -310,7 +310,7 @@ private:
     UniquePtr<Image> frameImage(
       readFrameIndexedImage(frameBounds));
 
-    DLOG("[GifDecoder] Frame[%d] transparent index = %d\n", (int)m_frameNum, m_localTransparentIndex);
+    TRACE("[GifDecoder] Frame[%d] transparent index = %d\n", (int)m_frameNum, m_localTransparentIndex);
 
     if (m_frameNum == 0) {
       if (m_localTransparentIndex >= 0)
@@ -325,8 +325,8 @@ private:
     // Convert the sprite to RGB if we have more than 256 colors
     if ((m_sprite->pixelFormat() == IMAGE_INDEXED) &&
         (m_sprite->palette(m_frameNum)->size() > 256)) {
-      DLOG("[GifDecoder] Converting to RGB because we have %d colors\n",
-           m_sprite->palette(m_frameNum)->size());
+      TRACE("[GifDecoder] Converting to RGB because we have %d colors\n",
+            m_sprite->palette(m_frameNum)->size());
 
       convertIndexedSpriteToRgb();
     }
@@ -444,7 +444,7 @@ private:
     int ncolors = colormap->ColorCount;
     bool isLocalColormap = (m_gifFile->Image.ColorMap ? true: false);
 
-    DLOG("[GifDecoder] Local colormap=%d, ncolors=%d\n", isLocalColormap, ncolors);
+    TRACE("[GifDecoder] Local colormap=%d, ncolors=%d\n", isLocalColormap, ncolors);
 
     // We'll calculate the list of used colormap indexes in this
     // frameImage.
@@ -527,17 +527,17 @@ private:
     // Number of colors in the image that aren't in the palette.
     int missing = (usedNColors - found);
 
-    DLOG("[GifDecoder] Bg index=%d,\n"
-         "  Local transparent index=%d,\n"
-         "  Need extra index to show bg color=%d,\n  "
-         "  Found colors in palette=%d,\n"
-         "  Used colors in local pixels=%d,\n"
-         "  Base for new colors in palette=%d,\n"
-         "  Colors in the image missing in the palette=%d,\n"
-         "  New palette size=%d\n",
-         m_bgIndex, m_localTransparentIndex, needsExtraBgColor,
-         found, usedNColors, base, missing,
-         base + missing + (needsExtraBgColor ? 1: 0));
+    TRACE("[GifDecoder] Bg index=%d,\n"
+          "  Local transparent index=%d,\n"
+          "  Need extra index to show bg color=%d,\n  "
+          "  Found colors in palette=%d,\n"
+          "  Used colors in local pixels=%d,\n"
+          "  Base for new colors in palette=%d,\n"
+          "  Colors in the image missing in the palette=%d,\n"
+          "  New palette size=%d\n",
+          m_bgIndex, m_localTransparentIndex, needsExtraBgColor,
+          found, usedNColors, base, missing,
+          base + missing + (needsExtraBgColor ? 1: 0));
 
     Palette oldPalette(*palette);
     palette->resize(base + missing + (needsExtraBgColor ? 1: 0));
@@ -645,8 +645,8 @@ private:
         m_localTransparentIndex = (extension[1] & 1) ? extension[4]: -1;
         m_frameDelay            = (extension[3] << 8) | extension[2];
 
-        DLOG("[GifDecoder] Disposal method: %d\n  Transparent index: %d\n  Frame delay: %d\n",
-             m_disposalMethod, m_localTransparentIndex, m_frameDelay);
+        TRACE("[GifDecoder] Disposal method: %d\n  Transparent index: %d\n  Frame delay: %d\n",
+              m_disposalMethod, m_localTransparentIndex, m_frameDelay);
       }
     }
 
@@ -1046,10 +1046,10 @@ private:
         }
       }
 
-      DLOG("[GifEncoder] frameBounds=%d %d %d %d  prev=%d %d %d %d  next=%d %d %d %d\n",
-           frameBounds.x, frameBounds.y, frameBounds.w, frameBounds.h,
-           prev.x, prev.y, prev.w, prev.h,
-           next.x, next.y, next.w, next.h);
+      TRACE("[GifEncoder] frameBounds=%d %d %d %d  prev=%d %d %d %d  next=%d %d %d %d\n",
+            frameBounds.x, frameBounds.y, frameBounds.w, frameBounds.h,
+            prev.x, prev.y, prev.w, prev.h,
+            next.x, next.y, next.w, next.h);
     }
   }
 
diff --git a/src/config.h b/src/config.h
index 887f40d..d6e278f 100644
--- a/src/config.h
+++ b/src/config.h
@@ -36,11 +36,6 @@
 #define COPYRIGHT               "Copyright (C) 2001-2015 David Capello"
 
 #define LOG                     verbose_log
-#ifdef _DEBUG
-#define DLOG                    LOG
-#else
-#define DLOG(...)               ((void)0)
-#endif
 
 // verbose_log() is defined in src/app/log.cpp and used through LOG macro
 void verbose_log(const char* format, ...);
diff --git a/src/updater/check_update.cpp b/src/updater/check_update.cpp
index ced6c83..c8907e6 100644
--- a/src/updater/check_update.cpp
+++ b/src/updater/check_update.cpp
@@ -117,8 +117,8 @@ public:
     HttpResponse response(&body);
     request.send(response);
 
-    DLOG("Checking updates: %s (User-Agent: %s)\n", url.c_str(), getUserAgent().c_str());
-    DLOG("Response:\n--\n%s--\n", body.str().c_str());
+    TRACE("Checking updates: %s (User-Agent: %s)\n", url.c_str(), getUserAgent().c_str());
+    TRACE("Response:\n--\n%s--\n", body.str().c_str());
 
     CheckUpdateResponse data(body.str());
     delegate->onResponse(data);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list