Clean up console output functions

FossilOrigin-Name: 003b06901f169b5d97cbbaa313ad31a2493d2a56b295cffda136500ecc5d4f05
This commit is contained in:
Jonathan Schleifer 2025-03-05 21:55:28 +00:00
parent ab582d3745
commit cac7cebba0
16 changed files with 108 additions and 105 deletions

View file

@ -36,8 +36,8 @@ VARP(minmillis, 0, 5, 1000);
processInitQueue(); processInitQueue();
#define log(s) conoutf(@"init: %s", s) #define log(s) conoutf(@"init: %@", s)
log("sdl"); log(@"sdl");
const OFOptionsParserOption options[] = { const OFOptionsParserOption options[] = {
{'d', @"dedicated", 0, &dedicated, NULL}, {'d', @"dedicated", 0, &dedicated, NULL},
@ -83,7 +83,7 @@ VARP(minmillis, 0, 5, 1000);
if (SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO | par) < 0) if (SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO | par) < 0)
fatal(@"Unable to initialize SDL"); fatal(@"Unable to initialize SDL");
log("net"); log(@"net");
if (enet_initialize() < 0) if (enet_initialize() < 0)
fatal(@"Unable to initialise network module"); fatal(@"Unable to initialise network module");
@ -92,14 +92,14 @@ VARP(minmillis, 0, 5, 1000);
initserver(dedicated, uprate, sdesc.UTF8String, ip.UTF8String, initserver(dedicated, uprate, sdesc.UTF8String, ip.UTF8String,
master.UTF8String, passwd, maxcl); master.UTF8String, passwd, maxcl);
log("world"); log(@"world");
empty_world(7, true); empty_world(7, true);
log("video: sdl"); log(@"video: sdl");
if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
fatal(@"Unable to initialize SDL Video"); fatal(@"Unable to initialize SDL Video");
log("video: mode"); log(@"video: mode");
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
if ((_window = SDL_CreateWindow("cube engine", SDL_WINDOWPOS_UNDEFINED, if ((_window = SDL_CreateWindow("cube engine", SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED, _width, _height, SDL_WINDOWPOS_UNDEFINED, _width, _height,
@ -108,15 +108,15 @@ VARP(minmillis, 0, 5, 1000);
SDL_GL_CreateContext(_window) == NULL) SDL_GL_CreateContext(_window) == NULL)
fatal(@"Unable to create OpenGL screen"); fatal(@"Unable to create OpenGL screen");
log("video: misc"); log(@"video: misc");
SDL_SetWindowGrab(_window, SDL_TRUE); SDL_SetWindowGrab(_window, SDL_TRUE);
SDL_SetRelativeMouseMode(SDL_TRUE); SDL_SetRelativeMouseMode(SDL_TRUE);
SDL_ShowCursor(0); SDL_ShowCursor(0);
log("gl"); log(@"gl");
gl_init(_width, _height); gl_init(_width, _height);
log("basetex"); log(@"basetex");
_gameDataIRI = [OFFileManager.defaultManager currentDirectoryIRI]; _gameDataIRI = [OFFileManager.defaultManager currentDirectoryIRI];
_userDataIRI = [OFFileManager.defaultManager currentDirectoryIRI]; _userDataIRI = [OFFileManager.defaultManager currentDirectoryIRI];
int xs, ys; int xs, ys;
@ -157,10 +157,10 @@ VARP(minmillis, 0, 5, 1000);
fatal(@"could not find core textures (hint: run cube from the " fatal(@"could not find core textures (hint: run cube from the "
@"parent of the bin directory)"); @"parent of the bin directory)");
log("sound"); log(@"sound");
initsound(); initsound();
log("cfg"); log(@"cfg");
newmenu(@"frags\tpj\tping\tteam\tname"); newmenu(@"frags\tpj\tping\tteam\tname");
newmenu(@"ping\tplr\tserver"); newmenu(@"ping\tplr\tserver");
exec(@"data/keymap.cfg"); exec(@"data/keymap.cfg");
@ -172,12 +172,12 @@ VARP(minmillis, 0, 5, 1000);
execfile(@"data/defaults.cfg"); execfile(@"data/defaults.cfg");
exec(@"autoexec.cfg"); exec(@"autoexec.cfg");
log("localconnect"); log(@"localconnect");
localconnect(); localconnect();
// if this map is changed, also change depthcorrect() // if this map is changed, also change depthcorrect()
changemap(@"metl3"); changemap(@"metl3");
log("mainloop"); log(@"mainloop");
int ignore = 5; int ignore = 5;
for (;;) { for (;;) {
int millis = SDL_GetTicks() * gamespeed / 100; int millis = SDL_GetTicks() * gamespeed / 100;

View file

@ -85,17 +85,18 @@ writeclientinfo(FILE *f)
void void
connects(OFString *servername) connects(OFString *servername)
{ {
@autoreleasepool {
disconnect(1); // reset state disconnect(1); // reset state
addserver(servername); addserver(servername);
conoutf(@"attempting to connect to %s", servername.UTF8String); conoutf(@"attempting to connect to %@", servername);
ENetAddress address = {ENET_HOST_ANY, CUBE_SERVER_PORT}; ENetAddress address = {ENET_HOST_ANY, CUBE_SERVER_PORT};
@autoreleasepool {
if (enet_address_set_host(&address, servername.UTF8String) < if (enet_address_set_host(&address, servername.UTF8String) <
0) { 0) {
conoutf(@"could not resolve server %s", servername); conoutf(@"could not resolve server %@", servername);
return; return;
} }
}
clienthost = enet_host_create(NULL, 1, rate, rate); clienthost = enet_host_create(NULL, 1, rate, rate);
@ -109,7 +110,6 @@ connects(OFString *servername)
disconnect(); disconnect();
} }
} }
}
void void
disconnect(int onlyclean, int async) disconnect(int onlyclean, int async)

View file

@ -180,8 +180,7 @@ sendmap(OFString *mapname)
sendstring(mapname.UTF8String, p); sendstring(mapname.UTF8String, p);
putint(p, mapsize); putint(p, mapsize);
if (65535 - (p - start) < mapdata.count) { if (65535 - (p - start) < mapdata.count) {
conoutf( conoutf(@"map %@ is too large to send", mapname);
@"map %s is too large to send", mapname.UTF8String);
enet_packet_destroy(packet); enet_packet_destroy(packet);
return; return;
} }
@ -190,10 +189,10 @@ sendmap(OFString *mapname)
*(ushort *)start = ENET_HOST_TO_NET_16(p - start); *(ushort *)start = ENET_HOST_TO_NET_16(p - start);
enet_packet_resize(packet, p - start); enet_packet_resize(packet, p - start);
sendpackettoserv(packet); sendpackettoserv(packet);
conoutf(@"sending map %s to server...", mapname.UTF8String); conoutf(@"sending map %@ to server...", mapname);
sprintf_sd(msg)( sprintf_sd(msg)(
"[map %s uploaded to server, \"getmap\" to receive it]", "[map %@ uploaded to server, \"getmap\" to receive it]",
mapname.UTF8String); mapname);
toserver(msg); toserver(msg);
} }
} }

