diff --git a/xwords4/android/XWords4/jni/utilwrapper.c b/xwords4/android/XWords4/jni/utilwrapper.c index 1b7adefd1..ed0bc12df 100644 --- a/xwords4/android/XWords4/jni/utilwrapper.c +++ b/xwords4/android/XWords4/jni/utilwrapper.c @@ -216,8 +216,7 @@ and_util_turnChanged(XW_UtilCtxt* uc) #endif static void -and_util_informMove( XW_UtilCtxt* uc, XWStreamCtxt* expl, - XWStreamCtxt* words, XP_U16 wordCount ) +and_util_informMove( XW_UtilCtxt* uc, XWStreamCtxt* expl, XWStreamCtxt* words ) { UTIL_CBK_HEADER( "informMove", "(Ljava/lang/String;Ljava/lang/String;)V" ); jstring jexpl = streamToJString( MPPARM(util->util.mpool) env, expl ); @@ -227,8 +226,6 @@ and_util_informMove( XW_UtilCtxt* uc, XWStreamCtxt* expl, (*env)->DeleteLocalRef( env, jexpl ); if ( !!jwords ) { (*env)->DeleteLocalRef( env, jwords ); - } else { - XP_ASSERT( 0 == wordCount ); } UTIL_CBK_TAIL(); } diff --git a/xwords4/common/model.c b/xwords4/common/model.c index 1309b56da..2023f966f 100644 --- a/xwords4/common/model.c +++ b/xwords4/common/model.c @@ -2046,19 +2046,15 @@ recordWord( const XP_UCHAR* word, XP_Bool isLegal, void* closure ) stream_putU8( stream, '\n' ); } stream_catString( stream, word ); - if ( NULL != info->nWordsP ) { - *info->nWordsP = info->nWords; - } return XP_TRUE; } WordNotifierInfo* -model_initWordCounter( ModelCtxt* model, XWStreamCtxt* stream, XP_U16* nWords ) +model_initWordCounter( ModelCtxt* model, XWStreamCtxt* stream ) { XP_ASSERT( model->vol.wni.proc == recordWord ); XP_ASSERT( model->vol.wni.closure == &model->vol.rwi ); model->vol.rwi.stream = stream; - model->vol.rwi.nWordsP = nWords; model->vol.rwi.nWords = 0; return &model->vol.wni; } @@ -2078,7 +2074,7 @@ model_getWordsPlayed( ModelCtxt* model, XP_U16 nTurns, XWStreamCtxt* stream ) } if ( model_undoLatestMoves( model, NULL, nTurns, NULL, NULL ) ) { - WordNotifierInfo* ni = model_initWordCounter( model, stream, NULL ); + WordNotifierInfo* ni = model_initWordCounter( model, stream ); /* Now push the undone moves back into the model one at a time. recordWord() will add each played word to the stream as it's scored */ diff --git a/xwords4/common/model.h b/xwords4/common/model.h index c62342b10..b24b2371f 100644 --- a/xwords4/common/model.h +++ b/xwords4/common/model.h @@ -272,8 +272,7 @@ XP_U16 figureMoveScore( const ModelCtxt* model, XP_U16 turn, MoveInfo* mvInfo, WordNotifierInfo* notifyInfo ); /* tap into internal WordNotifierInfo */ -WordNotifierInfo* model_initWordCounter( ModelCtxt* model, XWStreamCtxt* stream, - XP_U16* nWords ); +WordNotifierInfo* model_initWordCounter( ModelCtxt* model, XWStreamCtxt* stream ); /********************* persistence ********************/ #ifdef INCLUDE_IO_SUPPORT diff --git a/xwords4/common/modelp.h b/xwords4/common/modelp.h index 2d1085400..f9b15db7d 100644 --- a/xwords4/common/modelp.h +++ b/xwords4/common/modelp.h @@ -45,7 +45,6 @@ typedef struct PlayerCtxt { typedef struct _RecordWordsInfo { XWStreamCtxt* stream; - XP_U16* nWordsP; XP_U16 nWords; } RecordWordsInfo; diff --git a/xwords4/common/server.c b/xwords4/common/server.c index e4a1e0c5f..ab972158c 100644 --- a/xwords4/common/server.c +++ b/xwords4/common/server.c @@ -93,7 +93,6 @@ typedef struct ServerNonvolatiles { RemoteAddress addresses[MAX_NUM_PLAYERS]; XWStreamCtxt* prevMoveStream; /* save it to print later */ XWStreamCtxt* prevWordsStream; - XP_U16 prevWordCount; } ServerNonvolatiles; struct ServerCtxt { @@ -758,8 +757,7 @@ makeRobotMove( ServerCtxt* server ) if ( !!stream ) { XWStreamCtxt* wordsStream = mkServerStream( server ); WordNotifierInfo* ni = - model_initWordCounter( model, wordsStream, - &server->nv.prevWordCount ); + model_initWordCounter( model, wordsStream ); (void)model_checkMoveLegal( model, turn, stream, ni ); XP_ASSERT( !server->nv.prevMoveStream ); server->nv.prevMoveStream = stream; @@ -870,8 +868,7 @@ showPrevScore( ServerCtxt* server ) stream_destroy( prevStream ); } - util_informMove( util, stream, server->nv.prevWordsStream, - server->nv.prevWordCount ); + util_informMove( util, stream, server->nv.prevWordsStream ); stream_destroy( stream ); stream_destroy( server->nv.prevWordsStream ); server->nv.prevWordsStream = NULL; @@ -1879,9 +1876,7 @@ makeMoveReportIf( ServerCtxt* server, XWStreamCtxt** wordsStream ) ModelCtxt* model = server->vol.model; stream = mkServerStream( server ); *wordsStream = mkServerStream( server ); - WordNotifierInfo* ni = - model_initWordCounter( model, *wordsStream, - &server->nv.prevWordCount ); + WordNotifierInfo* ni = model_initWordCounter( model, *wordsStream ); (void)model_checkMoveLegal( model, server->nv.currentTurn, stream, ni ); } return stream; diff --git a/xwords4/common/util.h b/xwords4/common/util.h index bee096c4d..4ba082f01 100644 --- a/xwords4/common/util.h +++ b/xwords4/common/util.h @@ -131,7 +131,7 @@ typedef struct UtilVtable { void (*m_util_turnChanged)(XW_UtilCtxt* uc); #endif void (*m_util_informMove)( XW_UtilCtxt* uc, XWStreamCtxt* expl, - XWStreamCtxt* words, XP_U16 wordCount ); + XWStreamCtxt* words ); void (*m_util_notifyGameOver)( XW_UtilCtxt* uc ); XP_Bool (*m_util_hiliteCell)( XW_UtilCtxt* uc, XP_U16 col, XP_U16 row ); @@ -228,8 +228,8 @@ struct XW_UtilCtxt { # define util_turnChanged( uc ) #endif -#define util_informMove(uc,e,w,wc) \ - (uc)->vtable->m_util_informMove( (uc),(e),(w),(wc) ) +#define util_informMove(uc,e,w) \ + (uc)->vtable->m_util_informMove( (uc),(e),(w)) #define util_notifyGameOver( uc ) \ (uc)->vtable->m_util_notifyGameOver((uc)) diff --git a/xwords4/linux/cursesmain.c b/xwords4/linux/cursesmain.c index 0bc9548b4..3e9dde4f9 100644 --- a/xwords4/linux/cursesmain.c +++ b/xwords4/linux/cursesmain.c @@ -333,8 +333,7 @@ cursesShowFinalScores( CursesAppGlobals* globals ) static void curses_util_informMove( XW_UtilCtxt* uc, XWStreamCtxt* expl, - XWStreamCtxt* XP_UNUSED(words), - XP_U16 XP_UNUSED(wordCount) ) + XWStreamCtxt* XP_UNUSED(words)) { CursesAppGlobals* globals = (CursesAppGlobals*)uc->closure; char* question = strFromStream( expl ); diff --git a/xwords4/linux/gtkmain.c b/xwords4/linux/gtkmain.c index 8f04378d1..01fd16e61 100644 --- a/xwords4/linux/gtkmain.c +++ b/xwords4/linux/gtkmain.c @@ -1388,9 +1388,8 @@ gtkShowFinalScores( const CommonGlobals* cGlobals ) static void gtk_util_informMove( XW_UtilCtxt* XP_UNUSED(uc), XWStreamCtxt* XP_UNUSED(expl), - XWStreamCtxt* words, XP_U16 wordCount ) + XWStreamCtxt* words ) { - XP_LOGF( "%s(wordCount=%d)", __func__, wordCount ); char* question = strFromStream( words/*expl*/ ); (void)gtkask( question, GTK_BUTTONS_OK ); free( question );