/****************************************************************************
- * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* Eric S. Raymond <esr@snark.thyrsus.com> July 22 1995. Mouse support
* added September 20th 1995.
*
- * $Id: knight.c,v 1.28 2008/08/03 23:04:26 tom Exp $
+ * $Id: knight.c,v 1.31 2010/11/13 20:44:21 tom Exp $
*/
#include <test.priv.h>
bg = -1;
#endif
- (void) init_pair(TRAIL_COLOR, COLOR_CYAN, bg);
- (void) init_pair(PLUS_COLOR, COLOR_RED, bg);
- (void) init_pair(MINUS_COLOR, COLOR_GREEN, bg);
+ (void) init_pair(TRAIL_COLOR, (short) COLOR_CYAN, (short) bg);
+ (void) init_pair(PLUS_COLOR, (short) COLOR_RED, (short) bg);
+ (void) init_pair(MINUS_COLOR, (short) COLOR_GREEN, (short) bg);
trail |= COLOR_PAIR(TRAIL_COLOR);
plus |= COLOR_PAIR(PLUS_COLOR);
(void) waddstr(helpwin, "puzzle; also inform you when you run out\n");
(void) waddstr(helpwin, "of legal moves.\n\n");
- (void) mvwaddstr(helpwin, NOTIFYY - INSTRY, 0,
- "Press `?' to go to keystroke help.");
+ MvWAddStr(helpwin, NOTIFYY - INSTRY, 0,
+ "Press `?' to go to keystroke help.");
}
static void
(void) waddstr(helpwin, "square with spacebar, Enter, or the keypad\n");
(void) waddstr(helpwin, "center key. Use F/B to review the path.\n");
- (void) mvwaddstr(helpwin, NOTIFYY - INSTRY, 0,
- "Press `?' to go to game explanation");
+ MvWAddStr(helpwin, NOTIFYY - INSTRY, 0,
+ "Press `?' to go to game explanation");
}
static void
{
int i, j;
- mvaddstr(0, 20, "KNIGHT'S MOVE -- a logical solitaire");
+ MvAddStr(0, 20, "KNIGHT'S MOVE -- a logical solitaire");
move(BOARDY, BOARDX);
waddch(boardwin, ACS_ULCORNER);
newx = oldx + offsets[k].x;
if (chksqr(newy, newx)) {
if (first < 0)
- first = k;
+ first = (int) k;
if (newy == *y
&& newx == *x) {
- found = k;
+ found = (int) k;
} else if (found >= 0) {
- next = k;
+ next = (int) k;
break;
}
}
history[movecount - 1].y,
history[movecount - 1].x,
rw, col);
- history[movecount].y = rw;
- history[movecount].x = col;
+ history[movecount].y = (short) rw;
+ history[movecount].x = (short) col;
movecount++;
trialcount++;