[Groonga-commit] groonga/groonga at e68275e [master] clang: suppress warnings

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Jun 11 15:53:26 JST 2013


Kouhei Sutou	2013-06-11 15:53:26 +0900 (Tue, 11 Jun 2013)

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

  Message:
    clang: suppress warnings
    
    Add missing casts.
    
        lib/token.c:74:30: warning: passing 'byte *'
              (aka 'unsigned char *') to parameter of type 'const char *' converts
              between pointers to integer types with different sign [-Wpointer-sign]
                                     tokenizer->curr, 0,
                                     ^~~~~~~~~~~~~~~
        include/groonga/tokenizer.h:183:61: note:
              passing argument to parameter 'str_ptr' here
          ...const char *str_ptr, unsigned int str_length,
                         ^
        lib/token.c:84:30: warning: passing 'byte *'
              (aka 'unsigned char *') to parameter of type 'const char *' converts
              between pointers to integer types with different sign [-Wpointer-sign]
                                     tokenizer->curr, tokenizer->unit,
                                     ^~~~~~~~~~~~~~~
        include/groonga/tokenizer.h:183:61: note:
              passing argument to parameter 'str_ptr' here
          ...const char *str_ptr, unsigned int str_length,
                         ^

  Modified files:
    lib/token.c

  Modified: lib/token.c (+2 -2)
===================================================================
--- lib/token.c    2013-06-11 15:51:41 +0900 (df6e063)
+++ lib/token.c    2013-06-11 15:53:26 +0900 (2488d13)
@@ -71,7 +71,7 @@ uvector_next(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
   byte *p = tokenizer->curr + tokenizer->unit;
   if (tokenizer->tail < p) {
     grn_tokenizer_token_push(ctx, &(tokenizer->token),
-                             tokenizer->curr, 0,
+                             (const char *)tokenizer->curr, 0,
                              GRN_TOKENIZER_TOKEN_LAST);
   } else {
     grn_tokenizer_status status;
@@ -81,7 +81,7 @@ uvector_next(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
       status = GRN_TOKENIZER_TOKEN_CONTINUE;
     }
     grn_tokenizer_token_push(ctx, &(tokenizer->token),
-                             tokenizer->curr, tokenizer->unit,
+                             (const char *)tokenizer->curr, tokenizer->unit,
                              status);
     tokenizer->curr = p;
   }
-------------- next part --------------
HTML����������������������������...
下载 



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