[tracker/compilation-warnings: 1/13] libtracker-common: use g_format_size() if GLib >= 2.30
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/compilation-warnings: 1/13] libtracker-common: use g_format_size() if GLib >= 2.30
- Date: Fri, 16 Dec 2011 12:43:51 +0000 (UTC)
commit d41af3d4b085dd3251cac31987947f27041cb343
Author: Aleksander Morgado <aleksander lanedo com>
Date: Fri Dec 16 10:41:11 2011 +0100
libtracker-common: use g_format_size() if GLib >= 2.30
Since 2.30, g_format_size_for_display() is deprecated due to wrongly using
SI suffixes to denote IEC units.
src/libtracker-common/tracker-file-utils.c | 6 ++++++
src/libtracker-common/tracker-os-dependant-unix.c | 5 +++++
2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-common/tracker-file-utils.c b/src/libtracker-common/tracker-file-utils.c
index af71d2b..27f54ae 100644
--- a/src/libtracker-common/tracker-file-utils.c
+++ b/src/libtracker-common/tracker-file-utils.c
@@ -306,8 +306,14 @@ tracker_file_system_has_enough_space (const gchar *path,
enough = (remaining >= required_bytes);
if (creating_db) {
+
+#if GLIB_CHECK_VERSION (2,30,0)
+ str1 = g_format_size (required_bytes);
+ str2 = g_format_size (remaining);
+#else
str1 = g_format_size_for_display (required_bytes);
str2 = g_format_size_for_display (remaining);
+#endif
if (!enough) {
g_critical ("Not enough disk space to create databases, "
diff --git a/src/libtracker-common/tracker-os-dependant-unix.c b/src/libtracker-common/tracker-os-dependant-unix.c
index 1c1975c..0baa421 100644
--- a/src/libtracker-common/tracker-os-dependant-unix.c
+++ b/src/libtracker-common/tracker-os-dependant-unix.c
@@ -312,8 +312,13 @@ tracker_memory_setrlimits (void)
} else {
gchar *str1, *str2;
+#if GLIB_CHECK_VERSION (2,30,0)
+ str1 = g_format_size (total);
+ str2 = g_format_size (limit);
+#else
str1 = g_format_size_for_display (total);
str2 = g_format_size_for_display (limit);
+#endif
g_message ("Setting memory limitations: total is %s, minimum is 256 MB, recommended is ~1 GB", str1);
g_message (" Virtual/Heap set to %s (50%% of total or MAXLONG)", str2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]