[Groonga-commit] groonga/groonga at a8e6947 [master] Use grn_bool for boolean variable

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Nov 17 21:19:44 JST 2014


Kouhei Sutou	2014-11-17 21:19:44 +0900 (Mon, 17 Nov 2014)

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

  Message:
    Use grn_bool for boolean variable

  Modified files:
    lib/grn_token_cursor.h
    lib/token_cursor.c

  Modified: lib/grn_token_cursor.h (+1 -1)
===================================================================
--- lib/grn_token_cursor.h    2014-11-17 16:32:16 +0900 (bd098d6)
+++ lib/grn_token_cursor.h    2014-11-17 21:19:44 +0900 (452a733)
@@ -47,7 +47,7 @@ typedef struct {
   int32_t pos;
   grn_token_mode mode;
   grn_token_status status;
-  uint8_t force_prefix;
+  grn_bool force_prefix;
   grn_obj_flags table_flags;
   grn_encoding encoding;
   grn_obj *tokenizer;

  Modified: lib/token_cursor.c (+4 -4)
===================================================================
--- lib/token_cursor.c    2014-11-17 16:32:16 +0900 (1ffa726)
+++ lib/token_cursor.c    2014-11-17 21:19:44 +0900 (ff2135a)
@@ -72,7 +72,7 @@ grn_token_cursor_open(grn_ctx *ctx, grn_obj *table,
   token_cursor->curr_size = 0;
   token_cursor->pos = -1;
   token_cursor->status = GRN_TOKEN_DOING;
-  token_cursor->force_prefix = 0;
+  token_cursor->force_prefix = GRN_FALSE;
   if (tokenizer) {
     grn_obj str_, flags_, mode_;
     GRN_TEXT_INIT(&str_, GRN_OBJ_DO_SHALLOW_COPY);
@@ -197,7 +197,7 @@ grn_token_cursor_next(grn_ctx *ctx, grn_token_cursor *token_cursor)
          (token_cursor->mode == GRN_TOKEN_GET &&
           (status & GRN_TOKENIZER_TOKEN_REACH_END)))
         ? GRN_TOKEN_DONE : GRN_TOKEN_DOING;
-      token_cursor->force_prefix = 0;
+      token_cursor->force_prefix = GRN_FALSE;
 #define SKIP_FLAGS \
       (GRN_TOKENIZER_TOKEN_SKIP | GRN_TOKENIZER_TOKEN_SKIP_WITH_POSITION)
       if (status & SKIP_FLAGS) {
@@ -212,7 +212,7 @@ grn_token_cursor_next(grn_ctx *ctx, grn_token_cursor *token_cursor)
         }
       }
 #undef SKIP_FLAGS
-      if (status & GRN_TOKENIZER_TOKEN_FORCE_PREFIX) { token_cursor->force_prefix = 1; }
+      if (status & GRN_TOKENIZER_TOKEN_FORCE_PREFIX) { token_cursor->force_prefix = GRN_TRUE; }
       if (token_cursor->curr_size == 0) {
         char tokenizer_name[GRN_TABLE_MAX_KEY_SIZE];
         int tokenizer_name_length;
@@ -238,7 +238,7 @@ grn_token_cursor_next(grn_ctx *ctx, grn_token_cursor *token_cursor)
         if (status & GRN_TOKENIZER_TOKEN_OVERLAP) {
           if (token_cursor->mode == GRN_TOKEN_GET) { token_cursor->pos++; continue; }
         } else {
-          if (status & GRN_TOKENIZER_TOKEN_LAST) { token_cursor->force_prefix = 1; }
+          if (status & GRN_TOKENIZER_TOKEN_LAST) { token_cursor->force_prefix = GRN_TRUE; }
         }
       }
     } else {
-------------- next part --------------
HTML����������������������������...
下載 



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