Use g_strcmp0 instead of rolling our own
authorMatthias Clasen <matthiasc@src.gnome.org>
Tue, 15 Jul 2008 05:42:11 +0000 (05:42 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 15 Jul 2008 05:42:11 +0000 (05:42 +0000)
svn path=/trunk/; revision=7183

gio/ChangeLog
gio/gunixmounts.c

index 68e3b9b..876ff02 100644 (file)
@@ -1,3 +1,7 @@
+2008-07-15  Matthias Clasen  <mclasen@redhat.com>
+
+       * gunixmounts.c: Use g_strcmp0 instead of rolling our own.
+
 2008-07-08  Matthias Clasen  <mclasen@redhat.com>
 
        * gvolumemonitor.c:
index 5b5920c..0277eeb 100644 (file)
@@ -1310,19 +1310,6 @@ g_unix_mount_point_free (GUnixMountPoint *mount_point)
   g_free (mount_point);
 }
 
-static int
-strcmp_null (const char *str1,
-            const char *str2)
-{
-  if (str1 == str2)
-    return 0;
-  if (str1 == NULL && str2 != NULL) 
-    return -1;
-  if (str1 != NULL && str2 == NULL)
-    return 1;
-  return strcmp (str1, str2);
-}
-
 /**
  * g_unix_mount_compare:
  * @mount1: first #GUnixMountEntry to compare.
@@ -1341,15 +1328,15 @@ g_unix_mount_compare (GUnixMountEntry *mount1,
 
   g_return_val_if_fail (mount1 != NULL && mount2 != NULL, 0);
   
-  res = strcmp_null (mount1->mount_path, mount2->mount_path);
+  res = g_strcmp0 (mount1->mount_path, mount2->mount_path);
   if (res != 0)
     return res;
        
-  res = strcmp_null (mount1->device_path, mount2->device_path);
+  res = g_strcmp0 (mount1->device_path, mount2->device_path);
   if (res != 0)
     return res;
        
-  res = strcmp_null (mount1->filesystem_type, mount2->filesystem_type);
+  res = g_strcmp0 (mount1->filesystem_type, mount2->filesystem_type);
   if (res != 0)
     return res;
 
@@ -1458,15 +1445,15 @@ g_unix_mount_point_compare (GUnixMountPoint *mount1,
 
   g_return_val_if_fail (mount1 != NULL && mount2 != NULL, 0);
 
-  res = strcmp_null (mount1->mount_path, mount2->mount_path);
+  res = g_strcmp0 (mount1->mount_path, mount2->mount_path);
   if (res != 0) 
     return res;
        
-  res = strcmp_null (mount1->device_path, mount2->device_path);
+  res = g_strcmp0 (mount1->device_path, mount2->device_path);
   if (res != 0) 
     return res;
        
-  res = strcmp_null (mount1->filesystem_type, mount2->filesystem_type);
+  res = g_strcmp0 (mount1->filesystem_type, mount2->filesystem_type);
   if (res != 0) 
     return res;