[Groonga-commit] groonga/groonga at ac6c758 [master] grn_output_map_open: change nelements mean

Zurück zum Archiv-Index

Kouhei Sutou null+****@clear*****
Mon May 26 11:15:59 JST 2014


Kouhei Sutou	2014-05-26 11:15:59 +0900 (Mon, 26 May 2014)

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

  Message:
    grn_output_map_open: change nelements mean
    
    It is incompatible change but some of codes in Groonga don't use the
    current behavior correctly. So this incompatible change isn't a
    problem.
    
    Before: nelements is sum of the number of keys and the number of values.
    
    After: nelements is the number of elements (= the number of keys or
    the number of values).

  Modified files:
    lib/output.c
    lib/proc.c

  Modified: lib/output.c (+1 -1)
===================================================================
--- lib/output.c    2014-05-26 11:06:19 +0900 (518d6b9)
+++ lib/output.c    2014-05-26 11:15:59 +0900 (855c65b)
@@ -154,7 +154,7 @@ grn_output_map_open(grn_ctx *ctx, grn_obj *outbuf, grn_content_type output_type,
               nelements,
               name);
     }
-    msgpack_pack_map(&ctx->impl->msgpacker, nelements / 2);
+    msgpack_pack_map(&ctx->impl->msgpacker, nelements);
 #endif
     break;
   case GRN_CONTENT_NONE:

  Modified: lib/proc.c (+4 -4)
===================================================================
--- lib/proc.c    2014-05-26 11:06:19 +0900 (0452872)
+++ lib/proc.c    2014-05-26 11:15:59 +0900 (2a48b76)
@@ -1012,7 +1012,7 @@ proc_status(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
   grn_timeval_now(ctx, &now);
   cache = grn_cache_current_get(ctx);
   grn_cache_get_statistics(ctx, cache, &statistics);
-  GRN_OUTPUT_MAP_OPEN("RESULT", 18);
+  GRN_OUTPUT_MAP_OPEN("RESULT", 9);
   GRN_OUTPUT_CSTR("alloc_count");
   GRN_OUTPUT_INT32(grn_alloc_count());
   GRN_OUTPUT_CSTR("starttime");
@@ -2813,7 +2813,7 @@ proc_check(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
               a++;
             }
           }
-          GRN_OUTPUT_MAP_OPEN("SUMMARY", 8);
+          GRN_OUTPUT_MAP_OPEN("SUMMARY", 12);
           GRN_OUTPUT_CSTR("flags");
           grn_itoh(h->flags, buf, 8);
           GRN_OUTPUT_STR(buf, 8);
@@ -3020,7 +3020,7 @@ proc_normalize(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data
                                  normalizer, flags);
     grn_obj_unlink(ctx, normalizer);
 
-    GRN_OUTPUT_MAP_OPEN("RESULT", 2);
+    GRN_OUTPUT_MAP_OPEN("RESULT", 3);
     {
       const char *normalized;
 
@@ -3331,7 +3331,7 @@ dump_proc_name_by_proc_type(grn_ctx *ctx, grn_proc_type target_proc_type)
 
         proc = GRN_PTR_VALUE_AT(&target_procs, i);
         name_size = grn_obj_name(ctx, proc, name, GRN_TABLE_MAX_KEY_SIZE);
-        GRN_OUTPUT_MAP_OPEN("TOKENIZER", 2);
+        GRN_OUTPUT_MAP_OPEN("TOKENIZER", 1);
         GRN_OUTPUT_CSTR("name");
         GRN_OUTPUT_STR(name, name_size);
         GRN_OUTPUT_MAP_CLOSE();
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index