Re: Ugh? (In db.c)

From: John Whitla (cjw7@gte.net)
Date: 11/06/02


> \I noticed this piece of code in db.c, in parse_mob:
> \
> \
> \#ifdef CIRCLE_ACORN /* Ugh. */
>  \ if (sscanf(line, "%s %s %d %s", f1, f2, t + 2, &letter) != 4) {
> \#else
>   \if (sscanf(line, "%s %s %d %c", f1, f2, t + 2, &letter) != 4) {
> \#endif
>   \  log("SYSERR: Format error after string section of mob #%d\n"
>  \"...expecting line of form '# # # {S | E}'", nr);
>   \  exit(1);
>   \}
> \
> \What is the meaning of this?
>
> It looks like your mob loading file. in other words it reads your mob
files and creates the mobs in the game.

If it's the "ugh" you're concerned with, the original coder is merely
acknowledging that they wished to come up with a more "elegant" way of
handling the inconsistency between platforms.  The implementation of
sscanf() on the RiscOS apparently doesn't, or didn't at the time of coding,
handle the '%c'.  The #ifdef gets around this at compile-time, regardless of
platform.

Basically, not an issue, unless you plan on submitting code mods, intended
for multi-platform consumption, to the Circle gurus.

J.

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT