[gimp] app: remove pointless NULL checks
- From: Mikael Magnusson <mikachu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: remove pointless NULL checks
- Date: Sat, 15 Jun 2013 23:34:53 +0000 (UTC)
commit 00916451294dc9f0c90d2daed3820a36b3210646
Author: Mikael Magnusson <mikachu src gnome org>
Date: Sat Jun 15 23:07:06 2013 +0200
app: remove pointless NULL checks
app/core/gimpviewable.c | 2 --
app/dialogs/file-save-dialog.c | 6 ++----
app/vectors/gimpbezierstroke.c | 4 ++--
app/widgets/gimpsessioninfo-dock.c | 6 +++---
app/widgets/gimpuimanager.c | 6 ++----
5 files changed, 9 insertions(+), 15 deletions(-)
---
diff --git a/app/core/gimpviewable.c b/app/core/gimpviewable.c
index 6eb9940..a3a7e89 100644
--- a/app/core/gimpviewable.c
+++ b/app/core/gimpviewable.c
@@ -526,8 +526,6 @@ gimp_viewable_deserialize_property (GimpConfig *config,
if (pixbuf)
{
- if (icon_pixbuf)
- g_object_unref (icon_pixbuf);
icon_pixbuf = pixbuf;
}
diff --git a/app/dialogs/file-save-dialog.c b/app/dialogs/file-save-dialog.c
index 762b00b..b7f5595 100644
--- a/app/dialogs/file-save-dialog.c
+++ b/app/dialogs/file-save-dialog.c
@@ -229,12 +229,10 @@ file_save_dialog_response (GtkWidget *save_dialog,
g_free (uri);
g_free (basename);
- if (dialog)
- gimp_file_dialog_set_sensitive (dialog, TRUE);
+ gimp_file_dialog_set_sensitive (dialog, TRUE);
}
- if (dialog)
- g_signal_handler_disconnect (dialog, handler_id);
+ g_signal_handler_disconnect (dialog, handler_id);
}
/*
diff --git a/app/vectors/gimpbezierstroke.c b/app/vectors/gimpbezierstroke.c
index 5669bb6..4385d6a 100644
--- a/app/vectors/gimpbezierstroke.c
+++ b/app/vectors/gimpbezierstroke.c
@@ -570,7 +570,7 @@ gimp_bezier_stroke_nearest_point_get (const GimpStroke *stroke,
min_dist = -1;
for (anchorlist = stroke->anchors;
- anchorlist && GIMP_ANCHOR (anchorlist->data)->type != GIMP_ANCHOR_ANCHOR;
+ GIMP_ANCHOR (anchorlist->data)->type != GIMP_ANCHOR_ANCHOR;
anchorlist = g_list_next (anchorlist));
segment_start = anchorlist->data;
@@ -806,7 +806,7 @@ gimp_bezier_stroke_nearest_tangent_get (const GimpStroke *stroke,
min_dist = -1;
for (anchorlist = stroke->anchors;
- anchorlist && GIMP_ANCHOR (anchorlist->data)->type != GIMP_ANCHOR_ANCHOR;
+ GIMP_ANCHOR (anchorlist->data)->type != GIMP_ANCHOR_ANCHOR;
anchorlist = g_list_next (anchorlist));
segment_start = anchorlist->data;
diff --git a/app/widgets/gimpsessioninfo-dock.c b/app/widgets/gimpsessioninfo-dock.c
index 4f809b2..563258d 100644
--- a/app/widgets/gimpsessioninfo-dock.c
+++ b/app/widgets/gimpsessioninfo-dock.c
@@ -300,7 +300,7 @@ gimp_session_info_dock_restore (GimpSessionInfoDock *dock_info,
/* Note that if it is a toolbox, we will get here even though we
* don't have any books
*/
- for (iter = dock_info ? dock_info->books : NULL;
+ for (iter = dock_info->books;
iter;
iter = g_list_next (iter))
{
@@ -330,7 +330,7 @@ gimp_session_info_dock_restore (GimpSessionInfoDock *dock_info,
* gimp_session_info_book_restore() which explains why the dock
* can contain empty dockbooks at all
*/
- if (dock_info && dock_info->books)
+ if (dock_info->books)
{
GList *books;
@@ -360,7 +360,7 @@ gimp_session_info_dock_restore (GimpSessionInfoDock *dock_info,
}
/* if we removed all books again, the dock was destroyed, so bail out */
- if (dock_info && dock_info->books && n_books == 0)
+ if (dock_info->books && n_books == 0)
{
return NULL;
}
diff --git a/app/widgets/gimpuimanager.c b/app/widgets/gimpuimanager.c
index f7d08bb..188ea9f 100644
--- a/app/widgets/gimpuimanager.c
+++ b/app/widgets/gimpuimanager.c
@@ -1252,10 +1252,8 @@ find_widget_under_pointer (GdkWindow *window,
}
/* We return (x, y) relative to the allocation of event_widget. */
- if (x)
- *x = child_loc.x;
- if (y)
- *y = child_loc.y;
+ *x = child_loc.x;
+ *y = child_loc.y;
return event_widget;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]