View file

@ -160,7 +160,7 @@ arenarespawn()
arenarespawnwait = 0; arenarespawnwait = 0;
conoutf(@"new round starting... fight!"); conoutf(@"new round starting... fight!");
respawnself(); respawnself();
}; }
} else if (arenadetectwait == 0 || arenadetectwait < lastmillis) { } else if (arenadetectwait == 0 || arenadetectwait < lastmillis) {
arenadetectwait = 0; arenadetectwait = 0;
int alive = 0, dead = 0; int alive = 0, dead = 0;
@ -302,7 +302,7 @@ entinmap(dynent *
return; return;
d->o.x -= dx; d->o.x -= dx;
d->o.y -= dy; d->o.y -= dy;
}; }
conoutf(@"can't find entity spawn spot! (%d, %d)", (int)d->o.x, conoutf(@"can't find entity spawn spot! (%d, %d)", (int)d->o.x,
(int)d->o.y); (int)d->o.y);
// leave ent at original pos, possibly stuck // leave ent at original pos, possibly stuck
@ -477,9 +477,9 @@ dynent *
getclient(int cn) // ensure valid entity getclient(int cn) // ensure valid entity
{ {
if (cn < 0 || cn >= MAXCLIENTS) { if (cn < 0 || cn >= MAXCLIENTS) {
neterr("clientnum"); neterr(@"clientnum");
return NULL; return NULL;
}; }
while (cn >= players.length()) while (cn >= players.length())
players.add(NULL); players.add(NULL);
return players[cn] ? players[cn] : (players[cn] = newdynent()); return players[cn] ? players[cn] : (players[cn] = newdynent());

View file

@ -8,9 +8,9 @@ extern OFString *toservermap;
extern string clientpassword; extern string clientpassword;
void void
neterr(char *s) neterr(OFString *s)
{ {
conoutf(@"illegal network message (%s)", s); conoutf(@"illegal network message (%@)", s);
disconnect(); disconnect();
} }
@ -59,7 +59,7 @@ localservertoclient(
uchar *buf, int len) // processes any updates from the server uchar *buf, int len) // processes any updates from the server
{ {
if (ENET_NET_TO_HOST_16(*(ushort *)buf) != len) if (ENET_NET_TO_HOST_16(*(ushort *)buf) != len)
neterr("packet length"); neterr(@"packet length");
incomingdemodata(buf, len); incomingdemodata(buf, len);
uchar *end = buf + len; uchar *end = buf + len;
@ -81,7 +81,7 @@ localservertoclient(
PROTOCOL_VERSION, prot); PROTOCOL_VERSION, prot);
disconnect(); disconnect();
return; return;
}; }
toservermap = @""; toservermap = @"";
clientnum = cn; // we are now fully connected clientnum = cn; // we are now fully connected
if (!getint(p)) if (!getint(p))
@ -94,10 +94,9 @@ localservertoclient(
@"to join this server!"); @"to join this server!");
disconnect(); disconnect();
return; return;
}; }
if (getint(p) == 1) { if (getint(p) == 1)
conoutf(@"server is FULL, disconnecting.."); conoutf(@"server is FULL, disconnecting..");
};
break; break;
}; };
@ -172,17 +171,17 @@ localservertoclient(
// name/team // name/team
{ {
sgetstr(); sgetstr();
if (d->name[0]) // already connected if (d->name[0]) {
{ // already connected
if (strcmp(d->name, text)) if (strcmp(d->name, text))
conoutf(@"%s is now known as %s", conoutf(@"%s is now known as %s",
d->name, text); d->name, text);
} else // new client } else {
{ // new client
c2sinit = c2sinit =
false; // send new players my info again false; // send new players my info again
conoutf(@"connected: %s", text); conoutf(@"connected: %s", text);
}; }
strcpy_s(d->name, text); strcpy_s(d->name, text);
sgetstr(); sgetstr();
strcpy_s(d->team, text); strcpy_s(d->team, text);
@ -385,7 +384,7 @@ localservertoclient(
} }
default: default:
neterr("type"); neterr(@"type");
return; return;
} }
} }

