aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-10-29 00:24:12 +0200
committerPřemysl Eric Janouch <p@janouch.name>2021-10-29 00:24:12 +0200
commitee7be81434bebee566150817fedb600658fc07ed (patch)
tree2059a7f7a75571e778720497e0a6dfc9fbc44637
parent0c5c680f626b2a481abfa7a5eb2a21b67202dd0f (diff)
downloadlogdiag-ee7be81434bebee566150817fedb600658fc07ed.tar.gz
logdiag-ee7be81434bebee566150817fedb600658fc07ed.tar.xz
logdiag-ee7be81434bebee566150817fedb600658fc07ed.zip
Clean up
-rw-r--r--liblogdiag/ld-diagram-view.c2
-rw-r--r--liblogdiag/ld-lua.c3
-rw-r--r--src/ld-window-main.c16
3 files changed, 9 insertions, 12 deletions
diff --git a/liblogdiag/ld-diagram-view.c b/liblogdiag/ld-diagram-view.c
index 3ff7599..5905388 100644
--- a/liblogdiag/ld-diagram-view.c
+++ b/liblogdiag/ld-diagram-view.c
@@ -1315,7 +1315,7 @@ point_to_line_segment_distance
/* The projection is beyond the line segment. */
if (u < 0.)
return ld_point_distance (point, p1->x, p1->y);
- else if (u > 1.)
+ if (u > 1.)
return ld_point_distance (point, p2->x, p2->y);
/* The projection is on the line segment. */
diff --git a/liblogdiag/ld-lua.c b/liblogdiag/ld-lua.c
index 32c641b..4998320 100644
--- a/liblogdiag/ld-lua.c
+++ b/liblogdiag/ld-lua.c
@@ -250,8 +250,7 @@ ld_lua_alloc (void *ud, void *ptr, size_t osize, size_t nsize)
g_free (ptr);
return NULL;
}
- else
- return g_try_realloc (ptr, nsize);
+ return g_try_realloc (ptr, nsize);
}
/**
diff --git a/src/ld-window-main.c b/src/ld-window-main.c
index 1df9825..6e97996 100644
--- a/src/ld-window-main.c
+++ b/src/ld-window-main.c
@@ -618,8 +618,8 @@ diagram_get_name (LdWindowMain *self)
if (self->priv->filename)
return g_filename_display_basename (self->priv->filename);
- else
- return g_strdup (_("Unsaved Diagram"));
+
+ return g_strdup (_("Unsaved Diagram"));
}
/*
@@ -698,12 +698,10 @@ diagram_save (LdWindowMain *self, GtkWindow *dialog_parent,
gtk_widget_destroy (message_dialog);
return FALSE;
}
- else
- {
- ld_diagram_set_modified (self->priv->diagram, FALSE);
- update_title (self);
- return TRUE;
- }
+
+ ld_diagram_set_modified (self->priv->diagram, FALSE);
+ update_title (self);
+ return TRUE;
}
/*
@@ -1179,11 +1177,11 @@ static gboolean
on_action_about_activate_link (GtkAboutDialog *dialog, gchar *uri,
LdWindowMain *self)
{
+#ifdef G_OS_WIN32
GdkWindow *window;
window = gtk_widget_get_window (GTK_WIDGET (self));
-#ifdef G_OS_WIN32
/* gtk_show_uri() on Windows XP fails, due to trying to establish
* an SSL connection, so let's first try to not do that on Windows.
* `cmd.exe /c start "" ...` would pop up a command line window,