summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
authorRussell Belfer <arrbee@arrbee.com>2012-03-16 15:56:01 -0700
committerRussell Belfer <arrbee@arrbee.com>2012-03-16 15:56:01 -0700
commit0d0fa7c3681e4ef3d0452666a9bc97d4b08391c9 (patch)
tree5e03e03bf9dc2f6125f4fb450cd3239d882b824f /src/buffer.h
parent4cfe2ab60b1e26554b2bf753b06f538cb3475bd0 (diff)
downloadlibgit2-0d0fa7c3681e4ef3d0452666a9bc97d4b08391c9.tar.gz
Convert attr, ignore, mwindow, status to new errors
Also cleaned up some previously converted code that still had little things to polish.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/buffer.h b/src/buffer.h
index d90db4d4a..294ff6961 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -32,7 +32,7 @@ void git_buf_init(git_buf *buf, size_t initial_size);
* If the allocation fails, this will return an error and the buffer
* will be marked as invalid for future operations. The existing
* contents of the buffer will be preserved however.
- * @return GIT_SUCCESS or GIT_ENOMEM on failure
+ * @return 0 on success or -1 on failure
*/
int git_buf_grow(git_buf *buf, size_t target_size);
@@ -63,12 +63,12 @@ void git_buf_attach(git_buf *buf, char *ptr, size_t asize);
bool git_buf_oom(const git_buf *buf);
/*
- * The functions below that return int values, will return GIT_ENOMEM
- * if they fail to expand the git_buf when they are called, otherwise
- * GIT_SUCCESS. Passing a git_buf that has failed an allocation will
- * automatically return GIT_ENOMEM for all further calls. As a result,
- * you can ignore the return code of these functions and call them in a
- * series then just call git_buf_lasterror at the end.
+ * Functions below that return int value error codes will return 0 on
+ * success or -1 on failure (which generally means an allocation failed).
+ * Using a git_buf where the allocation has failed with result in -1 from
+ * all further calls using that buffer. As a result, you can ignore the
+ * return code of these functions and call them in a series then just call
+ * git_buf_oom at the end.
*/
int git_buf_set(git_buf *buf, const char *data, size_t len);
int git_buf_sets(git_buf *buf, const char *string);
@@ -86,7 +86,7 @@ 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
+ * @return 0 on success, -1 on failure
*/
GIT_INLINE(int) git_buf_joinpath(git_buf *buf, const char *a, const char *b)
{