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

Posted by Del on Tue 16 Aug 2005 09:25 PM — 3 posts, 12,683 views.

#0
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
USA #1
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;
#2
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