diff options
| author | Vicent Marti <vicent@github.com> | 2014-02-21 01:33:47 +0100 |
|---|---|---|
| committer | Vicent Marti <vicent@github.com> | 2014-02-21 01:33:47 +0100 |
| commit | f83ef56209d9219ea80a142551202862df897426 (patch) | |
| tree | 441873fde7a3ccc7f8fba11a8555641dba891746 /include/git2 | |
| parent | 2dc49ea93c5c320216806089fee579021f3ce9cf (diff) | |
| parent | 72556cc63ba93a187589921c6008caf92686ea9c (diff) | |
| download | libgit2-f83ef56209d9219ea80a142551202862df897426.tar.gz | |
Merge pull request #2129 from arrbee/rb/c89-or-c99
Improve C89 compatibility and clarify use of C99 features
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/common.h | 7 | ||||
| -rw-r--r-- | include/git2/index.h | 12 | ||||
| -rw-r--r-- | include/git2/oid.h | 5 |
3 files changed, 7 insertions, 17 deletions
diff --git a/include/git2/common.h b/include/git2/common.h index dca0c9c21..492715447 100644 --- a/include/git2/common.h +++ b/include/git2/common.h @@ -37,13 +37,6 @@ # define GIT_EXTERN(type) extern type #endif -/** Declare a function as always inlined. */ -#if defined(_MSC_VER) -# define GIT_INLINE(type) static __inline type -#else -# define GIT_INLINE(type) static inline type -#endif - /** Declare a function's takes printf style arguments. */ #ifdef __GNUC__ # define GIT_FORMAT_PRINTF(a,b) __attribute__((format (printf, a, b))) diff --git a/include/git2/index.h b/include/git2/index.h index 4363a3b9b..ae919e133 100644 --- a/include/git2/index.h +++ b/include/git2/index.h @@ -120,10 +120,10 @@ typedef struct git_index_entry { /** Capabilities of system that affect index actions. */ typedef enum { - GIT_INDEXCAP_IGNORE_CASE = 1u, - GIT_INDEXCAP_NO_FILEMODE = 2u, - GIT_INDEXCAP_NO_SYMLINKS = 4u, - GIT_INDEXCAP_FROM_OWNER = ~0u + GIT_INDEXCAP_IGNORE_CASE = 1, + GIT_INDEXCAP_NO_FILEMODE = 2, + GIT_INDEXCAP_NO_SYMLINKS = 4, + GIT_INDEXCAP_FROM_OWNER = -1, } git_indexcap_t; /** Callback for APIs that add/remove/update files matching pathspec */ @@ -206,7 +206,7 @@ GIT_EXTERN(git_repository *) git_index_owner(const git_index *index); * @param index An existing index object * @return A combination of GIT_INDEXCAP values */ -GIT_EXTERN(unsigned int) git_index_caps(const git_index *index); +GIT_EXTERN(int) git_index_caps(const git_index *index); /** * Set index capabilities flags. @@ -219,7 +219,7 @@ GIT_EXTERN(unsigned int) git_index_caps(const git_index *index); * @param caps A combination of GIT_INDEXCAP values * @return 0 on success, -1 on failure */ -GIT_EXTERN(int) git_index_set_caps(git_index *index, unsigned int caps); +GIT_EXTERN(int) git_index_set_caps(git_index *index, int caps); /** * Update the contents of an existing index object in memory by reading diff --git a/include/git2/oid.h b/include/git2/oid.h index 384b656d7..1cfd4e5e2 100644 --- a/include/git2/oid.h +++ b/include/git2/oid.h @@ -167,10 +167,7 @@ GIT_EXTERN(int) git_oid_cmp(const git_oid *a, const git_oid *b); * @param b second oid structure. * @return true if equal, false otherwise */ -GIT_INLINE(int) git_oid_equal(const git_oid *a, const git_oid *b) -{ - return !git_oid_cmp(a, b); -} +GIT_EXTERN(int) git_oid_equal(const git_oid *a, const git_oid *b); /** * Compare the first 'len' hexadecimal characters (packets of 4 bits) |
