Some cleanups Removed useless prototype and renamed object typecast functions declaration macro.
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
diff --git a/include/git2/oid.h b/include/git2/oid.h
index 288e90b..b20bb22 100644
--- a/include/git2/oid.h
+++ b/include/git2/oid.h
@@ -145,15 +145,6 @@ GIT_EXTERN(void) git_oid_cpy(git_oid *out, const git_oid *src);
* @param b second oid structure.
* @return <0, 0, >0 if a < b, a == b, a > b.
*/
-GIT_EXTERN(int) git_oid_compare(const git_oid *oid_a, const git_oid *oid_b);
-
-/**
- * Compare two oid structures.
- *
- * @param a first oid structure.
- * @param b second oid structure.
- * @return <0, 0, >0 if a < b, a == b, a > b.
- */
GIT_EXTERN(int) git_oid_cmp(const git_oid *a, const git_oid *b);
/**
diff --git a/src/blob.c b/src/blob.c
index d656576..25ea0df 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -15,7 +15,7 @@
#include "filter.h"
#include "buf_text.h"
-GIT_OBJ_WRAPPER(git_blob, GIT_OBJ_BLOB)
+GIT_OBJECT__TYPED_FUNCTIONS(git_blob, GIT_OBJ_BLOB)
const void *git_blob_rawcontent(const git_blob *blob)
{
diff --git a/src/object.h b/src/object.h
index 906d407..7b25fc3 100644
--- a/src/object.h
+++ b/src/object.h
@@ -28,7 +28,7 @@ int git_oid__parse(git_oid *oid, const char **buffer_out, const char *buffer_end
void git_oid__writebuf(git_buf *buf, const char *header, const git_oid *oid);
-#define GIT_OBJ_WRAPPER(TYPE,OBJTYPE) \
+#define GIT_OBJECT__TYPED_FUNCTIONS(TYPE,OBJTYPE) \
int TYPE##_lookup(TYPE **out, git_repository *repo, const git_oid *id) { \
return git_object_lookup((git_object **)out, repo, id, OBJTYPE); } \
int TYPE##_lookup_prefix(TYPE **out, git_repository *repo, const git_oid *id, size_t len) { \
diff --git a/src/tag.c b/src/tag.c
index ad3a8fd..a0ecce1 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -15,7 +15,7 @@
#include "git2/signature.h"
#include "git2/odb_backend.h"
-GIT_OBJ_WRAPPER(git_tag, GIT_OBJ_TAG)
+GIT_OBJECT__TYPED_FUNCTIONS(git_tag, GIT_OBJ_TAG)
void git_tag__free(void *_tag)
{
diff --git a/src/tree.c b/src/tree.c
index 67c9a06..0a94aec 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -11,7 +11,7 @@
#include "git2/repository.h"
#include "git2/object.h"
-GIT_OBJ_WRAPPER(git_tree, GIT_OBJ_TREE)
+GIT_OBJECT__TYPED_FUNCTIONS(git_tree, GIT_OBJ_TREE)
#define DEFAULT_TREE_SIZE 16
#define MAX_FILEMODE_BYTES 6