Fix warnings on 64 bits
authorLucas De Marchi <lucas.demarchi@intel.com>
Wed, 4 Dec 2013 19:58:15 +0000 (17:58 -0200)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 4 Dec 2013 20:00:30 +0000 (18:00 -0200)
Use the glib-provided macros to print 64 bit values.

lightmediascannerd.c:212:9: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘gint64’ [-Wformat=]
         g_warning("Couldn't bind delete old dtime '%lld'from %s: %s",

lightmediascannerctl.c:280:16: warning: format ‘%llu’ expects argument
of type ‘long long unsigned int’, but argument 4 has type ‘guint64’
[-Wformat=]
                category, path, uptodate, processed, deleted, skipped,
errors);

src/bin/lightmediascannerctl.c
src/bin/lightmediascannerd.c

index b2e002d..8931f33 100644 (file)
@@ -275,8 +275,9 @@ on_signal(GDBusProxy *proxy, gchar *sender, gchar *signal, GVariant *params, gpo
                       &skipped,
                       &errors);
 
-        printf("Scan Progress %s:%s uptodate=%llu, processed=%llu, "
-               "deleted=%llu, skipped=%llu, errors=%llu\n",
+        printf("Scan Progress %s:%s uptodate=%"G_GUINT64_FORMAT", "
+               "processed=%"G_GUINT64_FORMAT", deleted=%"G_GUINT64_FORMAT", "
+               "skipped=%"G_GUINT64_FORMAT", errors=%"G_GUINT64_FORMAT"\n",
                category, path, uptodate, processed, deleted, skipped, errors);
     }
 }
index a28f35e..96d1137 100644 (file)
@@ -209,15 +209,15 @@ do_delete_old(void)
 
     dtime = (gint64)time(NULL) - delete_older_than * (24 * 60 * 60);
     if (sqlite3_bind_int64(stmt, 1, dtime) != SQLITE_OK) {
-        g_warning("Couldn't bind delete old dtime '%lld'from %s: %s",
-                  dtime, db_path, sqlite3_errmsg(db));
+        g_warning("Couldn't bind delete old dtime '%"G_GINT64_FORMAT
+                  "'from %s: %s", dtime, db_path, sqlite3_errmsg(db));
         goto cleanup;
     }
 
     ret = sqlite3_step(stmt);
     if (ret != SQLITE_DONE)
-        g_warning("Couldn't run SQL delete old dtime '%lld', ret=%d: %s",
-                  dtime, ret, sqlite3_errmsg(db));
+        g_warning("Couldn't run SQL delete old dtime '%"G_GINT64_FORMAT
+                  "', ret=%d: %s", dtime, ret, sqlite3_errmsg(db));
 
 cleanup:
     sqlite3_reset(stmt);