remove pointer to long conversions - part 2 of 3 (trunk only)

Remove some more code that forced pointers into a long int, and
vice versa where information could be lost (P64 platforms such as
WIN64 have a 64 bit pointer size, but a 32 bit long size.)

This 2nd part deals with timeout functions switching
some arguments from type genericptr_t to 'anything'.

Like part 1, this needs to increment EDITLEVEL in patchlevel.h.
This commit is contained in:
nethack.allison
2006-07-09 01:02:51 +00:00
parent 9c79bb2758
commit d611cd76c5
11 changed files with 108 additions and 104 deletions

View File

@@ -3766,7 +3766,7 @@ xchar x,y;
for (when = MIN_ICE_TIME; when < (MAX_ICE_TIME + MIN_ICE_TIME); when++)
if (!rn2((MAX_ICE_TIME - when) + MIN_ICE_TIME)) break;
where = (((long)x << 16) | ((long)y));
(void) start_timer((long)when, TIMER_LEVEL, action, (genericptr_t)where);
(void) start_timer((long)when, TIMER_LEVEL, action, long_to_any(where));
}
#undef MIN_ICE_TIME
#undef MAX_ICE_TIME
@@ -3776,11 +3776,11 @@ xchar x,y;
*/
void
melt_ice_away(arg, timeout)
genericptr_t arg;
anything *arg;
long timeout; /* unused */
{
xchar x,y;
long where = (long)arg;
long where = arg->a_long;
y = (xchar)(where & 0xFFFF);
x = (xchar)((where >> 16) & 0xFFFF);