Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Just looking to clean up the compile, (unsure what message means)

Just looking to clean up the compile, (unsure what message means)

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Del   (5 posts)  Bio
Date Tue 16 Aug 2005 09:25 PM (UTC)
Message
My compile is clean save for one message I get that I have no idea what it means.

act_move.c: In function `generate_exit':
act_move.c:604: warning: use of cast expressions as lvalues is deprecated


590 bxit = make_exit(room, backroom, rev_dir[vdir]);
591 bxit->keyword = STRALLOC( "" );
592 bxit->description = STRALLOC( "" );
593 bxit->key = -1;
594 if ( (serial & 65535) != orig_exit->vnum )
595 bxit->distance = roomnum;
596 else
597 {
598 EXIT_DATA *tmp = get_exit( backroom, vdir );
599 int fulldist = tmp->distance;
600
601 bxit->distance = fulldist - distance;
602 }
603 }
604 (EXIT_DATA *) pexit = xit;
605 return room;
606 }

Thats the end of generate exit.

I make lots of changes and somtimes I go for a while without recompiling them, and I have no idea what I did if anything to cause this. Any help would be much appericated.




Thanks
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Tue 16 Aug 2005 09:34 PM (UTC)
Message
I 'fixed' this one a while ago. It looks like a mistake but I'm not sure since I'm not entirely clear on what Thoric's intentions were.

The thing is that what the code is doing - casting an exit** to an exit* and then assigning it - is simply strange. When generate_exit is called (only once in the code I have) it is passed the address of an exit. So, when it sets the exit, it should set the value of the pointer, not the pointer to the pointer.

In any case, to fix this, you want to change the line to read:
// Dereference the pointer-to-pointer, and assign
// 'xit' to the exit pointed to by pexit
*pexit = xit;

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Del   (5 posts)  Bio
Date Reply #2 on Wed 17 Aug 2005 03:12 AM (UTC)
Message
It did the trick thanks, I never really had a look at the function in depth, it is rather odd.


Well all that matters is
it's a 'fix'.

-Thanks again
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


12,194 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.