[niepce] Fix warnings



commit 5190f90a12e340b8b3e516377c55576ac26c2a24
Author: Hub Figuiere <hub figuiere net>
Date:   Tue Feb 21 00:35:13 2012 -0800

    Fix warnings

 src/engine/db/library.cpp             |    2 +-
 src/engine/library/thumbnailcache.cpp |    2 +-
 src/fwk/base/debug.cpp                |    2 +-
 src/fwk/toolkit/undo.cpp              |    4 ++--
 src/niepce/ui/filmstripcontroller.cpp |    2 +-
 src/niepce/ui/gridviewmodule.cpp      |    4 ++--
 src/niepce/ui/imageliststore.cpp      |    2 +-
 src/niepce/ui/moduleshell.cpp         |    8 ++++----
 src/niepce/ui/selectioncontroller.cpp |    2 +-
 src/niepce/ui/workspacecontroller.cpp |    4 ++--
 10 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/src/engine/db/library.cpp b/src/engine/db/library.cpp
index 485ad34..5de502d 100644
--- a/src/engine/db/library.cpp
+++ b/src/engine/db/library.cpp
@@ -442,7 +442,7 @@ LibFolder::Ptr Library::addFolder(const std::string & folder)
     try {
         if(m_dbdrv->execute_statement(sql)) {
             library_id_t id = m_dbdrv->last_row_id();
-            DBG_OUT("last row inserted %Ld", id);
+            DBG_OUT("last row inserted %Ld", (long long)id);
             f = LibFolder::Ptr(new LibFolder(id, 
                                              fwk::path_basename(folder)));
         }
diff --git a/src/engine/library/thumbnailcache.cpp b/src/engine/library/thumbnailcache.cpp
index cc314c3..1fa87c8 100644
--- a/src/engine/library/thumbnailcache.cpp
+++ b/src/engine/library/thumbnailcache.cpp
@@ -161,7 +161,7 @@ void ThumbnailCache::execute(const  ThumbnailTask::Ptr & task)
             tn.height = pix->get_height();
             tn.pixmap = pix;
             n->setData(boost::any(tn));
-            DBG_OUT("notify thumbnail for id=%Ld", tn.id);
+            DBG_OUT("notify thumbnail for id=%Ld", (long long)tn.id);
             nc->post(n);
         }
     }