View file

@ -54,8 +54,8 @@ alias(OFString *name, OFString *action)
if (b.type == ID_ALIAS) if (b.type == ID_ALIAS)
b.action = action; b.action = action;
else else
conoutf(@"cannot redefine builtin %s with an alias", conoutf(
name.UTF8String); @"cannot redefine builtin %@ with an alias", name);
} }
} }
COMMAND(alias, ARG_2STR) COMMAND(alias, ARG_2STR)
@ -577,7 +577,7 @@ exec(OFString *cfgfile)
{ {
if (!execfile(cfgfile)) { if (!execfile(cfgfile)) {
@autoreleasepool { @autoreleasepool {
conoutf(@"could not read \"%s\"", cfgfile.UTF8String); conoutf(@"could not read \"%@\"", cfgfile);
} }
} }
} }

View file

@ -27,8 +27,8 @@ setconskip(int n)
} }
COMMANDN(conskip, setconskip, ARG_1INT) COMMANDN(conskip, setconskip, ARG_1INT)
void static void
conline(const char *sf, bool highlight) // add a line to the console buffer conline(OFString *sf, bool highlight) // add a line to the console buffer
{ {
cline cl; cline cl;
cl.cref = conlines.length() > 100 cl.cref = conlines.length() > 100
@ -40,10 +40,10 @@ conline(const char *sf, bool highlight) // add a line to the console buffer
{ {
cl.cref[0] = '\f'; cl.cref[0] = '\f';
cl.cref[1] = 0; cl.cref[1] = 0;
strcat_s(cl.cref, sf); strcat_s(cl.cref, sf.UTF8String);
} else { } else {
strcpy_s(cl.cref, sf); strcpy_s(cl.cref, sf.UTF8String);
}; }
puts(cl.cref); puts(cl.cref);
#ifndef OF_WINDOWS #ifndef OF_WINDOWS
fflush(stdout); fflush(stdout);
@ -51,20 +51,25 @@ conline(const char *sf, bool highlight) // add a line to the console buffer
} }
void void
conoutf(OFString *str, ...) conoutf(OFConstantString *format, ...)
{ {
sprintf_sdv(sf, str.UTF8String); @autoreleasepool {
const char *s = sf; va_list arguments;
va_start(arguments, format);
OFString *string = [[OFString alloc] initWithFormat:format
arguments:arguments];
va_end(arguments);
int n = 0; int n = 0;
while (strlen(s) > WORDWRAP) // cut strings to fit on screen while (string.length > WORDWRAP) {
{ conline([string substringToIndex:WORDWRAP], n++ != 0);
string t; string = [string substringFromIndex:WORDWRAP];
strn0cpy(t, s, WORDWRAP + 1); }
conline(t, n++ != 0); conline(string, n != 0);
s += WORDWRAP; }
} }
conline(s, n != 0);
};
void void
renderconsole() // render buffer taking into account time & scrolling renderconsole() // render buffer taking into account time & scrolling

