[gnote] Fix compile time warnings for unused stuff in release build



commit 3c91c7415a8927d95ce9b14c083305d34f1f88c5
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Dec 15 23:14:05 2013 +0200

    Fix compile time warnings for unused stuff in release build

 .../stickynoteimport/stickynoteimportnoteaddin.cpp |    2 ++
 src/debug.cpp                                      |    6 +++---
 src/debug.hpp                                      |    8 +++++++-
 src/synchronization/silentui.cpp                   |    2 +-
 src/watchers.cpp                                   |    6 +++++-
 5 files changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/src/addins/stickynoteimport/stickynoteimportnoteaddin.cpp 
b/src/addins/stickynoteimport/stickynoteimportnoteaddin.cpp
index 6128bfd..0ddfb73 100644
--- a/src/addins/stickynoteimport/stickynoteimportnoteaddin.cpp
+++ b/src/addins/stickynoteimport/stickynoteimportnoteaddin.cpp
@@ -53,10 +53,12 @@ StickyNoteImportModule::StickyNoteImportModule()
 
 static const char * STICKY_XML_REL_PATH = "/.gnome2/stickynotes_applet";
 static const char * STICKY_NOTE_QUERY = "//note";
+#ifdef DEBUG
 static const char * DEBUG_NO_STICKY_FILE = "StickyNoteImporter: Sticky Notes XML file does not exist or is 
invalid!";
 static const char * DEBUG_CREATE_ERROR_BASE = "StickyNoteImporter: Error while trying to create note \"%s\": 
%s";
 static const char * DEBUG_FIRST_RUN_DETECTED = "StickyNoteImporter: Detecting that importer has never been 
run...";
 //static const char * DEBUG_GCONF_SET_ERROR_BASE = "StickyNoteImporter: Error setting initial GConf first 
run key value: %s";
+#endif
 
 static const char * PREFS_FILE = "stickynoteimport.ini";
 
diff --git a/src/debug.cpp b/src/debug.cpp
index 44b0217..414eddd 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2012 Aurimas Cernius
+ * Copyright (C) 2012-2013 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
@@ -67,7 +67,7 @@ namespace utils {
   static void _print(const char *prefix, const char *fmt, 
              const char* func, ...);
 
-  void dbg_print(const char *fmt, const char* func, ...)
+  void dbg_print(const char *DBG(fmt), const char* DBG(func), ...)
   {
 #ifdef DEBUG
 #define DEBUG_MSG "DEBUG: "
@@ -112,7 +112,7 @@ namespace utils {
   }
 
 
-  void log_print(const char *fmt, const char *func, ...)
+  void log_print(const char *DBG(fmt), const char *DBG(func), ...)
   {
 #ifdef DEBUG
 #define LOG_MSG "LOG: "
diff --git a/src/debug.hpp b/src/debug.hpp
index 5c1a05f..2cc733e 100644
--- a/src/debug.hpp
+++ b/src/debug.hpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2012 Aurimas Cernius
+ * Copyright (C) 2012-2013 Aurimas Cernius
  * Copyright (C) 2009 Hubert Figuiere
  *
  * This program is free software: you can redistribute it and/or modify
@@ -33,6 +33,12 @@
 namespace utils {
 
 #ifdef DEBUG
+#define DBG(x) x
+#else
+#define DBG(x)
+#endif
+
+#ifdef DEBUG
 #define DBG_OUT(x, ...) \
   ::utils::dbg_print(x,  __FUNCTION__, ## __VA_ARGS__)
 #else
diff --git a/src/synchronization/silentui.cpp b/src/synchronization/silentui.cpp
index acc1d2e..d26ef2a 100644
--- a/src/synchronization/silentui.cpp
+++ b/src/synchronization/silentui.cpp
@@ -67,7 +67,7 @@ namespace sync {
   }
 
 
-  void SilentUI::note_synchronized(const std::string & noteTitle, NoteSyncType type)
+  void SilentUI::note_synchronized(const std::string & DBG(noteTitle), NoteSyncType DBG(type))
   {
     DBG_OUT("note synchronized, Title: %s, Type: %d", noteTitle.c_str(), int(type));
   }
diff --git a/src/watchers.cpp b/src/watchers.cpp
index 99f4c23..56afa4e 100644
--- a/src/watchers.cpp
+++ b/src/watchers.cpp
@@ -1298,10 +1298,12 @@ namespace gnote {
 
   void NoteTagsWatcher::initialize ()
   {
+#ifdef DEBUG
     m_on_tag_added_cid = get_note()->signal_tag_added().connect(
       sigc::mem_fun(*this, &NoteTagsWatcher::on_tag_added));
     m_on_tag_removing_cid = get_note()->signal_tag_removing().connect(
       sigc::mem_fun(*this, &NoteTagsWatcher::on_tag_removing));
+#endif
     m_on_tag_removed_cid = get_note()->signal_tag_removed().connect(
       sigc::mem_fun(*this, &NoteTagsWatcher::on_tag_removed));      
   }
@@ -1324,7 +1326,8 @@ namespace gnote {
 //    }
   }
 
-  void NoteTagsWatcher::on_tag_added(const Note& note, const Tag::Ptr& tag)
+#ifdef DEBUG
+  void NoteTagsWatcher::on_tag_added(const Note& DBG(note), const Tag::Ptr& DBG(tag))
   {
     DBG_OUT ("Tag added to %s: %s", note.get_title().c_str(), tag->name().c_str());
   }
@@ -1334,6 +1337,7 @@ namespace gnote {
   {
     DBG_OUT ("Removing tag from %s: %s", note.get_title().c_str(), tag.name().c_str());
   }
+#endif
 
 
   void NoteTagsWatcher::on_tag_removed(const Note::Ptr&, const std::string& tag_name)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]