Navigation Menu

Skip to content

Commit

Permalink
clang: suppress a warning
Browse files Browse the repository at this point in the history
    lib/db.c:3098:7: warning: initializing 'int *'
          with an expression of type 'uint32_t *' (aka 'unsigned int *') converts
          between pointers to integer types with different sign [-Wpointer-sign]
          GRN_TABLE_EACH(ctx, table2, 0, 0, id, &key, &key_size, &value2, {
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It seems that we should treat all key sizes as unsigned int.
  • Loading branch information
kou committed Jun 10, 2013
1 parent c2bb489 commit 6b167d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/groonga.h
Expand Up @@ -3008,10 +3008,11 @@ GRN_API grn_rc grn_dat_cursor_delete(grn_ctx *ctx, grn_dat_cursor *c,
grn_dat_cursor *_sc = grn_dat_cursor_open(ctx, dat, NULL, 0, NULL, 0, 0, -1, 0);\
if (_sc) {\
grn_id id;\
int *_ks = (key_size);\
unsigned int *_ks = (key_size);\
if (_ks) {\
while ((id = grn_dat_cursor_next(ctx, _sc))) {\
*(_ks) = grn_dat_cursor_get_key(ctx, _sc, (const void **)(key));\
int _ks_raw = grn_dat_cursor_get_key(ctx, _sc, (const void **)(key));\
*(_ks) = (unsigned int)_ks_raw;\
block\
}\
} else {\
Expand Down

0 comments on commit 6b167d2

Please sign in to comment.