MCPcopy Create free account
hub / github.com/NetHack/NetHack / size_obj

Function size_obj

src/wizcmds.c:1116–1132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1114static const char stats_sep[] = "--------------------------- ----- -------";
1115
1116staticfn int
1117size_obj(struct obj *otmp)
1118{
1119 int sz = (int) sizeof (struct obj);
1120
1121 if (otmp->oextra) {
1122 sz += (int) sizeof (struct oextra);
1123 if (ONAME(otmp))
1124 sz += (int) strlen(ONAME(otmp)) + 1;
1125 if (OMONST(otmp))
1126 sz += size_monst(OMONST(otmp), FALSE);
1127 if (OMAILCMD(otmp))
1128 sz += (int) strlen(OMAILCMD(otmp)) + 1;
1129 /* sz += (int) sizeof (unsigned); -- now part of oextra itself */
1130 }
1131 return sz;
1132}
1133
1134staticfn void
1135count_obj(struct obj *chain, long *total_count, long *total_size,

Callers 1

count_objFunction · 0.85

Calls 1

size_monstFunction · 0.85

Tested by

no test coverage detected