Moved hexdump macro before used

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-10-14 23:45:33 +00:00
Родитель bb9eea9065
Коммит f572aeb71f
1 изменённых файлов: 24 добавлений и 24 удалений

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

@ -1216,6 +1216,30 @@ di_find_abbrev(DebugInfoReader *reader, uint64_t abbrev_number)
} }
#if 0 #if 0
static void
hexdump0(const unsigned char *p, size_t n)
{
size_t i;
fprintf(stderr, " 0 1 2 3 4 5 6 7 8 9 A B C D E F\n");
for (i=0; i < n; i++){
switch (i & 15) {
case 0:
fprintf(stderr, "%02zd: %02X ", i/16, p[i]);
break;
case 15:
fprintf(stderr, "%02X\n", p[i]);
break;
default:
fprintf(stderr, "%02X ", p[i]);
break;
}
}
if ((i & 15) != 15) {
fprintf(stderr, "\n");
}
}
#define hexdump(p,n) hexdump0((const unsigned char *)p, n)
static void static void
div_inspect(DebugInfoValue *v) div_inspect(DebugInfoValue *v)
{ {
@ -1507,30 +1531,6 @@ fail:
return 0; return 0;
} }
static void
hexdump0(const unsigned char *p, size_t n)
{
size_t i;
fprintf(stderr, " 0 1 2 3 4 5 6 7 8 9 A B C D E F\n");
for (i=0; i < n; i++){
switch (i & 15) {
case 0:
fprintf(stderr, "%02zd: %02X ", i/16, p[i]);
break;
case 15:
fprintf(stderr, "%02X\n", p[i]);
break;
default:
fprintf(stderr, "%02X ", p[i]);
break;
}
}
if ((i & 15) != 15) {
fprintf(stderr, "\n");
}
}
#define hexdump(p,n) hexdump0((const unsigned char *)p, n)
/* read file and fill lines */ /* read file and fill lines */
static uintptr_t static uintptr_t
fill_lines(int num_traces, void **traces, int check_debuglink, fill_lines(int num_traces, void **traces, int check_debuglink,