Re: [CODE] question about top_of_world

From: Mike Breuer (mbreuer@new.rr.com)
Date: 12/13/01


----- Original Message -----
From: "krenshala" <krenshala@JUMP.NET>
> [I'm trying to clear up warnings about values always being true, and they
> keep involving GET_ROOM_VNUM() and/or top_of_world.  I have changed
NOWHERE
> (et al) to 65535 (zone vnums are unsigned) and I -think- that might be
part
> of the problem. /: ]

If you changed your vnums to unsigned, you also need to root out all the
places in the code that test like this:

if (vnum >= 0) { /* This is a valid room */
  ...
}

and possibly the reverse (vnum < 0 means invalid room).  Obviously, tests
that include the top_of_world should still work:
if (vnum >=0 && vnum <= top_of_world) { /* This is still valid */
  ...
}

Mike

--
   +---------------------------------------------------------------+
   | 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/24/03 PDT