mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-08-25 02:47:01 +00:00
Fixed compiler warnings
This commit is contained in:
parent
5fd05b400f
commit
a5728d475c
|
@ -65,7 +65,7 @@ gitg_revision_tree_store_drag_source_iface_init(GtkTreeDragSourceIface *iface)
|
|||
static void
|
||||
gitg_revision_tree_store_finalize(GObject *object)
|
||||
{
|
||||
GitgRevisionTreeStore *self = GITG_REVISION_TREE_STORE(object);
|
||||
//GitgRevisionTreeStore *self = GITG_REVISION_TREE_STORE(object);
|
||||
|
||||
G_OBJECT_CLASS(gitg_revision_tree_store_parent_class)->finalize(object);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <string.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <gio/gio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "gitg-revision-tree-view.h"
|
||||
#include "gitg-revision-tree-store.h"
|
||||
|
@ -42,7 +43,7 @@ static gchar *node_identity(GitgRevisionTreeView *view, GtkTreeIter *iter);
|
|||
G_DEFINE_TYPE_EXTENDED(GitgRevisionTreeView, gitg_revision_tree_view, GTK_TYPE_HPANED, 0,
|
||||
G_IMPLEMENT_INTERFACE(GTK_TYPE_BUILDABLE, gitg_revision_tree_view_buildable_iface_init));
|
||||
|
||||
static GtkBuildableIface parent_iface = { 0, };
|
||||
static GtkBuildableIface parent_iface;
|
||||
|
||||
static void
|
||||
gitg_revision_tree_view_finalize(GObject *object)
|
||||
|
|
|
@ -34,7 +34,7 @@ static void gitg_revision_view_buildable_iface_init(GtkBuildableIface *iface);
|
|||
G_DEFINE_TYPE_EXTENDED(GitgRevisionView, gitg_revision_view, GTK_TYPE_VBOX, 0,
|
||||
G_IMPLEMENT_INTERFACE(GTK_TYPE_BUILDABLE, gitg_revision_view_buildable_iface_init));
|
||||
|
||||
static GtkBuildableIface parent_iface = {0,};
|
||||
static GtkBuildableIface parent_iface;
|
||||
|
||||
static void
|
||||
update_markup(GObject *object)
|
||||
|
@ -247,11 +247,12 @@ update_diff(GitgRevisionView *self, GitgRepository *repository, GitgRevision *re
|
|||
return;
|
||||
|
||||
gchar *hash = gitg_revision_get_sha1(revision);
|
||||
|
||||
gchar *argv[] = {
|
||||
gchar *gitpath = gitg_utils_dot_git_path(gitg_repository_get_path(repository));
|
||||
|
||||
gchar const *argv[] = {
|
||||
"git",
|
||||
"--git-dir",
|
||||
gitg_utils_dot_git_path(gitg_repository_get_path(repository)),
|
||||
gitpath,
|
||||
"show",
|
||||
"--pretty=format:%s%n%n%b",
|
||||
"--encoding=UTF-8",
|
||||
|
@ -262,14 +263,16 @@ update_diff(GitgRevisionView *self, GitgRepository *repository, GitgRevision *re
|
|||
gitg_runner_run(self->priv->diff_runner, argv, NULL);
|
||||
|
||||
g_free(hash);
|
||||
g_free(argv[2]);
|
||||
g_free(gitpath);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
format_date(GitgRevision *revision)
|
||||
{
|
||||
guint64 timestamp = gitg_revision_get_timestamp(revision);
|
||||
char *ptr = ctime((time_t *)×tamp);
|
||||
time_t t = timestamp;
|
||||
|
||||
char *ptr = ctime(&t);
|
||||
|
||||
// Remove newline?
|
||||
ptr[strlen(ptr) - 1] = '\0';
|
||||
|
|
|
@ -260,10 +260,10 @@ gitg_runner_new(guint buffer_size)
|
|||
gboolean
|
||||
gitg_runner_run(GitgRunner *runner, gchar const **argv, GError **error)
|
||||
{
|
||||
g_return_if_fail(GITG_IS_RUNNER(runner));
|
||||
g_return_val_if_fail(GITG_IS_RUNNER(runner), FALSE);
|
||||
|
||||
gint stdout;
|
||||
gboolean ret = g_spawn_async_with_pipes(NULL, argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &(runner->priv->pid), NULL, &stdout, NULL, error);
|
||||
gboolean ret = g_spawn_async_with_pipes(NULL, (gchar **)argv, NULL, G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, &(runner->priv->pid), NULL, &stdout, NULL, error);
|
||||
|
||||
if (!ret)
|
||||
{
|
||||
|
@ -278,13 +278,14 @@ gitg_runner_run(GitgRunner *runner, gchar const **argv, GError **error)
|
|||
g_child_watch_add(runner->priv->pid, runner_io_exit, runner);
|
||||
|
||||
// Emit begin-loading signal
|
||||
g_signal_emit(runner, runner_signals[BEGIN_LOADING], 0);
|
||||
g_signal_emit(runner, runner_signals[BEGIN_LOADING], 0);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
guint
|
||||
gitg_runner_get_buffer_size(GitgRunner *runner)
|
||||
{
|
||||
g_return_if_fail(GITG_IS_RUNNER(runner));
|
||||
g_return_val_if_fail(GITG_IS_RUNNER(runner), 0);
|
||||
return runner->priv->buffer_size;
|
||||
}
|
||||
|
||||
|
@ -294,7 +295,6 @@ gitg_runner_cancel(GitgRunner *runner)
|
|||
g_return_if_fail(GITG_IS_RUNNER(runner));
|
||||
|
||||
g_mutex_lock(runner->priv->mutex);
|
||||
gboolean done = runner->priv->done;
|
||||
runner->priv->done = TRUE;
|
||||
g_mutex_unlock(runner->priv->mutex);
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ static void on_branches_update(GitgRunner *runner, gchar **buffer, GitgWindow *s
|
|||
G_DEFINE_TYPE_EXTENDED(GitgWindow, gitg_window, GTK_TYPE_WINDOW, 0,
|
||||
G_IMPLEMENT_INTERFACE(GTK_TYPE_BUILDABLE, gitg_window_buildable_iface_init));
|
||||
|
||||
static GtkBuildableIface parent_iface = { 0, };
|
||||
static GtkBuildableIface parent_iface;
|
||||
static GtkWindowClass *parent_class = NULL;
|
||||
|
||||
static void
|
||||
|
@ -410,7 +410,9 @@ create_repository(GitgWindow *window, gchar const *path)
|
|||
gchar *curdir = g_get_current_dir();
|
||||
window->priv->repository = gitg_repository_new(curdir);
|
||||
g_free(curdir);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue