diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-11-09 16:12:03 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-11-09 07:20:00 +0000 |
commit | 195a09cc7ff07f3488835ff9cc374e28f03b487e (patch) | |
tree | e3af11566acc5a7bb15a2c436b3d19fcde45e161 | |
parent | 7e8d9f49b39b07f5be4505f83517fd2f9c807020 (diff) | |
download | ruby-195a09cc7ff07f3488835ff9cc374e28f03b487e.tar.gz |
[ruby/digest] Suppress implicit cast down warnings
https://github.com/ruby/digest/commit/2f3505bf3f
-rw-r--r-- | ext/digest/digest.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/digest/digest.h b/ext/digest/digest.h index 8a4c5b7e4e..68a3da5dd2 100644 --- a/ext/digest/digest.h +++ b/ext/digest/digest.h @@ -40,7 +40,8 @@ rb_digest_##name##_update(void *ctx, unsigned char *ptr, size_t size) \ for (; size > stride; size -= stride, ptr += stride) { \ name##_Update(ctx, ptr, stride); \ } \ - if (size > 0) name##_Update(ctx, ptr, size); \ + /* Since size <= stride, size should fit into an unsigned int */ \ + if (size > 0) name##_Update(ctx, ptr, (unsigned int)size); \ } #define DEFINE_FINISH_FUNC_FROM_FINAL(name) \ |