]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - hunt/huntd/driver.c
avoid unnecessary floating point ops
[bsdgames-darwin.git] / hunt / huntd / driver.c
index 0abf364a149d544088c8a396b9f1cfb2d0339353..ff5411d9f393355000d05a9b198308e434f288a5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: driver.c,v 1.20 2009/08/12 07:42:11 dholland Exp $     */
+/*     $NetBSD: driver.c,v 1.22 2013/10/19 17:23:08 christos Exp $     */
 /*
  * Copyright (c) 1983-2003, Regents of the University of California.
  * All rights reserved.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: driver.c,v 1.20 2009/08/12 07:42:11 dholland Exp $");
+__RCSID("$NetBSD: driver.c,v 1.22 2013/10/19 17:23:08 christos Exp $");
 #endif /* not lint */
 
 #include <sys/ioctl.h>
@@ -88,7 +88,7 @@ main(int ac, char **av, char **ep)
        PLAYER *pp;
 #ifdef INTERNET
        u_short msg;
-       short port_num, reply;
+       short reply;
        socklen_t namelen;
        SOCKET test;
 #endif
@@ -143,7 +143,6 @@ again:
 #ifdef INTERNET
                if (fdset[2].revents & POLLIN) {
                        namelen = DAEMON_SIZE;
-                       port_num = htons(sock_port);
                        (void) recvfrom(Test_socket, &msg, sizeof msg,
                                0, (struct sockaddr *) &test, &namelen);
                        switch (ntohs(msg)) {
@@ -412,7 +411,7 @@ init(void)
        fdset[2].fd = -1;
 #endif
 
-       Seed = getpid() + time((time_t *) NULL);
+       Seed = getpid() + time(NULL);
        makemaze();
 #ifdef BOOTS
        makeboots();
@@ -599,7 +598,6 @@ zap(PLAYER *pp, FLAG was_player, int i)
        BULLET *bp;
        PLAYER *np;
        int x, y;
-       int savefd;
 
        if (was_player) {
                if (pp->p_undershot)
@@ -622,8 +620,6 @@ zap(PLAYER *pp, FLAG was_player, int i)
        outstr(pp, pp->p_death, len);
        cgoto(pp, HEIGHT, 0);
 
-       savefd = pp->p_fd;
-
 #ifdef MONITOR
        if (was_player) {
 #endif
@@ -662,7 +658,7 @@ zap(PLAYER *pp, FLAG was_player, int i)
                }
                if (x > 0) {
                        (void) add_shot(len, pp->p_y, pp->p_x, pp->p_face, x,
-                               (PLAYER *) NULL, TRUE, SPACE);
+                               NULL, TRUE, SPACE);
                        (void) snprintf(Buf, sizeof(Buf), "%s detonated.",
                                pp->p_ident->i_name);
                        for (np = Player; np < End_player; np++)
@@ -710,7 +706,7 @@ zap(PLAYER *pp, FLAG was_player, int i)
                                y = rand_num(HEIGHT / 2) + HEIGHT / 4;
                        } while (Maze[y][x] != SPACE);
                        (void) add_shot(LAVA, y, x, LEFTS, volcano,
-                               (PLAYER *) NULL, TRUE, SPACE);
+                               NULL, TRUE, SPACE);
                        for (np = Player; np < End_player; np++)
                                message(np, "Volcano eruption.");
                        volcano = 0;
@@ -726,7 +722,7 @@ zap(PLAYER *pp, FLAG was_player, int i)
                        add_shot(DSHOT, y, x, rand_dir(),
                                shot_req[MINDSHOT +
                                rand_num(MAXBOMB - MINDSHOT)],
-                               (PLAYER *) NULL, FALSE, SPACE);
+                               NULL, FALSE, SPACE);
                }
 #endif