buffer: inline `git_buf_cstr`
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
diff --git a/src/buffer.c b/src/buffer.c
index 295b87e..27e20d5 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -175,11 +175,6 @@ int git_buf_printf(git_buf *buf, const char *format, ...)
return GIT_SUCCESS;
}
-const char *git_buf_cstr(git_buf *buf)
-{
- return buf->ptr;
-}
-
void git_buf_copy_cstr(char *data, size_t datasize, const git_buf *buf)
{
size_t copylen;
diff --git a/src/buffer.h b/src/buffer.h
index 30658f3..52fd9a6 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -92,12 +92,17 @@ int git_buf_join(git_buf *buf, char separator, const char *str_a, const char *st
* Join two strings as paths, inserting a slash between as needed.
* @return error code or GIT_SUCCESS
*/
-GIT_INLINE (int) git_buf_joinpath(git_buf *buf, const char *a, const char *b)
+GIT_INLINE(int) git_buf_joinpath(git_buf *buf, const char *a, const char *b)
{
return git_buf_join(buf, '/', a, b);
}
-const char *git_buf_cstr(git_buf *buf);
+GIT_INLINE(const char *) git_buf_cstr(git_buf *buf)
+{
+ return buf->ptr;
+}
+
+
void git_buf_copy_cstr(char *data, size_t datasize, const git_buf *buf);
#define git_buf_PUTS(buf, str) git_buf_put(buf, str, sizeof(str) - 1)