summaryrefslogtreecommitdiffstats
path: root/mbbsd/chc_play.c
diff options
context:
space:
mode:
authorptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-13 11:20:04 +0800
committerptt <ptt@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-05-13 11:20:04 +0800
commit6a428fb60d8ec6092d428b2e0f869a31f4890dc7 (patch)
treea0671ea2dc0168a9cb5625f867d553f6d0441efc /mbbsd/chc_play.c
parent438c456b95eec0e5ac662ca3cf2386dff2c44bc7 (diff)
downloadpttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.gz
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.bz2
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.lz
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.xz
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.tar.zst
pttbbs-6a428fb60d8ec6092d428b2e0f869a31f4890dc7.zip
replace time(NULL) by now
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@163 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/chc_play.c')
-rw-r--r--mbbsd/chc_play.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mbbsd/chc_play.c b/mbbsd/chc_play.c
index 86c17fbc..8f3e432c 100644
--- a/mbbsd/chc_play.c
+++ b/mbbsd/chc_play.c
@@ -1,4 +1,4 @@
-/* $Id: chc_play.c,v 1.1 2002/03/07 15:13:48 in2 Exp $ */
+/* $Id: chc_play.c,v 1.2 2002/05/13 03:20:04 ptt Exp $ */
#include <stdio.h>
#include <time.h>
#include <unistd.h>
@@ -12,7 +12,7 @@
extern userinfo_t *currutmp;
extern int usernum;
-
+extern time_t now;
typedef int (*play_func_t)(int, board_t, board_t);
static int chc_ipass = 0, chc_hepass = 0;
@@ -35,9 +35,9 @@ static int hisplay(int s, board_t board, board_t tmpbrd) {
int start_time;
int endgame = 0, endturn = 0;
- start_time = time(NULL);
+ start_time = now;
while(!endturn) {
- chc_lefttime = CHC_TIMEOUT - (time(NULL) - start_time);
+ chc_lefttime = CHC_TIMEOUT - (now - start_time);
if(chc_lefttime < 0) {
chc_lefttime = 0;
@@ -95,15 +95,15 @@ static int myplay(int s, board_t board, board_t tmpbrd) {
int endgame = 0, endturn = 0;
chc_ipass = 0, chc_selected = 0;
- start_time = time(NULL);
- chc_lefttime = CHC_TIMEOUT - (time(NULL) - start_time);
+ start_time = now;
+ chc_lefttime = CHC_TIMEOUT - (now - start_time);
bell();
while(!endturn) {
chc_drawline(board, TIME_ROW);
chc_movecur(chc_cursor.r, chc_cursor.c);
oflush();
ch = igetkey();
- chc_lefttime = CHC_TIMEOUT - (time(NULL) - start_time);
+ chc_lefttime = CHC_TIMEOUT - (now - start_time);
if(chc_lefttime < 0)
ch = 'q';
switch(ch) {