mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-11 08:48:06 +01:00
remove unused param (on the C/jni side)
This commit is contained in:
parent
3ec97d5c07
commit
dc20b04a4c
8 changed files with 12 additions and 28 deletions
|
@ -216,8 +216,7 @@ and_util_turnChanged(XW_UtilCtxt* uc)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
and_util_informMove( XW_UtilCtxt* uc, XWStreamCtxt* expl,
|
and_util_informMove( XW_UtilCtxt* uc, XWStreamCtxt* expl, XWStreamCtxt* words )
|
||||||
XWStreamCtxt* words, XP_U16 wordCount )
|
|
||||||
{
|
{
|
||||||
UTIL_CBK_HEADER( "informMove", "(Ljava/lang/String;Ljava/lang/String;)V" );
|
UTIL_CBK_HEADER( "informMove", "(Ljava/lang/String;Ljava/lang/String;)V" );
|
||||||
jstring jexpl = streamToJString( MPPARM(util->util.mpool) env, expl );
|
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 );
|
(*env)->DeleteLocalRef( env, jexpl );
|
||||||
if ( !!jwords ) {
|
if ( !!jwords ) {
|
||||||
(*env)->DeleteLocalRef( env, jwords );
|
(*env)->DeleteLocalRef( env, jwords );
|
||||||
} else {
|
|
||||||
XP_ASSERT( 0 == wordCount );
|
|
||||||
}
|
}
|
||||||
UTIL_CBK_TAIL();
|
UTIL_CBK_TAIL();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2046,19 +2046,15 @@ recordWord( const XP_UCHAR* word, XP_Bool isLegal, void* closure )
|
||||||
stream_putU8( stream, '\n' );
|
stream_putU8( stream, '\n' );
|
||||||
}
|
}
|
||||||
stream_catString( stream, word );
|
stream_catString( stream, word );
|
||||||
if ( NULL != info->nWordsP ) {
|
|
||||||
*info->nWordsP = info->nWords;
|
|
||||||
}
|
|
||||||
return XP_TRUE;
|
return XP_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
WordNotifierInfo*
|
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.proc == recordWord );
|
||||||
XP_ASSERT( model->vol.wni.closure == &model->vol.rwi );
|
XP_ASSERT( model->vol.wni.closure == &model->vol.rwi );
|
||||||
model->vol.rwi.stream = stream;
|
model->vol.rwi.stream = stream;
|
||||||
model->vol.rwi.nWordsP = nWords;
|
|
||||||
model->vol.rwi.nWords = 0;
|
model->vol.rwi.nWords = 0;
|
||||||
return &model->vol.wni;
|
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 ) ) {
|
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.
|
/* 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
|
recordWord() will add each played word to the stream as it's
|
||||||
scored */
|
scored */
|
||||||
|
|
|
@ -272,8 +272,7 @@ XP_U16 figureMoveScore( const ModelCtxt* model, XP_U16 turn, MoveInfo* mvInfo,
|
||||||
WordNotifierInfo* notifyInfo );
|
WordNotifierInfo* notifyInfo );
|
||||||
|
|
||||||
/* tap into internal WordNotifierInfo */
|
/* tap into internal WordNotifierInfo */
|
||||||
WordNotifierInfo* model_initWordCounter( ModelCtxt* model, XWStreamCtxt* stream,
|
WordNotifierInfo* model_initWordCounter( ModelCtxt* model, XWStreamCtxt* stream );
|
||||||
XP_U16* nWords );
|
|
||||||
|
|
||||||
/********************* persistence ********************/
|
/********************* persistence ********************/
|
||||||
#ifdef INCLUDE_IO_SUPPORT
|
#ifdef INCLUDE_IO_SUPPORT
|
||||||
|
|
|
@ -45,7 +45,6 @@ typedef struct PlayerCtxt {
|
||||||
|
|
||||||
typedef struct _RecordWordsInfo {
|
typedef struct _RecordWordsInfo {
|
||||||
XWStreamCtxt* stream;
|
XWStreamCtxt* stream;
|
||||||
XP_U16* nWordsP;
|
|
||||||
XP_U16 nWords;
|
XP_U16 nWords;
|
||||||
} RecordWordsInfo;
|
} RecordWordsInfo;
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,6 @@ typedef struct ServerNonvolatiles {
|
||||||
RemoteAddress addresses[MAX_NUM_PLAYERS];
|
RemoteAddress addresses[MAX_NUM_PLAYERS];
|
||||||
XWStreamCtxt* prevMoveStream; /* save it to print later */
|
XWStreamCtxt* prevMoveStream; /* save it to print later */
|
||||||
XWStreamCtxt* prevWordsStream;
|
XWStreamCtxt* prevWordsStream;
|
||||||
XP_U16 prevWordCount;
|
|
||||||
} ServerNonvolatiles;
|
} ServerNonvolatiles;
|
||||||
|
|
||||||
struct ServerCtxt {
|
struct ServerCtxt {
|
||||||
|
@ -758,8 +757,7 @@ makeRobotMove( ServerCtxt* server )
|
||||||
if ( !!stream ) {
|
if ( !!stream ) {
|
||||||
XWStreamCtxt* wordsStream = mkServerStream( server );
|
XWStreamCtxt* wordsStream = mkServerStream( server );
|
||||||
WordNotifierInfo* ni =
|
WordNotifierInfo* ni =
|
||||||
model_initWordCounter( model, wordsStream,
|
model_initWordCounter( model, wordsStream );
|
||||||
&server->nv.prevWordCount );
|
|
||||||
(void)model_checkMoveLegal( model, turn, stream, ni );
|
(void)model_checkMoveLegal( model, turn, stream, ni );
|
||||||
XP_ASSERT( !server->nv.prevMoveStream );
|
XP_ASSERT( !server->nv.prevMoveStream );
|
||||||
server->nv.prevMoveStream = stream;
|
server->nv.prevMoveStream = stream;
|
||||||
|
@ -870,8 +868,7 @@ showPrevScore( ServerCtxt* server )
|
||||||
stream_destroy( prevStream );
|
stream_destroy( prevStream );
|
||||||
}
|
}
|
||||||
|
|
||||||
util_informMove( util, stream, server->nv.prevWordsStream,
|
util_informMove( util, stream, server->nv.prevWordsStream );
|
||||||
server->nv.prevWordCount );
|
|
||||||
stream_destroy( stream );
|
stream_destroy( stream );
|
||||||
stream_destroy( server->nv.prevWordsStream );
|
stream_destroy( server->nv.prevWordsStream );
|
||||||
server->nv.prevWordsStream = NULL;
|
server->nv.prevWordsStream = NULL;
|
||||||
|
@ -1879,9 +1876,7 @@ makeMoveReportIf( ServerCtxt* server, XWStreamCtxt** wordsStream )
|
||||||
ModelCtxt* model = server->vol.model;
|
ModelCtxt* model = server->vol.model;
|
||||||
stream = mkServerStream( server );
|
stream = mkServerStream( server );
|
||||||
*wordsStream = mkServerStream( server );
|
*wordsStream = mkServerStream( server );
|
||||||
WordNotifierInfo* ni =
|
WordNotifierInfo* ni = model_initWordCounter( model, *wordsStream );
|
||||||
model_initWordCounter( model, *wordsStream,
|
|
||||||
&server->nv.prevWordCount );
|
|
||||||
(void)model_checkMoveLegal( model, server->nv.currentTurn, stream, ni );
|
(void)model_checkMoveLegal( model, server->nv.currentTurn, stream, ni );
|
||||||
}
|
}
|
||||||
return stream;
|
return stream;
|
||||||
|
|
|
@ -131,7 +131,7 @@ typedef struct UtilVtable {
|
||||||
void (*m_util_turnChanged)(XW_UtilCtxt* uc);
|
void (*m_util_turnChanged)(XW_UtilCtxt* uc);
|
||||||
#endif
|
#endif
|
||||||
void (*m_util_informMove)( XW_UtilCtxt* uc, XWStreamCtxt* expl,
|
void (*m_util_informMove)( XW_UtilCtxt* uc, XWStreamCtxt* expl,
|
||||||
XWStreamCtxt* words, XP_U16 wordCount );
|
XWStreamCtxt* words );
|
||||||
void (*m_util_notifyGameOver)( XW_UtilCtxt* uc );
|
void (*m_util_notifyGameOver)( XW_UtilCtxt* uc );
|
||||||
|
|
||||||
XP_Bool (*m_util_hiliteCell)( XW_UtilCtxt* uc, XP_U16 col, XP_U16 row );
|
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 )
|
# define util_turnChanged( uc )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define util_informMove(uc,e,w,wc) \
|
#define util_informMove(uc,e,w) \
|
||||||
(uc)->vtable->m_util_informMove( (uc),(e),(w),(wc) )
|
(uc)->vtable->m_util_informMove( (uc),(e),(w))
|
||||||
#define util_notifyGameOver( uc ) \
|
#define util_notifyGameOver( uc ) \
|
||||||
(uc)->vtable->m_util_notifyGameOver((uc))
|
(uc)->vtable->m_util_notifyGameOver((uc))
|
||||||
|
|
||||||
|
|
|
@ -333,8 +333,7 @@ cursesShowFinalScores( CursesAppGlobals* globals )
|
||||||
|
|
||||||
static void
|
static void
|
||||||
curses_util_informMove( XW_UtilCtxt* uc, XWStreamCtxt* expl,
|
curses_util_informMove( XW_UtilCtxt* uc, XWStreamCtxt* expl,
|
||||||
XWStreamCtxt* XP_UNUSED(words),
|
XWStreamCtxt* XP_UNUSED(words))
|
||||||
XP_U16 XP_UNUSED(wordCount) )
|
|
||||||
{
|
{
|
||||||
CursesAppGlobals* globals = (CursesAppGlobals*)uc->closure;
|
CursesAppGlobals* globals = (CursesAppGlobals*)uc->closure;
|
||||||
char* question = strFromStream( expl );
|
char* question = strFromStream( expl );
|
||||||
|
|
|
@ -1388,9 +1388,8 @@ gtkShowFinalScores( const CommonGlobals* cGlobals )
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_util_informMove( XW_UtilCtxt* XP_UNUSED(uc), XWStreamCtxt* XP_UNUSED(expl),
|
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*/ );
|
char* question = strFromStream( words/*expl*/ );
|
||||||
(void)gtkask( question, GTK_BUTTONS_OK );
|
(void)gtkask( question, GTK_BUTTONS_OK );
|
||||||
free( question );
|
free( question );
|
||||||
|
|
Loading…
Add table
Reference in a new issue