summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-02-20 14:27:10 -0800
committerRussell Belfer <rb@github.com>2014-02-20 14:27:10 -0800
commit72556cc63ba93a187589921c6008caf92686ea9c (patch)
tree441873fde7a3ccc7f8fba11a8555641dba891746 /src
parent68a19ca9ffb685123038a8d16c0a59845f147778 (diff)
downloadlibgit2-72556cc63ba93a187589921c6008caf92686ea9c.tar.gz
Address PR comments
* Make GIT_INLINE an internal definition so it cannot be used in public headers * Fix language in CONTRIBUTING * Make index caps API use signed instead of unsigned values
Diffstat (limited to 'src')
-rw-r--r--src/array.h2
-rw-r--r--src/bitvec.h2
-rw-r--r--src/common.h7
-rw-r--r--src/index.c4
-rw-r--r--src/merge.c2
-rw-r--r--src/vector.h2
6 files changed, 13 insertions, 6 deletions
diff --git a/src/array.h b/src/array.h
index 1d4e1c224..f8a48722a 100644
--- a/src/array.h
+++ b/src/array.h
@@ -7,7 +7,7 @@
#ifndef INCLUDE_array_h__
#define INCLUDE_array_h__
-#include "util.h"
+#include "common.h"
/*
* Use this to declare a typesafe resizable array of items, a la:
diff --git a/src/bitvec.h b/src/bitvec.h
index fd6f0ccf8..544832d95 100644
--- a/src/bitvec.h
+++ b/src/bitvec.h
@@ -7,7 +7,7 @@
#ifndef INCLUDE_bitvec_h__
#define INCLUDE_bitvec_h__
-#include "util.h"
+#include "common.h"
/*
* This is a silly little fixed length bit vector type that will store
diff --git a/src/common.h b/src/common.h
index e315b5979..d389cf85d 100644
--- a/src/common.h
+++ b/src/common.h
@@ -10,6 +10,13 @@
#include "git2/common.h"
#include "cc-compat.h"
+/** 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
+
#include <assert.h>
#include <errno.h>
#include <limits.h>
diff --git a/src/index.c b/src/index.c
index aa1aebf8a..e0c0022e1 100644
--- a/src/index.c
+++ b/src/index.c
@@ -438,7 +438,7 @@ static int create_index_error(int error, const char *msg)
return error;
}
-int git_index_set_caps(git_index *index, unsigned int caps)
+int git_index_set_caps(git_index *index, int caps)
{
unsigned int old_ignore_case;
@@ -474,7 +474,7 @@ int git_index_set_caps(git_index *index, unsigned int caps)
return 0;
}
-unsigned int git_index_caps(const git_index *index)
+int git_index_caps(const git_index *index)
{
return ((index->ignore_case ? GIT_INDEXCAP_IGNORE_CASE : 0) |
(index->distrust_filemode ? GIT_INDEXCAP_NO_FILEMODE : 0) |
diff --git a/src/merge.c b/src/merge.c
index 97c147920..12ff1c91c 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -2364,7 +2364,7 @@ done:
int git_merge__indexes(git_repository *repo, git_index *index_new)
{
git_index *index_repo = NULL;
- unsigned int index_repo_caps = 0;
+ int index_repo_caps = 0;
git_vector paths = GIT_VECTOR_INIT;
size_t index_conflicts = 0, wd_conflicts = 0, conflicts, i;
char *path;
diff --git a/src/vector.h b/src/vector.h
index f8256853b..682b6ad27 100644
--- a/src/vector.h
+++ b/src/vector.h
@@ -7,7 +7,7 @@
#ifndef INCLUDE_vector_h__
#define INCLUDE_vector_h__
-#include "git2/common.h"
+#include "common.h"
typedef int (*git_vector_cmp)(const void *, const void *);