View file

@ -95,7 +95,7 @@ noteditmode()
if (!editmode) if (!editmode)
conoutf(@"this function is only allowed in edit mode"); conoutf(@"this function is only allowed in edit mode");
return !editmode; return !editmode;
}; }
bool bool
noselection() noselection()
@ -103,7 +103,7 @@ noselection()
if (!selset) if (!selset)
conoutf(@"no selection"); conoutf(@"no selection");
return !selset; return !selset;
}; }
#define EDITSEL \ #define EDITSEL \
if (noteditmode() || noselection()) \ if (noteditmode() || noselection()) \
@ -266,11 +266,11 @@ editundo()
if (undos.empty()) { if (undos.empty()) {
conoutf(@"nothing more to undo"); conoutf(@"nothing more to undo");
return; return;
}; }
block *p = undos.pop(); block *p = undos.pop();
blockpaste(*p); blockpaste(*p);
free(p); free(p);
}; }
block *copybuf = NULL; block *copybuf = NULL;
@ -290,19 +290,19 @@ paste()
if (!copybuf) { if (!copybuf) {
conoutf(@"nothing to paste"); conoutf(@"nothing to paste");
return; return;
}; }
sel.xs = copybuf->xs; sel.xs = copybuf->xs;
sel.ys = copybuf->ys; sel.ys = copybuf->ys;
correctsel(); correctsel();
if (!selset || sel.xs != copybuf->xs || sel.ys != copybuf->ys) { if (!selset || sel.xs != copybuf->xs || sel.ys != copybuf->ys) {
conoutf(@"incorrect selection"); conoutf(@"incorrect selection");
return; return;
}; }
makeundo(); makeundo();
copybuf->x = sel.x; copybuf->x = sel.x;
copybuf->y = sel.y; copybuf->y = sel.y;
blockpaste(*copybuf); blockpaste(*copybuf);
}; }
void void
tofronttex() // maintain most recently used of the texture lists when applying tofronttex() // maintain most recently used of the texture lists when applying
@ -447,10 +447,10 @@ edittype(int type)
sel.x & ~-sel.xs || sel.y & ~-sel.ys)) { sel.x & ~-sel.xs || sel.y & ~-sel.ys)) {
conoutf(@"corner selection must be power of 2 aligned"); conoutf(@"corner selection must be power of 2 aligned");
return; return;
}; }
edittypexy(type, sel); edittypexy(type, sel);
addmsg(1, 6, SV_EDITS, sel.x, sel.y, sel.xs, sel.ys, type); addmsg(1, 6, SV_EDITS, sel.x, sel.y, sel.xs, sel.ys, type);
}; }
void void
heightfield(int t) heightfield(int t)

