Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/openzfs/module/lua/ldebug.c
Show First 20 Lines • Show All 318 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
** find a "name" for the RK value 'c' | ** find a "name" for the RK value 'c' | ||||
*/ | */ | ||||
static void kname (Proto *p, int pc, int c, const char **name) { | static void kname (Proto *p, int pc, int c, const char **name) { | ||||
if (ISK(c)) { /* is 'c' a constant? */ | if (ISK(c)) { /* is 'c' a constant? */ | ||||
TValue *kvalue = &p->k[INDEXK(c)]; | TValue *kvalue = &p->k[INDEXK(c)]; | ||||
if (ttisstring(kvalue)) { /* literal constant? */ | if (ttisstring(kvalue)) { /* literal constant? */ | ||||
// cppcheck-suppress autoVariables | |||||
*name = svalue(kvalue); /* it is its own name */ | *name = svalue(kvalue); /* it is its own name */ | ||||
return; | return; | ||||
} | } | ||||
/* else no reasonable name found */ | /* else no reasonable name found */ | ||||
} | } | ||||
else { /* 'c' is a register */ | else { /* 'c' is a register */ | ||||
const char *what = getobjname(p, pc, c, name); /* search for 'c' */ | const char *what = getobjname(p, pc, c, name); /* search for 'c' */ | ||||
if (what && *what == 'c') { /* found a constant name? */ | if (what && *what == 'c') { /* found a constant name? */ | ||||
▲ Show 20 Lines • Show All 274 Lines • Show Last 20 Lines |