diff options
author | Russell Belfer <rb@github.com> | 2012-11-27 15:00:49 -0800 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-11-27 15:00:49 -0800 |
commit | c3fb7d04edecb68f0307dfaa48a311f0f72db90e (patch) | |
tree | 81e5424275d91ca002ef17aa5b1bc2c3fba2d07c /include/git2 | |
parent | f984d97b2208b48a6aec8877d0af357cca0c637d (diff) | |
download | libgit2-c3fb7d04edecb68f0307dfaa48a311f0f72db90e.tar.gz |
Make git_odb_foreach_cb take const param
This makes the first OID param of the ODB callback a const pointer
and also propogates that change all the way to the backends.
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/odb.h | 5 | ||||
-rw-r--r-- | include/git2/odb_backend.h | 11 |
2 files changed, 9 insertions, 7 deletions
diff --git a/include/git2/odb.h b/include/git2/odb.h index d41c2fb52..f2633d11c 100644 --- a/include/git2/odb.h +++ b/include/git2/odb.h @@ -23,11 +23,6 @@ GIT_BEGIN_DECL /** - * Function type for callbacks from git_odb_foreach. - */ -typedef int (*git_odb_foreach_cb)(git_oid *id, void *payload); - -/** * Create a new object database with no backends. * * Before the ODB can be used for read/writing, a custom database diff --git a/include/git2/odb_backend.h b/include/git2/odb_backend.h index 694803efd..04658f9b3 100644 --- a/include/git2/odb_backend.h +++ b/include/git2/odb_backend.h @@ -24,7 +24,14 @@ GIT_BEGIN_DECL struct git_odb_stream; struct git_odb_writepack; -/** An instance for a custom backend */ +/** + * Function type for callbacks from git_odb_foreach. + */ +typedef int (*git_odb_foreach_cb)(const git_oid *id, void *payload); + +/** + * An instance for a custom backend + */ struct git_odb_backend { git_odb *odb; @@ -79,7 +86,7 @@ struct git_odb_backend { int (* foreach)( struct git_odb_backend *, - int (*cb)(git_oid *oid, void *payload), + git_odb_foreach_cb cb, void *payload); int (* writepack)( |