Commit 45c53eb6cb9ba8ae8bce7d5a70b30b458b7db7e2

Russell Belfer 2014-05-08T10:46:04

Use unsigned type for APIs with opt flag mask

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;