mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
accomodate null objects
This commit is contained in:
parent
2d17649af5
commit
37646c20f3
2 changed files with 10 additions and 7 deletions
|
@ -133,7 +133,6 @@ board_make( MPFORMAL ModelCtxt* model, ServerCtxt* server, DrawCtx* draw,
|
|||
XW_UtilCtxt* util )
|
||||
{
|
||||
BoardCtxt* result = (BoardCtxt*)XP_MALLOC( mpool, sizeof( *result ) );
|
||||
XP_ASSERT( !!draw );
|
||||
XP_ASSERT( !!server );
|
||||
XP_ASSERT( !!util );
|
||||
XP_ASSERT( !!model );
|
||||
|
@ -2995,9 +2994,10 @@ dictChanged( void* p_board, const DictionaryCtxt* oldDict,
|
|||
const DictionaryCtxt* newDict )
|
||||
{
|
||||
BoardCtxt* board = (BoardCtxt*)p_board;
|
||||
XP_ASSERT( !!board->draw );
|
||||
if ( (NULL == oldDict) || (oldDict != newDict) ) {
|
||||
draw_dictChanged( board->draw, newDict );
|
||||
if ( !!board->draw ) {
|
||||
if ( (NULL == oldDict) || (oldDict != newDict) ) {
|
||||
draw_dictChanged( board->draw, newDict );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -30,8 +30,11 @@ extern "C" {
|
|||
static void
|
||||
assertUtilOK( XW_UtilCtxt* util )
|
||||
{
|
||||
UtilVtable* vtable = util->vtable;
|
||||
XP_U16 nSlots = sizeof(vtable) / 4;
|
||||
UtilVtable* vtable;
|
||||
XP_U16 nSlots;
|
||||
XP_ASSERT( !!util );
|
||||
vtable = util->vtable;
|
||||
nSlots = sizeof(vtable) / 4;
|
||||
while ( nSlots-- ) {
|
||||
void* fptr = ((void**)vtable)[nSlots];
|
||||
XP_ASSERT( !!fptr );
|
||||
|
@ -90,7 +93,7 @@ game_makeNewGame( MPFORMAL XWGame* game, CurGameInfo* gi,
|
|||
gi->boardSize, gi->boardSize );
|
||||
|
||||
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||
if ( !!procs && gi->serverRole != SERVER_STANDALONE ) {
|
||||
if ( gi->serverRole != SERVER_STANDALONE ) {
|
||||
game->comms = comms_make( MPPARM(mpool) util,
|
||||
gi->serverRole != SERVER_ISCLIENT,
|
||||
nPlayersHere, nPlayersTotal, procs );
|
||||
|
|
Loading…
Reference in a new issue