G_DEFINE_TYPE (GtkPrinter, gtk_printer, G_TYPE_OBJECT)
-static int
-safe_strcmp (const char *a, const char *b)
-{
- if (a == b)
- return 0;
- if (a == NULL)
- return -1;
- if (b == NULL)
- return 1;
- return strcmp (a, b);
-}
-
static void
gtk_printer_class_init (GtkPrinterClass *class)
{
priv = printer->priv;
- if (safe_strcmp (priv->description, description) == 0)
+ if (g_strcmp0 (priv->description, description) == 0)
return FALSE;
g_free (priv->description);
priv = printer->priv;
- if (safe_strcmp (priv->state_message, message) == 0)
+ if (g_strcmp0 (priv->state_message, message) == 0)
return FALSE;
g_free (priv->state_message);
priv = printer->priv;
- if (safe_strcmp (priv->location, location) == 0)
+ if (g_strcmp0 (priv->location, location) == 0)
return FALSE;
g_free (priv->location);
NULL);
}
-static int
-safe_strcmp (const char *a, const char *b)
-{
- if (a == NULL)
- a = "";
- if (b == NULL)
- b = "";
-
- return strcmp (a, b);
-}
-
/**
* gtk_printer_option_set_get_groups:
*
{
option = g_ptr_array_index (set->array, i);
- if (g_list_find_custom (list, option->group, (GCompareFunc)safe_strcmp) == NULL)
+ if (g_list_find_custom (list, option->group, (GCompareFunc)g_strcmp0) == NULL)
list = g_list_prepend (list, g_strdup (option->group));
}