1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Unify code by word sizes

This commit is contained in:
Nobuyoshi Nakada 2021-04-04 21:52:50 +09:00
parent bacb646169
commit 3cd3d25dde
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -796,12 +796,9 @@ print_machine_register(size_t reg, const char *reg_name, int col_count, int max_
{
int ret;
char buf[64];
static const int size_width = sizeof(size_t) * CHAR_BIT / 4;
#ifdef __LP64__
ret = snprintf(buf, sizeof(buf), " %3.3s: 0x%016" PRIxSIZE, reg_name, reg);
#else
ret = snprintf(buf, sizeof(buf), " %3.3s: 0x%08" PRIxSIZE, reg_name, reg);
#endif
ret = snprintf(buf, sizeof(buf), " %3.3s: 0x%.*" PRIxSIZE, reg_name, size_width, reg);
if (col_count + ret > max_col) {
fputs("\n", stderr);
col_count = 0;