Re: [CODE] Issues with Qedit

From: Chris Gilbert (chris@buzzbee.freeserve.co.uk)
Date: 04/15/00


Shawn Kimbley wrote:
>
> I'm currently trying to add the Autoquest 1.2 patch from the ftp site to pl15
> with Oasis 2.0.  It's made for 1.6 but I believe i've made most of the changes
> to get it to work with 2.0 save one:
>
> when compiling i get an error:
>
> qedit.c blah: warning: dereferencing 'void *' pointer
>               request for member 'quest' in something not a structure or a union
>
> This occurs everywhere OLC_QUEST(d) appears.  So being an engineer I studied
> medit.c and genmob.c trying to find out how Oasis handles stuff like OLC_MOB(d)
> to see if perhaps i was leaving out a void or struct.  I'm assuming i'm not
> missing a major chunk of code just something minor that a more experienced
> coder would just know.

Looking at the patch (took longer to find the patch than to do the
solution)
olc_quest is defined as:
#define OLC_QUEST(d) ((d)->olc->quest)

that's the problem, it should be:
#define OLC_QUEST(d) (OLC(d)->quest)

d->olc is a void *, so the define for OLC is:
#define OLC(d)          ((struct oasis_olc_data *)(d)->olc)

That should cure it.

Chris


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



This archive was generated by hypermail 2b30 : 04/10/01 PDT