]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - sail/pl_main.c
Increase spending on vowels. No object file diffs.
[bsdgames-darwin.git] / sail / pl_main.c
index 6d0680101221749e13c924d17ce501ab741270bb..619a99f1d2c4732facb2e7eb63fb2c18df727dea 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: pl_main.c,v 1.20 2009/03/14 18:32:47 dholland Exp $    */
+/*     $NetBSD: pl_main.c,v 1.26 2009/03/15 03:33:56 dholland Exp $    */
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)pl_main.c  8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: pl_main.c,v 1.20 2009/03/14 18:32:47 dholland Exp $");
+__RCSID("$NetBSD: pl_main.c,v 1.26 2009/03/15 03:33:56 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -45,17 +45,17 @@ __RCSID("$NetBSD: pl_main.c,v 1.20 2009/03/14 18:32:47 dholland Exp $");
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include "display.h"
 #include "extern.h"
 #include "player.h"
 #include "restart.h"
 
-static void    initialize(void);
+static void initialize(void);
 
 /*ARGSUSED*/
 int
 pl_main(void)
 {
-
        initialize();
        Msg("Aye aye, Sir");
        play();
@@ -100,7 +100,7 @@ reprint:
                nat[n] = 0;
        foreachship(sp) {
                if (sp->file == NULL &&
-                   (sp->file = (struct File *)calloc(1, sizeof (struct File))) == NULL) {
+                   (sp->file = calloc(1, sizeof (struct File))) == NULL) {
                        err(1, "calloc");
                }
                sp->file->index = sp - SHIP(0);
@@ -134,7 +134,7 @@ reprint:
                if (sp >= ls) {
                        puts("All ships taken in that scenario.");
                        foreachship(sp)
-                               free((char *)sp->file);
+                               free(sp->file);
                        sync_close(0);
                        people = 0;
                        goto reprint;
@@ -181,7 +181,7 @@ reprint:
        mf = ms->file;
        mc = ms->specs;
 
-       Write(W_BEGIN, ms, 0, 0, 0, 0);
+       send_begin(ms);
        if (Sync() < 0)
                leave(LEAVE_SYNC);
 
@@ -192,7 +192,7 @@ reprint:
                        longjmp(restart, MODE_DRIVER);
                        /*NOTREACHED*/
                case -1:
-                       perror("fork");
+                       warn("fork");
                        leave(LEAVE_FORK);
                        break;
                default:
@@ -202,7 +202,7 @@ reprint:
        printf("Your ship is the %s, a %d gun %s (%s crew).\n",
                ms->shipname, mc->guns, classname[mc->class],
                qualname[mc->qual]);
-       if ((nameptr = (char *) getenv("SAILNAME")) && *nameptr)
+       if ((nameptr = getenv("SAILNAME")) && *nameptr)
                strlcpy(captain, nameptr, sizeof captain);
        else {
                printf("Your name, Captain? ");
@@ -214,7 +214,7 @@ reprint:
                else
                    captain[strlen(captain) - 1] = '\0';
        }
-       Writestr(W_CAPTAIN, ms, captain);
+       send_captain(ms, captain);
        for (n = 0; n < 2; n++) {
                char buf[10];
 
@@ -250,9 +250,9 @@ reprint:
        printf("\n");
        fflush(stdout);
        initscreen();
-       draw_board();
+       display_redraw();
        snprintf(message, sizeof message, "Captain %s assuming command",
                        captain);
-       Writestr(W_SIGNAL, ms, message);
+       send_signal(ms, message);
        newturn(0);
 }