remove unused param (on the C/jni side)

This commit is contained in:
Andy2 2011-10-04 18:54:53 -07:00
parent 3ec97d5c07
commit dc20b04a4c
8 changed files with 12 additions and 28 deletions

View file

@ -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();
}

View file

@ -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 */

View file

@ -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

View file

@ -45,7 +45,6 @@ typedef struct PlayerCtxt {
typedef struct _RecordWordsInfo {
XWStreamCtxt* stream;
XP_U16* nWordsP;
XP_U16 nWords;
} RecordWordsInfo;

View file

@ -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;

View file

@ -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))

View file

@ -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 );

View file

@ -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 );