[Groonga-commit] groonga/groonga at 8f3e75b [master] clang: suppress a warning

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Tue Jun 11 15:14:03 JST 2013


Kouhei Sutou	2013-06-11 15:14:03 +0900 (Tue, 11 Jun 2013)

  New Revision: 8f3e75b1419f3f083424e0614d182bba88cd0c18
  https://github.com/groonga/groonga/commit/8f3e75b1419f3f083424e0614d182bba88cd0c18

  Message:
    clang: suppress a warning
    
    Use "uint8_t *" for key buffer.
    
        lib/pat.c:2904:36: warning: passing
              'uint8_t [4096]' to parameter of type 'char *' converts between pointers
              to integer types with different sign [-Wpointer-sign]
          byte_len = rk_conv(key, key_len, keybuf, GRN_TABLE_MAX_KEY_SIZE, &state);
                                           ^~~~~~
        lib/pat.c:2780:50: note: passing argument to
              parameter 'buf' here
          ...*str, uint32_t str_len, char *buf, uint32_t buf_size, uint8_t *statep)
                                           ^

  Modified files:
    lib/pat.c

  Modified: lib/pat.c (+3 -2)
===================================================================
--- lib/pat.c    2013-06-11 15:07:56 +0900 (ce7b4e8)
+++ lib/pat.c    2013-06-11 15:14:03 +0900 (bfb04b9)
@@ -2777,12 +2777,13 @@ rk_emit(rk_tree_node *rn, char **str)
 } while (0)
 
 static uint32_t
-rk_conv(const char *str, uint32_t str_len, char *buf, uint32_t buf_size, uint8_t *statep)
+rk_conv(const char *str, uint32_t str_len, uint8_t *buf, uint32_t buf_size, uint8_t *statep)
 {
   uint32_t l;
   uint8_t state = 0;
   rk_tree_node *rn;
-  char *e, *oc = buf, *oe = oc + buf_size;
+  char *e;
+  uint8_t *oc = buf, *oe = oc + buf_size;
   const uint8_t *ic = (uint8_t *)str, *ic_ = ic, *ie = ic + str_len;
   while (ic < ie) {
     if ((rn = rk_lookup(state, *ic))) {
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る