mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2025-03-11 02:40:09 +01:00
(unw_regname): Use NELEMS() instead of open code.
(Logical change 1.39)
This commit is contained in:
parent
0797f31dd2
commit
cb8d20c098
1 changed files with 15 additions and 0 deletions
|
@ -0,0 +1,15 @@
|
|||
#include "unwind_i.h"
|
||||
|
||||
static const char *regname[] =
|
||||
{
|
||||
"eax", "ebx", "ecx", "edx", "esi", "edi", "ebp", "eip", "esp"
|
||||
};
|
||||
|
||||
const char *
|
||||
unw_regname (unw_regnum_t reg)
|
||||
{
|
||||
if (reg < NELEMS (regname))
|
||||
return regname[reg];
|
||||
else
|
||||
return "???";
|
||||
}
|
Loading…
Add table
Reference in a new issue