diff --git a/src/fwk/base/debug.cpp b/src/fwk/base/debug.cpp
index daca29e..7be5abf 100644
--- a/src/fwk/base/debug.cpp
+++ b/src/fwk/base/debug.cpp
@@ -110,7 +110,7 @@ namespace fwk {
 							const char* func,	va_list marker)
 	{
 		char buf[128];
-		snprintf(buf, 128, "(%p) ", pthread_self());
+		snprintf(buf, 128, "(0x%lx) ", (unsigned long)pthread_self());
 		fwrite(buf, 1, strlen(buf), stderr);
 		fwrite(prefix, 1, strlen(prefix), stderr);
 
diff --git a/src/fwk/toolkit/undo.cpp b/src/fwk/toolkit/undo.cpp
index ae788bd..aac7a25 100644
--- a/src/fwk/toolkit/undo.cpp
+++ b/src/fwk/toolkit/undo.cpp
@@ -46,7 +46,7 @@ void UndoTransaction::add(Command * cmd)
 
 void UndoTransaction::undo()
 {
-    DBG_OUT("undo transaction %d cmd", m_operations.size());
+    DBG_OUT("undo transaction %lu cmd", (unsigned long)m_operations.size());
 // I have no idea why this do not work
 //    std::for_each(m_operations.rbegin(), m_operations.rend(),
 //                  boost::bind(&Command::undo, _1));
@@ -59,7 +59,7 @@ void UndoTransaction::undo()
 
 void UndoTransaction::redo()
 {
-    DBG_OUT("redo transaction %d cmd", m_operations.size());
+    DBG_OUT("redo transaction %lu cmd", (unsigned long)m_operations.size());
 // I have no idea why this do not work
 //    std::for_each(m_operations.begin(), m_operations.end(),
 //                  boost::bind(&Command::redo, _1));
diff --git a/src/niepce/ui/filmstripcontroller.cpp b/src/niepce/ui/filmstripcontroller.cpp
index e72e68a..ac51460 100644
--- a/src/niepce/ui/filmstripcontroller.cpp
+++ b/src/niepce/ui/filmstripcontroller.cpp
@@ -78,7 +78,7 @@ eng::library_id_t FilmStripController::get_selected()
 
 void FilmStripController::select_image(eng::library_id_t id)
 {
-    DBG_OUT("filmstrip select %Ld", id);
+    DBG_OUT("filmstrip select %Ld", (long long)id);
     Gtk::TreePath path = m_store->get_path_from_id(id);
     if(path) {
         m_thumbview->scroll_to_path(path, false, 0, 0);
diff --git a/src/niepce/ui/gridviewmodule.cpp b/src/niepce/ui/gridviewmodule.cpp
index 93e4b0c..25feabd 100644
--- a/src/niepce/ui/gridviewmodule.cpp
+++ b/src/niepce/ui/gridviewmodule.cpp
@@ -175,13 +175,13 @@ eng::library_id_t GridViewModule::get_selected()
             }
         }
     }
-    DBG_OUT("get_selected %Ld", id);
+    DBG_OUT("get_selected %Ld", (long long)id);
     return id;
 }
 
 void GridViewModule::select_image(eng::library_id_t id)
 {
-    DBG_OUT("library select %Ld", id);
+    DBG_OUT("library select %Ld", (long long)id);
     Gtk::TreePath path = m_model->get_path_from_id(id);
     if(path) {
         m_librarylistview->scroll_to_path(path, false, 0, 0);
diff --git a/src/niepce/ui/imageliststore.cpp b/src/niepce/ui/imageliststore.cpp
index 05efa1b..1dd2950 100644
--- a/src/niepce/ui/imageliststore.cpp
+++ b/src/niepce/ui/imageliststore.cpp
@@ -140,7 +140,7 @@ void ImageListStore::on_tnail_notification(const eng::ThumbnailNotification &tn)
         row[m_columns.m_strip_thumb] = fwk::gdkpixbuf_scale_to_fit(tn.pixmap, 100);
     }
     else {
-        DBG_OUT("row %Ld not found", tn.id);
+        DBG_OUT("row %Ld not found", (long long)tn.id);
     }
 }
 
diff --git a/src/niepce/ui/moduleshell.cpp b/src/niepce/ui/moduleshell.cpp
index a579d7c..ae4df92 100644
--- a/src/niepce/ui/moduleshell.cpp
+++ b/src/niepce/ui/moduleshell.cpp
@@ -235,7 +235,7 @@ void ModuleShell::on_ready()
 
 void ModuleShell::on_selected(eng::library_id_t id)
 {
-    DBG_OUT("selected callback %Ld", id);
+    DBG_OUT("selected callback %Ld", (long long)id);
     if(id > 0) {
         m_libraryclient->requestMetadata(id);
     }		
@@ -246,7 +246,7 @@ void ModuleShell::on_selected(eng::library_id_t id)
 
 void ModuleShell::on_image_activated(eng::library_id_t id)
 {
-    DBG_OUT("on image activated %Ld", id);
+    DBG_OUT("on image activated %Ld", (long long)id);
     Glib::RefPtr<ImageListStore> store = m_selection_controller->get_list_store();
     Gtk::TreeIter iter = store->get_iter_from_id(id);
     if(iter) {
@@ -258,13 +258,13 @@ void ModuleShell::on_image_activated(eng::library_id_t id)
 
 void ModuleShell::on_module_deactivated(int idx)
 {
-    DBG_ASSERT(idx < m_modules.size(), "wrong module index");
+    DBG_ASSERT((idx > 0) && ((unsigned)idx < m_modules.size()), "wrong module index");
     m_modules[idx]->set_active(false);
 }
 
 void ModuleShell::on_module_activated(int idx)
 {
-    DBG_ASSERT(idx < m_modules.size(), "wrong module index");
+    DBG_ASSERT((idx > 0) && ((unsigned)idx < m_modules.size()), "wrong module index");
     m_modules[idx]->set_active(true);
 }
 
diff --git a/src/niepce/ui/selectioncontroller.cpp b/src/niepce/ui/selectioncontroller.cpp
index 79a2709..b63a310 100644
--- a/src/niepce/ui/selectioncontroller.cpp
+++ b/src/niepce/ui/selectioncontroller.cpp
@@ -71,7 +71,7 @@ void SelectionController::activated(const Gtk::TreeModel::Path & path,
         eng::LibFile::Ptr file = (*iter)[m_imageliststore->columns().m_libfile];
         if(file) {
             eng::library_id_t selection = file->id();
-            DBG_OUT("item activated %Ld", selection);
+            DBG_OUT("item activated %Ld", (long long)selection);
             signal_activated(selection);
         }
     }
diff --git a/src/niepce/ui/workspacecontroller.cpp b/src/niepce/ui/workspacecontroller.cpp
index aa76bd3..155cbc8 100644
--- a/src/niepce/ui/workspacecontroller.cpp
+++ b/src/niepce/ui/workspacecontroller.cpp
@@ -110,7 +110,7 @@ void WorkspaceController::on_lib_notification(const eng::LibNotification &ln)
     case eng::Library::NOTIFY_FOLDER_COUNTED:
     {
         std::pair<eng::library_id_t,int> count(boost::any_cast<std::pair<eng::library_id_t,int> >(ln.param));
-        DBG_OUT("count for folder %Ld is %d", count.first, count.second);
+        DBG_OUT("count for folder %Ld is %d", (long long)count.first, count.second);
         std::map<eng::library_id_t, Gtk::TreeIter>::iterator iter
             = m_folderidmap.find( count.first );
         if(iter != m_folderidmap.end()) {
@@ -124,7 +124,7 @@ void WorkspaceController::on_lib_notification(const eng::LibNotification &ln)
     case eng::Library::NOTIFY_FOLDER_COUNT_CHANGE:
     {
         std::pair<eng::library_id_t,int> count(boost::any_cast<std::pair<eng::library_id_t,int> >(ln.param));
-        DBG_OUT("count change for folder %Ld is %d", count.first, count.second);
+        DBG_OUT("count change for folder %Ld is %d", (long long)count.first, count.second);
         std::map<eng::library_id_t, Gtk::TreeIter>::iterator iter
             = m_folderidmap.find( count.first );
         if(iter != m_folderidmap.end()) {



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