View file

@ -217,7 +217,7 @@ teleport(int n, dynent *d) // also used by monsters
if (e == beenhere || e < 0) { if (e == beenhere || e < 0) {
conoutf(@"no teleport destination for tag %d", tag); conoutf(@"no teleport destination for tag %d", tag);
return; return;
}; }
if (beenhere < 0) if (beenhere < 0)
beenhere = e; beenhere = e;
if (ents[e].attr2 == tag) { if (ents[e].attr2 == tag) {

View file

@ -11,12 +11,13 @@ dvector &
getmonsters() getmonsters()
{ {
return monsters; return monsters;
}; }
void void
restoremonsterstate() restoremonsterstate()
{ {
loopv(monsters) if (monsters[i]->state == CS_DEAD) numkilled++; loopv(monsters) if (monsters[i]->state == CS_DEAD) numkilled++;
}; // for savegames } // for savegames
#define TOTMFREQ 13 #define TOTMFREQ 13
#define NUMMONSTERTYPES 8 #define NUMMONSTERTYPES 8
@ -345,7 +346,7 @@ monsterpain(dynent *m, int damage, dynent *d)
conoutf(@"only %d monster(s) remaining", remain); conoutf(@"only %d monster(s) remaining", remain);
} else { } else {
playsound(monstertypes[m->mtype].painsound, &m->o); playsound(monstertypes[m->mtype].painsound, &m->o);
}; }
}; };
void void
@ -357,7 +358,7 @@ endsp(bool allkilled)
(lastmillis - mtimestart) / 1000); (lastmillis - mtimestart) / 1000);
monstertotal = 0; monstertotal = 0;
startintermission(); startintermission();
}; }
void void
monsterthink() monsterthink()
@ -401,7 +402,7 @@ monsterthink()
loopv(monsters) if (monsters[i]->state == CS_ALIVE) loopv(monsters) if (monsters[i]->state == CS_ALIVE)
monsteraction(monsters[i]); monsteraction(monsters[i]);
}; }
void void
monsterrender() monsterrender()

View file

@ -19,7 +19,7 @@ extern void writecfg();
// console // console
extern void keypress(int code, bool isdown, int cooked); extern void keypress(int code, bool isdown, int cooked);
extern void renderconsole(); extern void renderconsole();
extern void conoutf(OFString *s, ...); extern void conoutf(OFConstantString *format, ...);
extern char *getcurcommand(); extern char *getcurcommand();
extern void writebinds(FILE *f); extern void writebinds(FILE *f);
@ -78,7 +78,7 @@ extern bool allowedittoggle();
extern void sendpackettoserv(void *packet); extern void sendpackettoserv(void *packet);
extern void gets2c(); extern void gets2c();
extern void c2sinfo(dynent *d); extern void c2sinfo(dynent *d);
extern void neterr(char *s); extern void neterr(OFString *s);
extern void initclientnet(); extern void initclientnet();
extern bool netmapstart(); extern bool netmapstart();
extern int getclientnum(); extern int getclientnum();

View file

