Use `PRIuSIZE` instead of `%zu` for `size_t` (#9359)

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
This commit is contained in:
Nobuyoshi Nakada 2024-09-25 02:50:33 +09:00 коммит произвёл GitHub
Родитель ec04de7512
Коммит d8966416d0
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 3 добавлений и 3 удалений

4
gc.c
Просмотреть файл

@ -213,7 +213,7 @@ rb_malloc_grow_capa(size_t current, size_t type_size)
new_capacity -= malloc_offset; new_capacity -= malloc_offset;
new_capacity /= type_size; new_capacity /= type_size;
if (current > new_capacity) { if (current > new_capacity) {
rb_bug("rb_malloc_grow_capa: current_capacity=%zu, new_capacity=%zu, malloc_offset=%zu", current, new_capacity, malloc_offset); rb_bug("rb_malloc_grow_capa: current_capacity=%"PRIuSIZE", new_capacity=%"PRIuSIZE", malloc_offset=%"PRIuSIZE"", current, new_capacity, malloc_offset);
} }
RUBY_ASSERT(new_capacity > current); RUBY_ASSERT(new_capacity > current);
return new_capacity; return new_capacity;
@ -13963,7 +13963,7 @@ rb_raw_obj_info_buitin_type(char *const buff, const size_t buff_size, const VALU
{ {
if (rb_shape_obj_too_complex(obj)) { if (rb_shape_obj_too_complex(obj)) {
size_t hash_len = rb_st_table_size(ROBJECT_IV_HASH(obj)); size_t hash_len = rb_st_table_size(ROBJECT_IV_HASH(obj));
APPEND_F("(too_complex) len:%zu", hash_len); APPEND_F("(too_complex) len:%"PRIuSIZE"", hash_len);
} }
else { else {
uint32_t len = ROBJECT_IV_CAPACITY(obj); uint32_t len = ROBJECT_IV_CAPACITY(obj);

Просмотреть файл

@ -4158,7 +4158,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
size_t length = (end - str) + 1; size_t length = (end - str) + 1;
size_t num_match_cache_points = (size_t)msa->num_cache_points * length; size_t num_match_cache_points = (size_t)msa->num_cache_points * length;
#ifdef ONIG_DEBUG_MATCH_CACHE #ifdef ONIG_DEBUG_MATCH_CACHE
fprintf(stderr, "MATCH CACHE: #match cache points = %ld (length = %zu)\n", num_match_cache_points, length); fprintf(stderr, "MATCH CACHE: #match cache points = %"PRIuSIZE" (length = %"PRIuSIZE")\n", num_match_cache_points, length);
#endif #endif
/* Overflow check */ /* Overflow check */
if (num_match_cache_points / length != (size_t)msa->num_cache_points) { if (num_match_cache_points / length != (size_t)msa->num_cache_points) {