Skip to content

Commit d896641

Browse files
nobuk0kubun
andauthored
Use PRIuSIZE instead of %zu for size_t (ruby#9359)
Co-authored-by: Takashi Kokubun <[email protected]>
1 parent ec04de7 commit d896641

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

gc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ rb_malloc_grow_capa(size_t current, size_t type_size)
213213
new_capacity -= malloc_offset;
214214
new_capacity /= type_size;
215215
if (current > new_capacity) {
216-
rb_bug("rb_malloc_grow_capa: current_capacity=%zu, new_capacity=%zu, malloc_offset=%zu", current, new_capacity, malloc_offset);
216+
rb_bug("rb_malloc_grow_capa: current_capacity=%"PRIuSIZE", new_capacity=%"PRIuSIZE", malloc_offset=%"PRIuSIZE"", current, new_capacity, malloc_offset);
217217
}
218218
RUBY_ASSERT(new_capacity > current);
219219
return new_capacity;
@@ -13963,7 +13963,7 @@ rb_raw_obj_info_buitin_type(char *const buff, const size_t buff_size, const VALU
1396313963
{
1396413964
if (rb_shape_obj_too_complex(obj)) {
1396513965
size_t hash_len = rb_st_table_size(ROBJECT_IV_HASH(obj));
13966-
APPEND_F("(too_complex) len:%zu", hash_len);
13966+
APPEND_F("(too_complex) len:%"PRIuSIZE"", hash_len);
1396713967
}
1396813968
else {
1396913969
uint32_t len = ROBJECT_IV_CAPACITY(obj);

regexec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4158,7 +4158,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
41584158
size_t length = (end - str) + 1;
41594159
size_t num_match_cache_points = (size_t)msa->num_cache_points * length;
41604160
#ifdef ONIG_DEBUG_MATCH_CACHE
4161-
fprintf(stderr, "MATCH CACHE: #match cache points = %ld (length = %zu)\n", num_match_cache_points, length);
4161+
fprintf(stderr, "MATCH CACHE: #match cache points = %"PRIuSIZE" (length = %"PRIuSIZE")\n", num_match_cache_points, length);
41624162
#endif
41634163
/* Overflow check */
41644164
if (num_match_cache_points / length != (size_t)msa->num_cache_points) {

0 commit comments

Comments
 (0)