aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2015-01-18 15:45:20 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2015-01-19 00:25:41 +0100
commit5079d22319930f47647d1ed9507ad07ec0b922d0 (patch)
tree4066dc439ad7edda9e482e82f5dee14627234f78 /src
parent6b0750a000900d2ff775e6792797d64174e509c1 (diff)
downloadsds-5079d22319930f47647d1ed9507ad07ec0b922d0.tar.xz
test.c: Make test_list static const, fix oldfree type
Diffstat (limited to 'src')
-rw-r--r--src/test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test.c b/src/test.c
index 3d71f6f..d2ad304 100644
--- a/src/test.c
+++ b/src/test.c
@@ -27,7 +27,7 @@ bool sdsIncrLen_content (void);
bool sdsIncrLen_len (void);
bool sdsIncrLen_free (void);
-struct test test_list [] = {
+static const struct test test_list [] = {
{ "create a string and obtain the length", check_string_length },
{ "create a string with specified length", create_with_length },
{ "string concatenation", string_concat },
@@ -216,7 +216,7 @@ sdsIncrLen_free (void) {
_sds_cleanup_ sds x = sdsnew("0");
x = sdsMakeRoomFor(x, 1);
struct sdshdr *sh = (void*) (x-(sizeof(struct sdshdr)));
- int oldfree = sh->free;
+ size_t oldfree = sh->free;
x[1] = '1';
sdsIncrLen(x, 1);
return (sh->free == oldfree-1);