From 2a34cd1e050dfa4d621578e0083ffb52bdc7e282 Mon Sep 17 00:00:00 2001 From: Andy2 Date: Wed, 21 Dec 2011 18:45:05 -0800 Subject: [PATCH] remove second param from server_do() -- it doesn't work anyway. --- xwords4/android/XWords4/jni/xwjni.c | 9 ++++----- xwords4/common/server.c | 6 ++---- xwords4/common/server.h | 2 +- xwords4/linux/cursesmain.c | 4 ++-- xwords4/linux/gtkmain.c | 10 +++++----- xwords4/linux/linuxmain.c | 14 ++++++-------- 6 files changed, 20 insertions(+), 25 deletions(-) diff --git a/xwords4/android/XWords4/jni/xwjni.c b/xwords4/android/XWords4/jni/xwjni.c index 53980056f..65cb7a6e7 100644 --- a/xwords4/android/XWords4/jni/xwjni.c +++ b/xwords4/android/XWords4/jni/xwjni.c @@ -798,7 +798,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_server_1do { jboolean result; XWJNI_START(); - result = server_do( state->game.server, NULL ); + result = server_do( state->game.server ); XWJNI_END(); return result; } @@ -1043,7 +1043,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1receiveMessage /* XP_Bool notDone; */ /* in case work's pending */ /* for ( notDone = XP_TRUE; notDone; ) { */ - (void)server_do( server, NULL ); + (void)server_do( server ); /* } */ (void)server_receiveMessage( server, stream ); /* in case MORE work's pending. Multiple calls are required in at @@ -1052,9 +1052,8 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1receiveMessage robot move. That's because comms can't detect a duplicate initial packet (in validateInitialMessage()). */ int ii; - XP_Bool notDone; - for ( ii = 0, notDone = XP_TRUE; notDone && ii < 5; ++ii ) { - (void)server_do( server, ¬Done ); + for ( ii = 0; ii < 5; ++ii ) { + (void)server_do( server ); } } diff --git a/xwords4/common/server.c b/xwords4/common/server.c index cb05257a1..7488b5b9b 100644 --- a/xwords4/common/server.c +++ b/xwords4/common/server.c @@ -964,7 +964,7 @@ showPrevScore( ServerCtxt* server ) } /* showPrevScore */ XP_Bool -server_do( ServerCtxt* server, XP_Bool* moreToDoP ) +server_do( ServerCtxt* server ) { XP_Bool result = XP_TRUE; @@ -1038,9 +1038,7 @@ server_do( ServerCtxt* server, XP_Bool* moreToDoP ) break; } /* switch */ - if ( NULL != moreToDoP ) { - *moreToDoP = moreToDo; - } else if ( moreToDo ) { + if ( moreToDo ) { util_requestTime( server->vol.util ); } diff --git a/xwords4/common/server.h b/xwords4/common/server.h index f04f8ba52..5851a5933 100644 --- a/xwords4/common/server.h +++ b/xwords4/common/server.h @@ -98,7 +98,7 @@ XP_U16 server_getMissingPlayers( const ServerCtxt* server ); /* Signed in case no dictionary available */ XP_S16 server_countTilesInPool( ServerCtxt* server ); -XP_Bool server_do( ServerCtxt* server, XP_Bool* moreToDoP ); +XP_Bool server_do( ServerCtxt* server ); XP_Bool server_commitMove( ServerCtxt* server ); XP_Bool server_commitTrade( ServerCtxt* server, const TrayTileSet* oldTiles ); diff --git a/xwords4/linux/cursesmain.c b/xwords4/linux/cursesmain.c index 5bb0ab7fd..6a0a637cb 100644 --- a/xwords4/linux/cursesmain.c +++ b/xwords4/linux/cursesmain.c @@ -450,7 +450,7 @@ static gboolean onetime_idle( gpointer data ) { CursesAppGlobals* globals = (CursesAppGlobals*)data; - if ( server_do( globals->cGlobals.game.server, NULL ) ) { + if ( server_do( globals->cGlobals.game.server ) ) { if ( !!globals->cGlobals.game.board ) { board_draw( globals->cGlobals.game.board ); } @@ -1841,7 +1841,7 @@ cursesmain( XP_Bool isServer, LaunchParams* params ) } #endif - server_do( g_globals.cGlobals.game.server, NULL ); + server_do( g_globals.cGlobals.game.server ); g_globals.menuList = g_boardMenuList; drawMenuLargeOrSmall( &g_globals, g_boardMenuList ); diff --git a/xwords4/linux/gtkmain.c b/xwords4/linux/gtkmain.c index a58aadfc1..db775bf57 100644 --- a/xwords4/linux/gtkmain.c +++ b/xwords4/linux/gtkmain.c @@ -511,7 +511,7 @@ createOrLoadObjects( GtkAppGlobals* globals ) comms_start( globals->cGlobals.game.comms ); } #endif - server_do( globals->cGlobals.game.server, NULL ); + server_do( globals->cGlobals.game.server ); disenable_buttons( globals ); } /* createOrLoadObjects */ @@ -823,7 +823,7 @@ new_game_impl( GtkAppGlobals* globals, XP_Bool fireConnDlg ) stream ); } #endif - (void)server_do( globals->cGlobals.game.server, NULL ); /* assign tiles, etc. */ + (void)server_do( globals->cGlobals.game.server ); /* assign tiles, etc. */ board_invalAll( globals->cGlobals.game.board ); board_draw( globals->cGlobals.game.board ); } @@ -845,7 +845,7 @@ game_info( GtkWidget* XP_UNUSED(widget), GtkAppGlobals* globals ) /* Anything to do if OK is clicked? Changed names etc. already saved. Try server_do in case one's become a robot. */ if ( newGameDialog( globals, &addr, XP_FALSE, XP_FALSE ) ) { - if ( server_do( globals->cGlobals.game.server, NULL ) ) { + if ( server_do( globals->cGlobals.game.server ) ) { board_draw( globals->cGlobals.game.board ); } } @@ -1603,7 +1603,7 @@ idle_func( gpointer data ) and bad things can happen. So kill the idle proc asap. */ gtk_idle_remove( globals->idleID ); - if ( server_do( globals->cGlobals.game.server, NULL ) ) { + if ( server_do( globals->cGlobals.game.server ) ) { if ( !!globals->cGlobals.game.board ) { board_draw( globals->cGlobals.game.board ); } @@ -2059,7 +2059,7 @@ newConnectionInput( GIOChannel *source, if ( redraw ) { gtk_util_requestTime( globals->cGlobals.params->util ); } else { - redraw = server_do( globals->cGlobals.game.server, NULL ); + redraw = server_do( globals->cGlobals.game.server ); } if ( redraw ) { board_draw( globals->cGlobals.game.board ); diff --git a/xwords4/linux/linuxmain.c b/xwords4/linux/linuxmain.c index c29327319..7169d1ebc 100644 --- a/xwords4/linux/linuxmain.c +++ b/xwords4/linux/linuxmain.c @@ -240,13 +240,12 @@ handle_messages_from( CommonGlobals* cGlobals, const TransportProcs* procs, if ( comms_checkIncomingStream( cGlobals->game.comms, stream, NULL ) ) { ServerCtxt* server = cGlobals->game.server; - (void)server_do( server, NULL ); + (void)server_do( server ); handled = server_receiveMessage( server, stream ) || handled; - XP_Bool notDone; XP_U16 ii; - for ( ii = 0, notDone = XP_TRUE; notDone && ii < 5; ++ii ) { - (void)server_do( server, ¬Done ); + for ( ii = 0; ii < 5; ++ii ) { + (void)server_do( server ); } } stream_destroy( stream ); @@ -305,13 +304,12 @@ read_pipe_then_close( CommonGlobals* cGlobals, const TransportProcs* procs ) if ( comms_checkIncomingStream( cGlobals->game.comms, stream, NULL ) ) { ServerCtxt* server = cGlobals->game.server; - (void)server_do( server, NULL ); + (void)server_do( server ); handled = server_receiveMessage( server, stream ) || handled; - XP_Bool notDone; XP_U16 ii; - for ( ii = 0, notDone = XP_TRUE; notDone && ii < 5; ++ii ) { - (void)server_do( server, ¬Done ); + for ( ii = 0; ii < 5; ++ii ) { + (void)server_do( server ); } } stream_destroy( stream );