summaryrefslogtreecommitdiff
path: root/libnautilus-extensions/nautilus-glib-extensions.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnautilus-extensions/nautilus-glib-extensions.c')
-rw-r--r--libnautilus-extensions/nautilus-glib-extensions.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/libnautilus-extensions/nautilus-glib-extensions.c b/libnautilus-extensions/nautilus-glib-extensions.c
index c0660dbec..8b4b5e09c 100644
--- a/libnautilus-extensions/nautilus-glib-extensions.c
+++ b/libnautilus-extensions/nautilus-glib-extensions.c
@@ -997,9 +997,12 @@ nautilus_shell_quote (const char *string)
return quoted_str;
}
-int nautilus_g_round (double d)
+int
+nautilus_round (double d)
{
- double val = floor (d + .5);
+ double val;
+
+ val = floor (d + .5);
/* The tests are needed because the result of floating-point to integral
* conversion is undefined if the floating point value is not representable
@@ -1012,6 +1015,32 @@ int nautilus_g_round (double d)
return val;
}
+GList *
+nautilus_g_list_from_g_slist (GSList *slist)
+{
+ GList *list;
+ GSList *node;
+
+ list = NULL;
+ for (node = slist; node != NULL; node = node->next) {
+ list = g_list_prepend (list, node->data);
+ }
+ return g_list_reverse (list);
+}
+
+GSList *
+nautilus_g_slist_from_g_list (GList *list)
+{
+ GSList *slist;
+ GList *node;
+
+ slist = NULL;
+ for (node = list; node != NULL; node = node->next) {
+ slist = g_slist_prepend (slist, node->data);
+ }
+ return g_slist_reverse (slist);
+}
+
#if !defined (NAUTILUS_OMIT_SELF_CHECK)
static void