Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Fri, 17 Jun 2022 19:56:21 UTC Commit: b6e5b174e38799f397dff4d61614a8a806bb2338 https://github.com/geany/geany-plugins/commit/b6e5b174e38799f397dff4d61614a8...
Log Message: ----------- git-changebar: Avoid harmless warnings
Both GIT_BLOB_FILTER_OPTIONS_INIT and GIT_DIFF_OPTIONS_INIT initializers lead to GCC emitting -Wmissing-field-initializers warnings. Those are harmless in our case, but still annoying and possible one day hiding a legitimate warning.
So, use the corresponding initialization functions to avoid this.
Modified Paths: -------------- git-changebar/src/gcb-plugin.c
Modified: git-changebar/src/gcb-plugin.c 10 lines changed, 8 insertions(+), 2 deletions(-) =================================================================== @@ -57,6 +57,9 @@ # define git_buf_dispose git_buf_free # define git_error_last giterr_last #endif +#if ! CHECK_LIBGIT2_VERSION(0, 99) +# define git_diff_options_init git_diff_init_options +#endif
GeanyPlugin *geany_plugin; @@ -280,7 +283,9 @@ get_blob_contents (git_buf *out, * previous git_buf_grow() shenanigans. * This code path does the same as the older git_blob_filtered_content() * but with non-deprecated API */ - git_blob_filter_options opts = GIT_BLOB_FILTER_OPTIONS_INIT; + git_blob_filter_options opts; + + git_blob_filter_options_init (&opts, GIT_BLOB_FILTER_OPTIONS_VERSION);
if (check_for_binary_data) opts.flags |= GIT_BLOB_FILTER_CHECK_FOR_BINARY; @@ -741,7 +746,7 @@ diff_buf_to_doc (const git_buf *old_buf, void *payload) { ScintillaObject *sci = doc->editor->sci; - git_diff_options opts = GIT_DIFF_OPTIONS_INIT; + git_diff_options opts; gchar *buf; size_t len; gboolean free_buf = FALSE; @@ -761,6 +766,7 @@ diff_buf_to_doc (const git_buf *old_buf, doc->encoding, "UTF-8", NULL); }
+ git_diff_options_init (&opts, GIT_DIFF_OPTIONS_VERSION); /* no context lines, and no need to bother about binary checks */ opts.context_lines = 0; opts.flags = GIT_DIFF_FORCE_TEXT;
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).