[Groonga-commit] groonga/groonga at d58895c [master] Follow msgpack_packer_write_callback signature change

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Mar 30 20:56:18 JST 2015


Kouhei Sutou	2015-03-30 20:56:18 +0900 (Mon, 30 Mar 2015)

  New Revision: d58895c5d7119c3c64e1e578e0f8ec7ce24c17a5
  https://github.com/groonga/groonga/commit/d58895c5d7119c3c64e1e578e0f8ec7ce24c17a5

  Message:
    Follow msgpack_packer_write_callback signature change
    
    It's a part of MessagePack 1.0.1 support.
    
        ctx.c: In function 'grn_ctx_impl_init':
        ctx.c:558:51: warning: passing argument 3 of 'msgpack_packer_init' from incompatible pointer type
           msgpack_packer_init(&ctx->impl->msgpacker, ctx, grn_msgpack_buffer_write);
                                                           ^
        In file included from /tmp/local/include/msgpack.h:27:0,
                         from grn_ctx_impl.h:30,
                         from ctx.c:23:
        /tmp/local/include/msgpack/pack.h:128:13: note: expected 'msgpack_packer_write' but argument is of type 'int (*)(void *, const char *, unsigned int)'
         inline void msgpack_packer_init(msgpack_packer* pk, void* data, msgpack_packer_write callback)
                     ^
    
    GitHub: #328
    
    Reported by Hiroshi Hatake. Thanks!!!

  Modified files:
    lib/ctx.c

  Modified: lib/ctx.c (+6 -1)
===================================================================
--- lib/ctx.c    2015-03-30 20:52:17 +0900 (ab915d8)
+++ lib/ctx.c    2015-03-30 20:56:18 +0900 (5b87c8c)
@@ -470,8 +470,13 @@ grn_ctx_loader_clear(grn_ctx *ctx)
 #define IMPL_SIZE ((sizeof(struct _grn_ctx_impl) + (grn_pagesize - 1)) & ~(grn_pagesize - 1))
 
 #ifdef GRN_WITH_MESSAGE_PACK
+# if MSGPACK_VERSION_MAJOR < 1
+typedef unsigned int msgpack_size_t;
+# else /* MSGPACK_VERSION_MAJOR < 1 */
+typedef size_t msgpack_size_t;
+# endif /* MSGPACK_VERSION_MAJOR < 1 */
 static int
-grn_msgpack_buffer_write(void *data, const char *buf, unsigned int len)
+grn_msgpack_buffer_write(void *data, const char *buf, msgpack_size_t len)
 {
   grn_ctx *ctx = (grn_ctx *)data;
   return grn_bulk_write(ctx, ctx->impl->outbuf, buf, len);
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index