summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-repo.h
diff options
context:
space:
mode:
authorDan Nicholson <nicholson@endlessm.com>2020-04-30 14:28:20 -0600
committerDan Nicholson <nicholson@endlessm.com>2020-04-30 15:13:31 -0600
commitdc69f56de6dab66f7bb4fe66aa203e84efa9676c (patch)
treee99e81915b631d8b7dc4d218e3f29c5f12a01e58 /src/libostree/ostree-repo.h
parent240f6d3ac61276011014c7bcc855f21901026c66 (diff)
downloadostree-dc69f56de6dab66f7bb4fe66aa203e84efa9676c.tar.gz
lib: Coerce flags enums to GIR bitfields
The GI scanner decides if an `enum` is really a `bitfield` if it finds any values that have left shifts. With an `enumeration`, the introspecting language may error or convert to a different type if the user tries to combine values. Change all Flags `enum`s to use left-shifted values so that they're represented as `bitfield`s in the GIR. The primary bug here is that you can't combine `REFS_ONLY` and `NO_PRUNE` when calling `OSTree.Repo.prune()` from an introspected language. This is an IABI break since the typelib will change from `enumeration` to `bitfield`. `OstreeRepoImportFlags` is internal but the change is included here to prepare for a subsequent name that would require bit shifting to operate correctly as a flag.
Diffstat (limited to 'src/libostree/ostree-repo.h')
-rw-r--r--src/libostree/ostree-repo.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libostree/ostree-repo.h b/src/libostree/ostree-repo.h
index 1027ac77..e28af29c 100644
--- a/src/libostree/ostree-repo.h
+++ b/src/libostree/ostree-repo.h
@@ -1174,9 +1174,9 @@ void ostree_repo_commit_traverse_iter_cleanup (void *p);
* @OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY: Do not traverse individual commit objects, only follow refs
*/
typedef enum {
- OSTREE_REPO_PRUNE_FLAGS_NONE,
- OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE,
- OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY
+ OSTREE_REPO_PRUNE_FLAGS_NONE = 0,
+ OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE = (1 << 0),
+ OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY = (1 << 1),
} OstreeRepoPruneFlags;
_OSTREE_PUBLIC