OLC save info and pointers.

From: John Evans (evansj@HI-LINE.NET)
Date: 03/01/98


This one has me stumped. I am adding code to my camp command to inform
immortals of unsaved OLC info when they camp. They can override the
warning and still camp if they type 'camp yes'. Right now, the only
problem with the code is the following:

    for (entry = olc_save_list; entry; entry = entry->next) {
      if ((entry->zone == GET_OLC_ZONE1(ch)) ||
          (entry->zone == GET_OLC_ZONE2(ch)) ||
          (entry->zone == GET_OLC_ZONE3(ch)) ||
          (entry->zone == GET_OLC_ZONE4(ch))) {
        found = TRUE;
        sprintf(buf, "%s%s for zone %d.\r\n", buf,
                save_info_msg[(int)entry->type], entry->zone);
      }
    }

Every instance (all 7 of them) of "entry->" gives the following compiler
error: dereferencing pointer to incomplete type

Here is what I have in olc.c:
  for (entry = olc_save_list; entry; entry = entry->next) {
    send_to_charf(ch, " - %s for zone %d.\r\n",
                  save_info_msg[(int)entry->type], entry->zone);
  }

The above code in olc_saveinfo() does not produce errors, but the code
that I listed at the top in my ACMD(do_camp) _does_ produce errors. The
declarations of entry, olc_save_list, and save_info_msg are identical, so
I can think of no reason why one section of code compiles cleanly, and the
other section does not.

Any ideas?

Thank you for your time.

John Evans <evansj@hi-line.net>  --  http://www.hi-line.net/~evansj/

Any sufficiently advanced technology is indistinguishable from magic.
--Arthur C. Clarke


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST