[gnome-nettool] Fix compilation on x86_64 with gcc 4.8
- From: Germán Poó Caamaño <gpoo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-nettool] Fix compilation on x86_64 with gcc 4.8
- Date: Fri, 31 May 2013 00:04:42 +0000 (UTC)
commit c32c0c65eabcf3355c0739116d37304d343b5cbc
Author: Jan Alexander Steffens <jan steffens gmail com>
Date: Thu May 30 17:02:06 2013 -0700
Fix compilation on x86_64 with gcc 4.8
Use Glib constants to print guint64.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=699546
Signed-off-by: Germán Poo-Caamaño <gpoo gnome org>
src/info.c | 10 +++++-----
src/utils.c | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/info.c b/src/info.c
index 11ebc0f..4a5ebfb 100644
--- a/src/info.c
+++ b/src/info.c
@@ -232,13 +232,13 @@ info_nic_update_stats (gpointer data)
text_rx_bytes = util_legible_bytes (netload.bytes_in);
text_tx_bytes = util_legible_bytes (netload.bytes_out);
- g_sprintf (rx_pkt, "%lld", netload.packets_in);
- g_sprintf (tx_pkt, "%lld", netload.packets_out);
+ g_sprintf (rx_pkt, "%" G_GUINT64_FORMAT, netload.packets_in);
+ g_sprintf (tx_pkt, "%" G_GUINT64_FORMAT, netload.packets_out);
- g_sprintf (rx_error, "%lld", netload.errors_in);
- g_sprintf (tx_error, "%lld", netload.errors_out);
+ g_sprintf (rx_error, "%" G_GUINT64_FORMAT, netload.errors_in);
+ g_sprintf (tx_error, "%" G_GUINT64_FORMAT, netload.errors_out);
- g_sprintf (collisions, "%lld", netload.collisions);
+ g_sprintf (collisions, "%" G_GUINT64_FORMAT, netload.collisions);
gtk_label_set_text (GTK_LABEL (info->tx_bytes), text_tx_bytes);
gtk_label_set_text (GTK_LABEL (info->tx), tx_pkt);
diff --git a/src/utils.c b/src/utils.c
index eef3cbe..4d2ae8a 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -272,7 +272,7 @@ util_legible_bytes (guint64 bytes)
unit = "KiB";
}
- result = g_strdup_printf ("%lld.%lld %s", short_rx / 10,
+ result = g_strdup_printf ("%" G_GUINT64_FORMAT ".%" G_GUINT64_FORMAT " %s", short_rx / 10,
short_rx % 10, unit);
return result;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]