@ -79,8 +79,7 @@ installtex(int tnum, OFIRI *IRI, int *xs, int *ys, bool clamp)
SDL_Surface *s = SDL_Surface *s =
IMG_Load(IRI.fileSystemRepresentation.UTF8String); IMG_Load(IRI.fileSystemRepresentation.UTF8String);
if (s == NULL) { if (s == NULL) {
conoutf( conoutf(@"couldn't load texture %@", IRI.string);
@"couldn't load texture %s", IRI.string.UTF8String);
return false; return false;
} }
@ -89,8 +88,8 @@ installtex(int tnum, OFIRI *IRI, int *xs, int *ys, bool clamp)
SDL_AllocFormat(SDL_PIXELFORMAT_RGB24); SDL_AllocFormat(SDL_PIXELFORMAT_RGB24);
if (format == NULL) { if (format == NULL) {
conoutf( conoutf(
@"texture cannot be converted to 24bpp: %s", @"texture cannot be converted to 24bpp: %@",
IRI.string.UTF8String); IRI.string);
return false; return false;
} }
@ -99,8 +98,8 @@ installtex(int tnum, OFIRI *IRI, int *xs, int *ys, bool clamp)
SDL_ConvertSurface(s, format, 0); SDL_ConvertSurface(s, format, 0);
if (converted == NULL) { if (converted == NULL) {
conoutf(@"texture cannot be converted " conoutf(@"texture cannot be converted "
@"to 24bpp: %s", @"to 24bpp: %@",
IRI.string.UTF8String); IRI.string);
return false; return false;
} }
@ -135,9 +134,8 @@ installtex(int tnum, OFIRI *IRI, int *xs, int *ys, bool clamp)
void *scaledimg = s->pixels; void *scaledimg = s->pixels;
if (*xs != s->w) { if (*xs != s->w) {
conoutf(@"warning: quality loss: scaling %s", conoutf(@"warning: quality loss: scaling %@",
IRI.string IRI.string); // for voodoo cards under linux
.UTF8String); // for voodoo cards under linux
scaledimg = alloc(*xs * *ys * 3); scaledimg = alloc(*xs * *ys * 3);
gluScaleImage(GL_RGB, s->w, s->h, GL_UNSIGNED_BYTE, gluScaleImage(GL_RGB, s->w, s->h, GL_UNSIGNED_BYTE,
s->pixels, *xs, *ys, GL_UNSIGNED_BYTE, scaledimg); s->pixels, *xs, *ys, GL_UNSIGNED_BYTE, scaledimg);

View file

@ -95,7 +95,7 @@ savestate(char *fn)
if (!f) { if (!f) {
conoutf(@"could not write %s", fn); conoutf(@"could not write %s", fn);
return; return;
}; }
gzwrite(f, (void *)"CUBESAVE", 8); gzwrite(f, (void *)"CUBESAVE", 8);
gzputc(f, islittleendian); gzputc(f, islittleendian);
gzputi(SAVEGAMEVERSION); gzputi(SAVEGAMEVERSION);
@ -186,7 +186,7 @@ loadgameout()
stop(); stop();
conoutf(@"loadgame incomplete: savegame from a different version of " conoutf(@"loadgame incomplete: savegame from a different version of "
@"this map"); @"this map");
}; }
void void
loadgamerest() loadgamerest()
@ -237,7 +237,7 @@ loadgamerest()
startdemo(); startdemo();
else else
stop(); stop();
}; }
// demo functions // demo functions

View file

@ -113,7 +113,8 @@ music(OFString *name)
FSOUND_SetPaused(chan, false); FSOUND_SetPaused(chan, false);
} }
} else { } else {
conoutf(@"could not play music: %s", sn); conoutf(
@"could not play music: %@", IRI.string);
} }
#endif #endif
} }

View file

@ -50,7 +50,7 @@ selectgun(int a, int b, int c)
if (s != player1->gunselect) if (s != player1->gunselect)
playsoundc(S_WEAPLOAD); playsoundc(S_WEAPLOAD);
player1->gunselect = s; player1->gunselect = s;
// conoutf(@"%s selected", (int)guns[s].name.UTF8String); // conoutf(@"%@ selected", (int)guns[s].name);
} }
int int

View file

@ -306,10 +306,10 @@ delent()
if (e < 0) { if (e < 0) {
conoutf(@"no more entities"); conoutf(@"no more entities");
return; return;
}; }
int t = ents[e].type; int t = ents[e].type;
@autoreleasepool { @autoreleasepool {
conoutf(@"%s entity deleted", entnames[t].UTF8String); conoutf(@"%@ entity deleted", entnames[t]);
} }
ents[e].type = NOTUSED; ents[e].type = NOTUSED;
addmsg(1, 10, SV_EDITENT, e, NOTUSED, 0, 0, 0, 0, 0, 0, 0); addmsg(1, 10, SV_EDITENT, e, NOTUSED, 0, 0, 0, 0, 0, 0, 0);
@ -322,7 +322,7 @@ findtype(OFString *what)
{ {
@autoreleasepool { @autoreleasepool {
loopi(MAXENTTYPES) if ([what isEqual:entnames[i]]) return i; loopi(MAXENTTYPES) if ([what isEqual:entnames[i]]) return i;
conoutf(@"unknown entity type \"%s\"", what.UTF8String); conoutf(@"unknown entity type \"%@\"", what);
return NOTUSED; return NOTUSED;
} }
} }