From 72ca13ff5cd85091cedb1940dc370b19a509f061 Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Sat, 19 Oct 2013 21:43:25 +0200 Subject: [PATCH] Convert more stuff from #ifdef to dspwrappers: SetupBoard. Not a very big problem since that function is not curses-only this time, but raw-only. But this is the natural continuation of the "nuke NOT_CURSES" movement. --- gnushogi/commondsp.c | 2 +- gnushogi/cursesdsp.c | 6 ++++++ gnushogi/cursesdsp.h | 1 + gnushogi/dspwrappers.c | 1 + gnushogi/dspwrappers.h | 1 + gnushogi/rawdsp.c | 2 +- gnushogi/rawdsp.h | 6 +----- 7 files changed, 12 insertions(+), 7 deletions(-) diff --git a/gnushogi/commondsp.c b/gnushogi/commondsp.c index 55201aa..39d8500 100644 --- a/gnushogi/commondsp.c +++ b/gnushogi/commondsp.c @@ -1679,7 +1679,7 @@ InputCommand(char *command) { EditBoard(); } - else if (NOT_CURSES && (strcmp(s, CP[190]) == 0)) /* setup */ + else if ((strcmp(s, CP[190]) == 0)) /* setup */ { SetupBoard(); } diff --git a/gnushogi/cursesdsp.c b/gnushogi/cursesdsp.c index b278d46..cb2f458 100644 --- a/gnushogi/cursesdsp.c +++ b/gnushogi/cursesdsp.c @@ -1288,3 +1288,9 @@ Curses_ElapsedTime(ElapsedTime_mode iop) } } } + +void +Curses_SetupBoard(void) +{ + Curses_ShowMessage("'setup' command is not supported in Cursesmode"); +} diff --git a/gnushogi/cursesdsp.h b/gnushogi/cursesdsp.h index db38ffa..8bea2bf 100644 --- a/gnushogi/cursesdsp.h +++ b/gnushogi/cursesdsp.h @@ -66,6 +66,7 @@ void Curses_AlwaysShowMessage(const char *format, ...); void Curses_Printf(const char *format, ...); void Curses_doRequestInputString(const char* fmt, char* buffer); int Curses_GetString(char* sx); +void Curses_SetupBoard(void); void Curses_ShowPatternCount(short side, short n); void Curses_ShowPostnValue(short sq); void Curses_ShowPostnValues(void); diff --git a/gnushogi/dspwrappers.c b/gnushogi/dspwrappers.c index cd7c3da..d647f5a 100644 --- a/gnushogi/dspwrappers.c +++ b/gnushogi/dspwrappers.c @@ -96,6 +96,7 @@ DISPLAY_VOIDFUNC(OutputMove) DISPLAY_VOIDFUNC(SetContempt) DISPLAY_FUNC(SearchStartStuff, (short side), (side)) DISPLAY_FUNC(SelectLevel, (char *sx), (sx)) +DISPLAY_VOIDFUNC(SetupBoard) DISPLAY_FUNC(ShowCurrentMove, (short pnt, short f, short t), (pnt, f, t)) DISPLAY_FUNC(ShowDepth, (char ch), (ch)) DISPLAY_VOIDFUNC(ShowGameType) diff --git a/gnushogi/dspwrappers.h b/gnushogi/dspwrappers.h index e4b723f..449693f 100644 --- a/gnushogi/dspwrappers.h +++ b/gnushogi/dspwrappers.h @@ -62,6 +62,7 @@ extern void AlwaysShowMessage(const char *format, ...); extern void Printf(const char *format, ...); extern void RequestInputString(char* buffer, unsigned bufsize); extern int GetString(char* sx); +extern void SetupBoard(void); extern void ShowPatternCount(short side, short n); extern void ShowPostnValue(short sq); extern void ShowPostnValues(void); diff --git a/gnushogi/rawdsp.c b/gnushogi/rawdsp.c index 15f581f..6c8e654 100644 --- a/gnushogi/rawdsp.c +++ b/gnushogi/rawdsp.c @@ -472,7 +472,7 @@ Raw_EditBoard(void) * first line. White pieces are represented by uppercase characters. */ void -SetupBoard(void) +Raw_SetupBoard(void) { short r, c, sq, i; char ch; diff --git a/gnushogi/rawdsp.h b/gnushogi/rawdsp.h index e3edf30..44ec2d8 100644 --- a/gnushogi/rawdsp.h +++ b/gnushogi/rawdsp.h @@ -66,6 +66,7 @@ void Raw_AlwaysShowMessage(const char *format, ...); void Raw_Printf(const char *format, ...); void Raw_doRequestInputString(const char* fmt, char* buffer); int Raw_GetString(char* sx); +void Raw_SetupBoard(void); void Raw_ShowPatternCount(short side, short n); void Raw_ShowPostnValue(short sq); void Raw_ShowPostnValues(void); @@ -78,10 +79,5 @@ void Raw_TerminateSearch(int sig); void Raw_UpdateDisplay(short f, short t, short redraw, short isspec); void Raw_help(void); - -/* The following are only found in rawdsp.h: */ - -void SetupBoard(void); - #endif /* _RAWDSP_H_ */ -- 1.7.0.4