summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2012-12-07 20:06:33 +0100
committerPatrick Ohly <patrick.ohly@intel.com>2012-12-07 20:09:08 +0100
commitb38c88b40cd635f4ab9b0e77a13f82abc62b6be6 (patch)
treeb3f7f37be1207813296f12039de3c8a997a03d4a
parent2e48d4ef9dfb8268934ef2630535f368239d9289 (diff)
PIM: avoid compiler warnings in 32 bit
gcc warns about a "long int" vs. "unsigned int" mismatch when compiling for x86. All of that is in debugging output printfs. Cast the index_t into long int to avoid that.
-rw-r--r--src/dbus/server/pim/filtered-view.cpp14
-rw-r--r--src/dbus/server/pim/full-view.cpp8
-rw-r--r--src/dbus/server/pim/merge-view.cpp2
3 files changed, 12 insertions, 12 deletions
diff --git a/src/dbus/server/pim/filtered-view.cpp b/src/dbus/server/pim/filtered-view.cpp
index 421545e5..2521522f 100644
--- a/src/dbus/server/pim/filtered-view.cpp
+++ b/src/dbus/server/pim/filtered-view.cpp
@@ -151,7 +151,7 @@ void FilteredView::addIndividual(int parentIndex, const IndividualData &data)
if (newEndIndex > index &&
!m_filter->isIncluded(newEndIndex)) {
const IndividualData *data = m_parent->getContact(m_local2parent.back());
- SE_LOG_DEBUG(NULL, NULL, "%s: removed at #%ld/%ld to make room for new entry", getName(), newEndIndex - 1, m_local2parent.size());
+ SE_LOG_DEBUG(NULL, NULL, "%s: removed at #%ld/%ld to make room for new entry", getName(), (long)(newEndIndex - 1), (long)m_local2parent.size());
m_local2parent.pop_back();
m_removedSignal(newEndIndex - 1, *data);
// Iterator might have pointed to removed entry, which may have
@@ -160,10 +160,10 @@ void FilteredView::addIndividual(int parentIndex, const IndividualData &data)
}
m_local2parent.insert(it, parentIndex);
- SE_LOG_DEBUG(NULL, NULL, "%s: added at #%ld/%ld", getName(), index, m_local2parent.size());
+ SE_LOG_DEBUG(NULL, NULL, "%s: added at #%ld/%ld", getName(), (long)index, (long)m_local2parent.size());
m_addedSignal(index, data);
} else {
- SE_LOG_DEBUG(NULL, NULL, "%s: not added at #%ld/%ld because outside of result range", getName(), index, m_local2parent.size());
+ SE_LOG_DEBUG(NULL, NULL, "%s: not added at #%ld/%ld because outside of result range", getName(), (long)index, (long)m_local2parent.size());
}
}
}
@@ -189,7 +189,7 @@ void FilteredView::removeIndividual(int parentIndex, const IndividualData &data)
if (found) {
size_t index = it - m_local2parent.begin();
- SE_LOG_DEBUG(NULL, NULL, "%s: removed at #%ld/%ld", getName(), index, m_local2parent.size());
+ SE_LOG_DEBUG(NULL, NULL, "%s: removed at #%ld/%ld", getName(), (long)index, (long)m_local2parent.size());
m_local2parent.erase(it);
m_removedSignal(index, data);
// Try adding more contacts from the parent if there is room now.
@@ -209,11 +209,11 @@ void FilteredView::modifyIndividual(int parentIndex, const IndividualData &data)
size_t index = it - m_local2parent.begin();
if (matches) {
// Still matched, merely pass on modification signal.
- SE_LOG_DEBUG(NULL, NULL, "%s: modified at #%ld/%ld", getName(), index, m_local2parent.size());
+ SE_LOG_DEBUG(NULL, NULL, "%s: modified at #%ld/%ld", getName(), (long)index, (long)m_local2parent.size());
m_modifiedSignal(index, data);
} else {
// Removed.
- SE_LOG_DEBUG(NULL, NULL, "%s: removed at #%ld/%ld due to modification", getName(), index, m_local2parent.size());
+ SE_LOG_DEBUG(NULL, NULL, "%s: removed at #%ld/%ld due to modification", getName(), (long)index, (long)m_local2parent.size());
int candidate = m_local2parent.back() + 1;
m_local2parent.erase(it);
m_removedSignal(index, data);
@@ -224,7 +224,7 @@ void FilteredView::modifyIndividual(int parentIndex, const IndividualData &data)
size_t index = it - m_local2parent.begin();
if (m_filter->isIncluded(index)) {
m_local2parent.insert(it, parentIndex);
- SE_LOG_DEBUG(NULL, NULL, "%s: added at #%ld/%ld due to modification", getName(), index, m_local2parent.size());
+ SE_LOG_DEBUG(NULL, NULL, "%s: added at #%ld/%ld due to modification", getName(), (long)index, (long)m_local2parent.size());
m_addedSignal(index, data);
}
} else {
diff --git a/src/dbus/server/pim/full-view.cpp b/src/dbus/server/pim/full-view.cpp
index 0bb3aa0f..0c6d64b9 100644
--- a/src/dbus/server/pim/full-view.cpp
+++ b/src/dbus/server/pim/full-view.cpp
@@ -182,7 +182,7 @@ void FullView::doAddIndividual(Entries_t::auto_type &data)
IndividualDataCompare(m_compare));
size_t index = it - m_entries.begin();
it = m_entries.insert(it, data.release());
- SE_LOG_DEBUG(NULL, NULL, "full view: added at #%ld/%ld", index, m_entries.size());
+ SE_LOG_DEBUG(NULL, NULL, "full view: added at #%ld/%ld", (long)index, (long)m_entries.size());
m_addedSignal(index, *it);
waitForIdle();
@@ -221,12 +221,12 @@ void FullView::modifyIndividual(FolksIndividual *individual)
// sorting became invalid => move the entry. Do it
// as simple as possible, because this is not expected
// to happen often.
- SE_LOG_DEBUG(NULL, NULL, "full view: temporarily removed at #%ld/%ld", index, m_entries.size());
+ SE_LOG_DEBUG(NULL, NULL, "full view: temporarily removed at #%ld/%ld", (long)index, (long)m_entries.size());
Entries_t::auto_type old = m_entries.release(it);
m_removedSignal(index, *old);
doAddIndividual(data);
} else {
- SE_LOG_DEBUG(NULL, NULL, "full view: modified at #%ld/%ld", index, m_entries.size());
+ SE_LOG_DEBUG(NULL, NULL, "full view: modified at #%ld/%ld", (long)index, (long)m_entries.size());
// Use potentially modified pre-computed data.
m_entries.replace(it, data.release());
m_modifiedSignal(index, *it);
@@ -247,7 +247,7 @@ void FullView::removeIndividual(FolksIndividual *individual)
++it) {
if (it->m_individual.get() == individual) {
size_t index = it - m_entries.begin();
- SE_LOG_DEBUG(NULL, NULL, "full view: removed at #%ld/%ld", index, m_entries.size());
+ SE_LOG_DEBUG(NULL, NULL, "full view: removed at #%ld/%ld", (long)index, (long)m_entries.size());
Entries_t::auto_type data = m_entries.release(it);
m_removedSignal(index, *data);
waitForIdle();
diff --git a/src/dbus/server/pim/merge-view.cpp b/src/dbus/server/pim/merge-view.cpp
index 5cd30ac6..eecf0e4a 100644
--- a/src/dbus/server/pim/merge-view.cpp
+++ b/src/dbus/server/pim/merge-view.cpp
@@ -82,7 +82,7 @@ void MergeView::addEDSIndividual(const FolksIndividualCXX &individual) throw ()
IndividualDataCompare(m_compare));
size_t index = it - m_entries.begin();
it = m_entries.insert(it, data.release());
- SE_LOG_DEBUG(NULL, NULL, "%s: added at #%ld/%ld", getName(), index, m_entries.size());
+ SE_LOG_DEBUG(NULL, NULL, "%s: added at #%ld/%ld", getName(), (long)index, (long)m_entries.size());
m_addedSignal(index, *it);
} catch (...) {
Exception::handle(HANDLE_EXCEPTION_NO_ERROR);