app: use g_strcmp0() where strings can be NULL instead of checking manually

This commit is contained in:
Michael Natterer 2010-06-06 19:15:49 +02:00
parent 6d67ffd6f0
commit 8cefb2913e
4 changed files with 5 additions and 8 deletions

View File

@ -354,7 +354,7 @@ documents_raise_display (GimpDisplay *display,
{
const gchar *uri = gimp_object_get_name (gimp_display_get_image (display));
if (uri && ! strcmp (closure->name, uri))
if (! g_strcmp0 (closure->name, uri))
{
closure->found = TRUE;
gimp_display_shell_present (gimp_display_get_shell (display));

View File

@ -205,8 +205,7 @@ gimp_object_set_name (GimpObject *object,
{
g_return_if_fail (GIMP_IS_OBJECT (object));
if ((!object->p->name && !name) ||
(object->p->name && name && !strcmp (object->p->name, name)))
if (! g_strcmp0 (object->p->name, name))
return;
gimp_object_name_free (object);
@ -233,8 +232,7 @@ gimp_object_set_name_safe (GimpObject *object,
{
g_return_if_fail (GIMP_IS_OBJECT (object));
if ((!object->p->name && !name) ||
(object->p->name && name && !strcmp (object->p->name, name)))
if (! g_strcmp0 (object->p->name, name))
return;
gimp_object_name_free (object);

View File

@ -419,8 +419,7 @@ gimp_pdb_progress_get_by_callback (GimpPdbProgressClass *klass,
{
GimpPdbProgress *progress = list->data;
if (progress->callback_name &&
strcmp (callback_name, progress->callback_name) == 0)
if (! g_strcmp0 (callback_name, progress->callback_name))
return progress;
}

View File

@ -566,7 +566,7 @@ gimp_tag_cache_load_text (GMarkupParseContext *context,
current_element = g_markup_parse_context_get_element (context);
if (current_element && strcmp (current_element, "tag") == 0)
if (g_strcmp0 (current_element, "tag") == 0)
{
if (text_len >= sizeof (buffer))
{