diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-10-19 14:19:47 +0200 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-10-19 14:19:51 +0200 |
commit | ba42ab2ef8fcf9bf88c0d68414d24c3bb00e00c8 (patch) | |
tree | 2a2fcd81fad6b9f74a8eea16e7e549cfa9bfdcfe /test.c | |
parent | f9596db90bf030dfbd008151521d1c72e1e497e4 (diff) |
Revert privdata in context callbacks to being non-const
Diffstat (limited to 'test.c')
-rw-r--r-- | test.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -195,7 +195,7 @@ static void cleanup() { } static long __test_callback_flags = 0; -static void __test_callback(redisContext *c, const void *privdata) { +static void __test_callback(redisContext *c, void *privdata) { ((void)c); /* Shift to detect execution order */ __test_callback_flags <<= 8; @@ -218,7 +218,7 @@ static void test_nonblocking_connection() { __test_callback_flags = 0; test("Calls command callback when command is issued: "); c = redisConnectNonBlock("127.0.0.1", 6379, NULL); - redisSetCommandCallback(c,__test_callback,(const void*)1); + redisSetCommandCallback(c,__test_callback,(void*)1); redisCommand(c,"PING"); test_cond(__test_callback_flags == 1); redisFree(c); @@ -226,7 +226,7 @@ static void test_nonblocking_connection() { __test_callback_flags = 0; test("Calls disconnect callback on redisDisconnect: "); c = redisConnectNonBlock("127.0.0.1", 6379, NULL); - redisSetDisconnectCallback(c,__test_callback,(const void*)2); + redisSetDisconnectCallback(c,__test_callback,(void*)2); redisDisconnect(c); test_cond(__test_callback_flags == 2); redisFree(c); @@ -234,8 +234,8 @@ static void test_nonblocking_connection() { __test_callback_flags = 0; test("Calls disconnect callback and free callback on redisFree: "); c = redisConnectNonBlock("127.0.0.1", 6379, NULL); - redisSetDisconnectCallback(c,__test_callback,(const void*)2); - redisSetFreeCallback(c,__test_callback,(const void*)4); + redisSetDisconnectCallback(c,__test_callback,(void*)2); + redisSetFreeCallback(c,__test_callback,(void*)4); redisFree(c); test_cond(__test_callback_flags == ((2 << 8) | 4)); @@ -262,9 +262,9 @@ static void test_nonblocking_connection() { wdone = __test_reply_callback_flags = 0; test("Process callbacks in the right sequence: "); c = redisConnectNonBlock("127.0.0.1", 6379, NULL); - redisCommandWithCallback(c,__test_reply_callback,(const void*)1,"PING"); - redisCommandWithCallback(c,__test_reply_callback,(const void*)2,"PING"); - redisCommandWithCallback(c,__test_reply_callback,(const void*)3,"PING"); + redisCommandWithCallback(c,__test_reply_callback,(void*)1,"PING"); + redisCommandWithCallback(c,__test_reply_callback,(void*)2,"PING"); + redisCommandWithCallback(c,__test_reply_callback,(void*)3,"PING"); /* Write output buffer */ while(!wdone) { |