mirror of https://github.com/GNOME/gimp.git
app: use g_strcmp0() where strings can be NULL instead of checking manually
This commit is contained in:
parent
6d67ffd6f0
commit
8cefb2913e
|
@ -354,7 +354,7 @@ documents_raise_display (GimpDisplay *display,
|
||||||
{
|
{
|
||||||
const gchar *uri = gimp_object_get_name (gimp_display_get_image (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;
|
closure->found = TRUE;
|
||||||
gimp_display_shell_present (gimp_display_get_shell (display));
|
gimp_display_shell_present (gimp_display_get_shell (display));
|
||||||
|
|
|
@ -205,8 +205,7 @@ gimp_object_set_name (GimpObject *object,
|
||||||
{
|
{
|
||||||
g_return_if_fail (GIMP_IS_OBJECT (object));
|
g_return_if_fail (GIMP_IS_OBJECT (object));
|
||||||
|
|
||||||
if ((!object->p->name && !name) ||
|
if (! g_strcmp0 (object->p->name, name))
|
||||||
(object->p->name && name && !strcmp (object->p->name, name)))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gimp_object_name_free (object);
|
gimp_object_name_free (object);
|
||||||
|
@ -233,8 +232,7 @@ gimp_object_set_name_safe (GimpObject *object,
|
||||||
{
|
{
|
||||||
g_return_if_fail (GIMP_IS_OBJECT (object));
|
g_return_if_fail (GIMP_IS_OBJECT (object));
|
||||||
|
|
||||||
if ((!object->p->name && !name) ||
|
if (! g_strcmp0 (object->p->name, name))
|
||||||
(object->p->name && name && !strcmp (object->p->name, name)))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
gimp_object_name_free (object);
|
gimp_object_name_free (object);
|
||||||
|
|
|
@ -419,8 +419,7 @@ gimp_pdb_progress_get_by_callback (GimpPdbProgressClass *klass,
|
||||||
{
|
{
|
||||||
GimpPdbProgress *progress = list->data;
|
GimpPdbProgress *progress = list->data;
|
||||||
|
|
||||||
if (progress->callback_name &&
|
if (! g_strcmp0 (callback_name, progress->callback_name))
|
||||||
strcmp (callback_name, progress->callback_name) == 0)
|
|
||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -566,7 +566,7 @@ gimp_tag_cache_load_text (GMarkupParseContext *context,
|
||||||
|
|
||||||
current_element = g_markup_parse_context_get_element (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))
|
if (text_len >= sizeof (buffer))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue