From 3c7af0023ec81adf1aa1984290a6813fd9af369c Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 4 Aug 2016 14:16:52 -0700 Subject: [PATCH] fix curses drawtable fallback --- xwords4/linux/Makefile | 1 - xwords4/linux/cursesdraw.c | 13 ++++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/xwords4/linux/Makefile b/xwords4/linux/Makefile index a4c914fc2..0110a0489 100644 --- a/xwords4/linux/Makefile +++ b/xwords4/linux/Makefile @@ -189,7 +189,6 @@ GTK_OBJS = \ $(BUILD_PLAT_DIR)/gtkboard.o \ $(BUILD_PLAT_DIR)/gtkdraw.o \ $(BUILD_PLAT_DIR)/gtkask.o \ - $(BUILD_PLAT_DIR)/gtkaskm.o \ $(BUILD_PLAT_DIR)/gtkletterask.o \ $(BUILD_PLAT_DIR)/gtkpasswdask.o \ $(BUILD_PLAT_DIR)/gtknewgame.o \ diff --git a/xwords4/linux/cursesdraw.c b/xwords4/linux/cursesdraw.c index 96ba6bde9..2bd0fcab8 100644 --- a/xwords4/linux/cursesdraw.c +++ b/xwords4/linux/cursesdraw.c @@ -85,7 +85,7 @@ curses_draw_boardBegin( DrawCtx* XP_UNUSED(p_dctx), DrawFocusState XP_UNUSED(dfs) ) { return XP_TRUE; -} /* draw_finish */ +} /* curses_draw_boardBegin */ static XP_Bool curses_draw_trayBegin( DrawCtx* XP_UNUSED(p_dctx), @@ -95,7 +95,7 @@ curses_draw_trayBegin( DrawCtx* XP_UNUSED(p_dctx), DrawFocusState XP_UNUSED(dfs) ) { return XP_TRUE; -} /* draw_finish */ +} /* curses_draw_trayBegin */ static XP_Bool curses_draw_scoreBegin( DrawCtx* p_dctx, const XP_Rect* rect, @@ -579,25 +579,28 @@ curses_draw_frameTray( DrawCtx* p_dctx, XP_Rect* rect ) } /* curses_draw_frameTray */ #endif -static void +static XP_Bool draw_doNothing( DrawCtx* XP_UNUSED(dctx), ... ) { + return XP_FALSE; } /* draw_doNothing */ DrawCtx* cursesDrawCtxtMake( WINDOW* boardWin ) { CursesDrawCtx* dctx = malloc( sizeof(CursesDrawCtx) ); - int ii; dctx->vtable = malloc( sizeof(*(((CursesDrawCtx*)dctx)->vtable)) ); - for ( ii = 0; ii < VSIZE(dctx->vtable); ++ii ) { + for ( int ii = 0; + ii < sizeof(*dctx->vtable)/sizeof(draw_doNothing); + ++ii ) { ((void**)(dctx->vtable))[ii] = draw_doNothing; } SET_VTABLE_ENTRY( dctx->vtable, draw_destroyCtxt, curses ); SET_VTABLE_ENTRY( dctx->vtable, draw_dictChanged, curses ); + SET_VTABLE_ENTRY( dctx->vtable, draw_boardBegin, curses ); SET_VTABLE_ENTRY( dctx->vtable, draw_objFinished, curses ); SET_VTABLE_ENTRY( dctx->vtable, draw_trayBegin, curses );