mirror of
https://git.proxmox.com/git/libgit2
synced 2026-01-03 19:59:33 +00:00
Some cleanups
Removed useless prototype and renamed object typecast functions declaration macro.
This commit is contained in:
parent
e4af0f0016
commit
203d5b0e68
@ -138,15 +138,6 @@ GIT_EXTERN(char *) git_oid_tostr(char *out, size_t n, const git_oid *id);
|
||||
*/
|
||||
GIT_EXTERN(void) git_oid_cpy(git_oid *out, const git_oid *src);
|
||||
|
||||
/**
|
||||
* 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_compare(const git_oid *oid_a, const git_oid *oid_b);
|
||||
|
||||
/**
|
||||
* Compare two oid structures.
|
||||
*
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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) { \
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user