[libgit2-glib] Explicitly cast enum values
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] Explicitly cast enum values
- Date: Sat, 23 Nov 2013 09:24:13 +0000 (UTC)
commit 21df28ecf96e4e855a8b3697da17199d1a024a95
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Sat Nov 23 10:24:02 2013 +0100
Explicitly cast enum values
libgit2-glib/ggit-config-entry.c | 2 +-
libgit2-glib/ggit-config.c | 2 +-
libgit2-glib/ggit-diff-delta.c | 2 +-
libgit2-glib/ggit-merge-tree-options.c | 4 ++--
libgit2-glib/ggit-status-options.c | 2 +-
libgit2-glib/ggit-submodule.c | 10 ++++++----
libgit2-glib/ggit-tree-builder.c | 2 +-
libgit2-glib/ggit-tree-entry.c | 2 +-
libgit2-glib/ggit-tree.c | 2 +-
9 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/libgit2-glib/ggit-config-entry.c b/libgit2-glib/ggit-config-entry.c
index 3dd9ad8..e3ff265 100644
--- a/libgit2-glib/ggit-config-entry.c
+++ b/libgit2-glib/ggit-config-entry.c
@@ -125,7 +125,7 @@ ggit_config_entry_get_level (GgitConfigEntry *entry)
{
g_return_val_if_fail (entry != NULL, 0);
- return entry->entry->level;
+ return (GgitConfigLevel)entry->entry->level;
}
/* ex:set ts=8 noet: */
diff --git a/libgit2-glib/ggit-config.c b/libgit2-glib/ggit-config.c
index c934bc7..69239ce 100644
--- a/libgit2-glib/ggit-config.c
+++ b/libgit2-glib/ggit-config.c
@@ -253,7 +253,7 @@ ggit_config_add_file (GgitConfig *config,
path = g_file_get_path (file);
ret = git_config_add_file_ondisk (_ggit_native_get (config),
path,
- level,
+ (git_config_level_t)level,
force);
g_free (path);
diff --git a/libgit2-glib/ggit-diff-delta.c b/libgit2-glib/ggit-diff-delta.c
index 0031ef2..5c9b5e8 100644
--- a/libgit2-glib/ggit-diff-delta.c
+++ b/libgit2-glib/ggit-diff-delta.c
@@ -49,7 +49,7 @@ _ggit_diff_delta_wrap (const git_diff_delta *delta)
gdelta->ref_count = 1;
gdelta->old_file = _ggit_diff_file_wrap (&delta->old_file);
gdelta->new_file = _ggit_diff_file_wrap (&delta->new_file);
- gdelta->status = delta->status;
+ gdelta->status = (GgitDeltaType)delta->status;
gdelta->similarity = delta->similarity;
gdelta->flags = delta->flags;
diff --git a/libgit2-glib/ggit-merge-tree-options.c b/libgit2-glib/ggit-merge-tree-options.c
index fd036f6..2afbaaf 100644
--- a/libgit2-glib/ggit-merge-tree-options.c
+++ b/libgit2-glib/ggit-merge-tree-options.c
@@ -104,11 +104,11 @@ ggit_merge_tree_options_new (GgitMergeTreeFlags flags,
merge_options = g_slice_new (GgitMergeTreeOptions);
- gmerge_options.flags = flags;
+ gmerge_options.flags = (git_merge_tree_flag_t)flags;
gmerge_options.rename_threshold = rename_threshold;
gmerge_options.target_limit = target_limit;
gmerge_options.metric = _ggit_diff_similarity_metric_get_similarity_metric (metric);
- gmerge_options.automerge_flags = automerge_mode;
+ gmerge_options.automerge_flags = (git_merge_automerge_flags)automerge_mode;
merge_options->merge_options = gmerge_options;
diff --git a/libgit2-glib/ggit-status-options.c b/libgit2-glib/ggit-status-options.c
index 4208936..ebb8bf5 100644
--- a/libgit2-glib/ggit-status-options.c
+++ b/libgit2-glib/ggit-status-options.c
@@ -109,7 +109,7 @@ ggit_status_options_new (GgitStatusOption options,
status_options = g_slice_new (GgitStatusOptions);
gstatus_options.flags = options;
- gstatus_options.show = show;
+ gstatus_options.show = (git_status_show_t)show;
ggit_utils_get_git_strarray_from_str_array (pathspec,
&gstatus_options.pathspec);
diff --git a/libgit2-glib/ggit-submodule.c b/libgit2-glib/ggit-submodule.c
index 7afed55..d20fe04 100644
--- a/libgit2-glib/ggit-submodule.c
+++ b/libgit2-glib/ggit-submodule.c
@@ -300,7 +300,7 @@ ggit_submodule_get_ignore (GgitSubmodule *submodule)
{
g_return_val_if_fail (submodule != NULL, 0);
- return git_submodule_ignore (submodule->submodule);
+ return (GgitSubmoduleIgnore)git_submodule_ignore (submodule->submodule);
}
/**
@@ -325,7 +325,8 @@ ggit_submodule_set_ignore (GgitSubmodule *submodule,
{
g_return_val_if_fail (submodule != NULL, 0);
- return git_submodule_set_ignore (submodule->submodule, ignore);
+ return (GgitSubmoduleIgnore)git_submodule_set_ignore (submodule->submodule,
+ (git_submodule_ignore_t)ignore);
}
/**
@@ -341,7 +342,7 @@ ggit_submodule_get_update (GgitSubmodule *submodule)
{
g_return_val_if_fail (submodule != NULL, 0);
- return git_submodule_update (submodule->submodule);
+ return (GgitSubmoduleUpdate)git_submodule_update (submodule->submodule);
}
/**
@@ -364,7 +365,8 @@ ggit_submodule_set_update (GgitSubmodule *submodule,
{
g_return_val_if_fail (submodule != NULL, 0);
- return git_submodule_set_update (submodule->submodule, update);
+ return (GgitSubmoduleUpdate)git_submodule_set_update (submodule->submodule,
+ (git_submodule_update_t)update);
}
/**
diff --git a/libgit2-glib/ggit-tree-builder.c b/libgit2-glib/ggit-tree-builder.c
index bf7f6c5..f3cae45 100644
--- a/libgit2-glib/ggit-tree-builder.c
+++ b/libgit2-glib/ggit-tree-builder.c
@@ -238,7 +238,7 @@ ggit_tree_builder_insert (GgitTreeBuilder *builder,
_ggit_native_get (builder),
filename,
_ggit_oid_get_oid (oid),
- file_mode);
+ (git_filemode_t)file_mode);
if (ret != GIT_OK)
{
diff --git a/libgit2-glib/ggit-tree-entry.c b/libgit2-glib/ggit-tree-entry.c
index e4e0497..78c0827 100644
--- a/libgit2-glib/ggit-tree-entry.c
+++ b/libgit2-glib/ggit-tree-entry.c
@@ -104,7 +104,7 @@ ggit_tree_entry_get_file_mode (GgitTreeEntry *entry)
{
g_return_val_if_fail (entry != NULL, 0);
- return git_tree_entry_filemode (entry->entry);
+ return (GgitFileMode)git_tree_entry_filemode (entry->entry);
}
/**
diff --git a/libgit2-glib/ggit-tree.c b/libgit2-glib/ggit-tree.c
index 60f40d8..7b6250e 100644
--- a/libgit2-glib/ggit-tree.c
+++ b/libgit2-glib/ggit-tree.c
@@ -255,7 +255,7 @@ ggit_tree_walk (GgitTree *tree,
info.user_data = user_data;
ret = git_tree_walk (_ggit_native_get (tree),
- mode,
+ (git_treewalk_mode)mode,
(git_treewalk_cb)walk_callback_wrapper,
&info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]