1- /* $NetBSD: input.c,v 1.6 1997/10/10 02:07:18 lukem Exp $ */
1+ /* $NetBSD: input.c,v 1.7 1998/03/29 04:45:17 mrg Exp $ */
22
33/*-
44 * Copyright (c) 1990, 1993
5050#if 0
5151static char sccsid [] = "@(#)input.c 8.1 (Berkeley) 5/31/93" ;
5252#else
53- __RCSID ("$NetBSD: input.c,v 1.6 1997/10/10 02:07:18 lukem Exp $" );
53+ __RCSID ("$NetBSD: input.c,v 1.7 1998/03/29 04:45:17 mrg Exp $" );
5454#endif
5555#endif not lint
5656
@@ -459,9 +459,9 @@ delayb(c)
459459
460460 if (c >= sp -> num_beacons )
461461 return ("Unknown beacon" );
462- xdiff = sp -> beacon [c ].x - p .xpos ;
462+ xdiff = sp -> beacon [( int ) c ].x - p .xpos ;
463463 xdiff = SGN (xdiff );
464- ydiff = sp -> beacon [c ].y - p .ypos ;
464+ ydiff = sp -> beacon [( int ) c ].y - p .ypos ;
465465 ydiff = SGN (ydiff );
466466 if (xdiff != displacement [p .dir ].dx || ydiff != displacement [p .dir ].dy )
467467 return ("Beacon is not in flight path" );
@@ -471,16 +471,16 @@ delayb(c)
471471 if (dest_type != T_NODEST ) {
472472 switch (dest_type ) {
473473 case T_BEACON :
474- xdiff = sp -> beacon [dest_no ].x - sp -> beacon [c ].x ;
475- ydiff = sp -> beacon [dest_no ].y - sp -> beacon [c ].y ;
474+ xdiff = sp -> beacon [dest_no ].x - sp -> beacon [( int ) c ].x ;
475+ ydiff = sp -> beacon [dest_no ].y - sp -> beacon [( int ) c ].y ;
476476 break ;
477477 case T_EXIT :
478- xdiff = sp -> exit [dest_no ].x - sp -> beacon [c ].x ;
479- ydiff = sp -> exit [dest_no ].y - sp -> beacon [c ].y ;
478+ xdiff = sp -> exit [dest_no ].x - sp -> beacon [( int ) c ].x ;
479+ ydiff = sp -> exit [dest_no ].y - sp -> beacon [( int ) c ].y ;
480480 break ;
481481 case T_AIRPORT :
482- xdiff = sp -> airport [dest_no ].x - sp -> beacon [c ].x ;
483- ydiff = sp -> airport [dest_no ].y - sp -> beacon [c ].y ;
482+ xdiff = sp -> airport [dest_no ].x - sp -> beacon [( int ) c ].x ;
483+ ydiff = sp -> airport [dest_no ].y - sp -> beacon [( int ) c ].y ;
484484 break ;
485485 default :
486486 return ("Bad case in delayb! Get help!" );
@@ -580,20 +580,20 @@ benum(c)
580580 case T_BEACON :
581581 if (c >= sp -> num_beacons )
582582 return ("Unknown beacon" );
583- p .new_dir = DIR_FROM_DXDY (sp -> beacon [c ].x - p .xpos ,
584- sp -> beacon [c ].y - p .ypos );
583+ p .new_dir = DIR_FROM_DXDY (sp -> beacon [( int ) c ].x - p .xpos ,
584+ sp -> beacon [( int ) c ].y - p .ypos );
585585 break ;
586586 case T_EXIT :
587587 if (c >= sp -> num_exits )
588588 return ("Unknown exit" );
589- p .new_dir = DIR_FROM_DXDY (sp -> exit [c ].x - p .xpos ,
590- sp -> exit [c ].y - p .ypos );
589+ p .new_dir = DIR_FROM_DXDY (sp -> exit [( int ) c ].x - p .xpos ,
590+ sp -> exit [( int ) c ].y - p .ypos );
591591 break ;
592592 case T_AIRPORT :
593593 if (c >= sp -> num_airports )
594594 return ("Unknown airport" );
595- p .new_dir = DIR_FROM_DXDY (sp -> airport [c ].x - p .xpos ,
596- sp -> airport [c ].y - p .ypos );
595+ p .new_dir = DIR_FROM_DXDY (sp -> airport [( int ) c ].x - p .xpos ,
596+ sp -> airport [( int ) c ].y - p .ypos );
597597 break ;
598598 default :
599599 return ("Unknown case in benum! Get help!" );
0 commit comments