Use unsigned type for APIs with opt flag mask
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
diff --git a/include/git2/filter.h b/include/git2/filter.h
index 7fd9b7e..e57a67e 100644
--- a/include/git2/filter.h
+++ b/include/git2/filter.h
@@ -80,6 +80,7 @@ typedef struct git_filter_list git_filter_list;
* @param blob The blob to which the filter will be applied (if known)
* @param path Relative path of the file to be filtered
* @param mode Filtering direction (WT->ODB or ODB->WT)
+ * @param options Combination of `git_filter_opt_t` flags
* @return 0 on success (which could still return NULL if no filters are
* needed for the requested file), <0 on error
*/
@@ -89,7 +90,7 @@ GIT_EXTERN(int) git_filter_list_load(
git_blob *blob, /* can be NULL */
const char *path,
git_filter_mode_t mode,
- git_filter_opt_t options);
+ uint32_t options);
/**
* Apply filter list to a data buffer.
diff --git a/include/git2/sys/filter.h b/include/git2/sys/filter.h
index 1b21a9d..6024827 100644
--- a/include/git2/sys/filter.h
+++ b/include/git2/sys/filter.h
@@ -58,7 +58,7 @@ GIT_EXTERN(int) git_filter_list_new(
git_filter_list **out,
git_repository *repo,
git_filter_mode_t mode,
- git_filter_opt_t options);
+ uint32_t options);
/**
* Add a filter to a filter list with the given payload.
@@ -123,9 +123,9 @@ GIT_EXTERN(const git_oid *) git_filter_source_id(const git_filter_source *src);
GIT_EXTERN(git_filter_mode_t) git_filter_source_mode(const git_filter_source *src);
/**
- * Get the git_filter_opt_t options to be applied
+ * Get the combination git_filter_opt_t options to be applied
*/
-GIT_EXTERN(git_filter_opt_t) git_filter_source_options(const git_filter_source *src);
+GIT_EXTERN(uint32_t) git_filter_source_options(const git_filter_source *src);
/*
* struct git_filter
diff --git a/src/filter.c b/src/filter.c
index b0e2b8b..76d7b7b 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -23,7 +23,7 @@ struct git_filter_source {
git_oid oid; /* zero if unknown (which is likely) */
uint16_t filemode; /* zero if unknown */
git_filter_mode_t mode;
- git_filter_opt_t options;
+ uint32_t options;
};
typedef struct {
@@ -359,7 +359,7 @@ git_filter_mode_t git_filter_source_mode(const git_filter_source *src)
return src->mode;
}
-git_filter_opt_t git_filter_source_options(const git_filter_source *src)
+uint32_t git_filter_source_options(const git_filter_source *src)
{
return src->options;
}
@@ -429,7 +429,7 @@ int git_filter_list_new(
git_filter_list **out,
git_repository *repo,
git_filter_mode_t mode,
- git_filter_opt_t options)
+ uint32_t options)
{
git_filter_source src = { 0 };
src.repo = repo;
@@ -445,7 +445,7 @@ int git_filter_list_load(
git_blob *blob, /* can be NULL */
const char *path,
git_filter_mode_t mode,
- git_filter_opt_t options)
+ uint32_t options)
{
int error = 0;
git_filter_list *fl = NULL;