From ab6bcd85b39f34913eccf95e6d3399b7afc5e066 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 12 Jun 2025 18:59:43 +1000 Subject: [PATCH] MDEV-37502: mroonga+clang+debug violates its own setting of compile flags sign-compare Under Debug build this becomes a Werror. Resolved this by changing the grn_mecab_chunk_size_threshold to a ptrdiff_t along with chunked_tokenize_utf8's string_bytes argument so there is no need to case. Reviewer: Jimmy Hu --- storage/mroonga/vendor/groonga/plugins/tokenizers/mecab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/mroonga/vendor/groonga/plugins/tokenizers/mecab.c b/storage/mroonga/vendor/groonga/plugins/tokenizers/mecab.c index cabf2c94e53..1e7216ebc00 100644 --- a/storage/mroonga/vendor/groonga/plugins/tokenizers/mecab.c +++ b/storage/mroonga/vendor/groonga/plugins/tokenizers/mecab.c @@ -37,7 +37,7 @@ static grn_plugin_mutex *sole_mecab_mutex = NULL; static grn_encoding sole_mecab_encoding = GRN_ENC_NONE; static grn_bool grn_mecab_chunked_tokenize_enabled = GRN_FALSE; -static int grn_mecab_chunk_size_threshold = 8192; +static ptrdiff_t grn_mecab_chunk_size_threshold = 8192; typedef struct { mecab_t *mecab; @@ -186,7 +186,7 @@ static grn_bool chunked_tokenize_utf8(grn_ctx *ctx, grn_mecab_tokenizer *tokenizer, const char *string, - unsigned int string_bytes) + ptrdiff_t string_bytes) { const char *chunk_start; const char *current;