[tracker/wip/sam/meson] libtracker-sparql: Use correct printf format specifiers for gint64



commit 95775ba2ba93a45f3de547bec4271668921fa2e9
Author: Sam Thursfield <sam afuera me uk>
Date:   Sat Mar 11 23:55:25 2017 +0000

    libtracker-sparql: Use correct printf format specifiers for gint64
    
    Sadly the correct format is different on 32bit and 64bit systems so we
    have to use the unweildy G_GINT64_FORMAT macro.

 src/libtracker-sparql/tracker-notifier.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/libtracker-sparql/tracker-notifier.c b/src/libtracker-sparql/tracker-notifier.c
index e448e79..4b036c7 100644
--- a/src/libtracker-sparql/tracker-notifier.c
+++ b/src/libtracker-sparql/tracker-notifier.c
@@ -433,7 +433,7 @@ create_extra_info_query (TrackerNotifier *notifier,
                if (has_elements)
                        g_string_append_c (filter, ',');
 
-               g_string_append_printf (filter, "%ld", event->id);
+               g_string_append_printf (filter, "%" G_GINT64_FORMAT "d", event->id);
                has_elements = TRUE;
        }
 
@@ -489,8 +489,8 @@ tracker_notifier_query_extra_info (TrackerNotifier *notifier,
                event = find_event_in_array (events, id, &idx);
 
                if (!event) {
-                       g_critical ("Queried for id %ld but it is not found, "
-                                   "bailing out", id);
+                       g_critical ("Queried for id %" G_GINT64_FORMAT "d but it is not "
+                                   "found, bailing out", id);
                        break;
                }
 
@@ -522,7 +522,8 @@ create_extra_deleted_info_query (TrackerNotifier *notifier,
                if (event->type != TRACKER_NOTIFIER_EVENT_DELETE)
                        continue;
 
-               g_string_append_printf (sparql, "%ld tracker:uri(%ld) ",
+               g_string_append_printf (sparql, "%" G_GINT64_FORMAT "d "
+                                       "tracker:uri(%" G_GINT64_FORMAT "d)",
                                        event->id, event->id);
                has_elements = TRUE;
        }
@@ -572,8 +573,8 @@ tracker_notifier_query_extra_deleted_info (TrackerNotifier *notifier,
                event = find_event_in_array (events, id, &idx);
 
                if (!event) {
-                       g_critical ("Queried for id %ld in column %d but it "
-                                   "is not found, bailing out", id, col);
+                       g_critical ("Queried for id %" G_GINT64_FORMAT "d in column %d "
+                                   "but it is not found, bailing out", id, col);
                        break;
                }
 


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