From 13224ea4aad9a1b3c9cc4c992ceaea9af623e047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicent=20Mart=C3=AD?= Date: Mon, 27 Feb 2012 04:28:31 +0100 Subject: buffer: Unify `git_fbuffer` and `git_buf` This makes so much sense that I can't believe it hasn't been done before. Kill the old `git_fbuffer` and read files straight into `git_buf` objects. Also: In order to fully support 4GB files in 32-bit systems, the `git_buf` implementation has been changed from using `ssize_t` for storage and storing negative values on allocation failure, to using `size_t` and changing the buffer pointer to a magical pointer on allocation failure. Hopefully this won't break anything. --- tests-clar/core/buffer.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests-clar/core/buffer.c') diff --git a/tests-clar/core/buffer.c b/tests-clar/core/buffer.c index 740cd857..870525b3 100644 --- a/tests-clar/core/buffer.c +++ b/tests-clar/core/buffer.c @@ -218,8 +218,8 @@ check_buf_append( const char* data_a, const char* data_b, const char* expected_data, - ssize_t expected_size, - ssize_t expected_asize) + size_t expected_size, + size_t expected_asize) { git_buf tgt = GIT_BUF_INIT; @@ -371,8 +371,8 @@ void test_core_buffer__7(void) git_buf_attach(&a, b, 0); cl_assert_strequal(fun, a.ptr); - cl_assert(a.size == (ssize_t)strlen(fun)); - cl_assert(a.asize == (ssize_t)strlen(fun) + 1); + cl_assert(a.size == strlen(fun)); + cl_assert(a.asize == strlen(fun) + 1); git_buf_free(&a); @@ -380,8 +380,8 @@ void test_core_buffer__7(void) git_buf_attach(&a, b, strlen(fun) + 1); cl_assert_strequal(fun, a.ptr); - cl_assert(a.size == (ssize_t)strlen(fun)); - cl_assert(a.asize == (ssize_t)strlen(fun) + 1); + cl_assert(a.size == strlen(fun)); + cl_assert(a.asize == strlen(fun) + 1); git_buf_free(&a); } -- cgit v1.2.1