Skip to content

Commit

Permalink
clang: suppress a warning
Browse files Browse the repository at this point in the history
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)
                                       ^
  • Loading branch information
kou committed Jun 11, 2013
1 parent 7b686b0 commit 8f3e75b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/pat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down

0 comments on commit 8f3e75b

Please sign in to comment.