mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-27 09:58:45 +01:00
use marker enum to test for size. no code change
This commit is contained in:
parent
a72dbdd8dd
commit
c15b56199c
2 changed files with 6 additions and 4 deletions
|
@ -285,7 +285,7 @@ getNV( XWStreamCtxt* stream, ServerNonvolatiles* nv, XP_U16 nPlayers )
|
|||
++nv->nDevices;
|
||||
}
|
||||
|
||||
XP_ASSERT( XWSTATE_GAMEOVER < 1<<4 );
|
||||
XP_ASSERT( XWSTATE_LAST <= 1<<4 );
|
||||
nv->gameState = (XW_State)stream_getBits( stream, XWSTATE_NBITS );
|
||||
if ( version >= STREAM_VERS_SERVER_SAVES_TOSHOW ) {
|
||||
nv->stateAfterShow = (XW_State)stream_getBits( stream, XWSTATE_NBITS );
|
||||
|
@ -318,7 +318,7 @@ putNV( XWStreamCtxt* stream, const ServerNonvolatiles* nv, XP_U16 nPlayers )
|
|||
/* number of players is upper limit on device count */
|
||||
stream_putBits( stream, NDEVICES_NBITS, nv->nDevices-1 );
|
||||
|
||||
XP_ASSERT( XWSTATE_GAMEOVER < 1<<4 );
|
||||
XP_ASSERT( XWSTATE_LAST <= 1<<4 );
|
||||
stream_putBits( stream, XWSTATE_NBITS, nv->gameState );
|
||||
stream_putBits( stream, XWSTATE_NBITS, nv->stateAfterShow );
|
||||
|
||||
|
|
|
@ -29,10 +29,12 @@ enum {
|
|||
XWSTATE_RECEIVED_ALL_REG, /* includes waiting for dict from server */
|
||||
XWSTATE_NEEDSEND_BADWORD_INFO,
|
||||
XWSTATE_MOVE_CONFIRM_WAIT, /* client's waiting to hear back */
|
||||
XWSTATE_MOVE_CONFIRM_MUSTSEND, /* server should tell client asap */
|
||||
XWSTATE_MOVE_CONFIRM_MUSTSEND,/* server should tell client asap */
|
||||
XWSTATE_NEEDSEND_ENDGAME,
|
||||
XWSTATE_INTURN,
|
||||
XWSTATE_GAMEOVER
|
||||
XWSTATE_GAMEOVER,
|
||||
|
||||
XWSTATE_LAST /* for asserts only :-) */
|
||||
};
|
||||
typedef XP_U8 XW_State;
|
||||
#define XWSTATE_NBITS 4
|
||||
|
|
Loading…
Reference in a new issue