diff --git a/xwords4/common/dbgutil.c b/xwords4/common/dbgutil.c index fefb804c1..d6bbec783 100644 --- a/xwords4/common/dbgutil.c +++ b/xwords4/common/dbgutil.c @@ -94,9 +94,9 @@ dbg_logstream( const XWStreamCtxt* stream, const char* func, int line ) if ( !!stream ) { XP_U16 len = 0; XWStreamPos end = stream_getPos( stream, POS_WRITE ); - stream_copyBits( stream, 0, end, NULL, &len ); + stream_copyBits( stream, end, NULL, &len ); XP_U8 buf[len]; - stream_copyBits( stream, 0, end, buf, &len ); + stream_copyBits( stream, end, buf, &len ); char comment[128]; XP_SNPRINTF( comment, VSIZE(comment), "%s line %d", func, line ); LOG_HEX( buf, len, comment ); diff --git a/xwords4/common/memstream.c b/xwords4/common/memstream.c index 1650aa34c..4759c6ffe 100644 --- a/xwords4/common/memstream.c +++ b/xwords4/common/memstream.c @@ -186,8 +186,8 @@ mem_stream_getBits( XWStreamCtxt* p_sctx, XP_U16 nBits ) #if defined HASH_STREAM || defined DEBUG static void -mem_stream_copyBits( const XWStreamCtxt* p_sctx, XWStreamPos XP_UNUSED(startPos), - XWStreamPos endPos, XP_U8* buf, XP_U16* lenp ) +mem_stream_copyBits( const XWStreamCtxt* p_sctx, XWStreamPos endPos, + XP_U8* buf, XP_U16* lenp ) { MemStreamCtxt* stream = (MemStreamCtxt*)p_sctx; XP_U16 len = BYTE_PART(endPos); diff --git a/xwords4/common/model.c b/xwords4/common/model.c index ef5c17c4b..89d0d5981 100644 --- a/xwords4/common/model.c +++ b/xwords4/common/model.c @@ -343,7 +343,7 @@ model_hashMatches( const ModelCtxt* model, const XP_U32 hash ) } XP_Bool -model_revertToHash( ModelCtxt* model, const XP_U32 hash, PoolContext* pool ) +model_popToHash( ModelCtxt* model, const XP_U32 hash, PoolContext* pool ) { XP_U16 nPopped = 0; StackCtxt* stack = model->vol.stack; diff --git a/xwords4/common/model.h b/xwords4/common/model.h index f9e688494..85ae51fa4 100644 --- a/xwords4/common/model.h +++ b/xwords4/common/model.h @@ -124,8 +124,8 @@ void model_setSize( ModelCtxt* model, XP_U16 boardSize ); void model_destroy( ModelCtxt* model ); XP_U32 model_getHash( const ModelCtxt* model, XP_U16 version ); XP_Bool model_hashMatches( const ModelCtxt* model, XP_U32 hash ); -XP_Bool model_revertToHash( ModelCtxt* model, const XP_U32 hash, - PoolContext* pool ); +XP_Bool model_popToHash( ModelCtxt* model, const XP_U32 hash, + PoolContext* pool ); void model_setNPlayers( ModelCtxt* model, XP_U16 numPlayers ); XP_U16 model_getNPlayers( const ModelCtxt* model ); diff --git a/xwords4/common/movestak.c b/xwords4/common/movestak.c index b3b40619a..661236b8c 100644 --- a/xwords4/common/movestak.c +++ b/xwords4/common/movestak.c @@ -150,10 +150,10 @@ stack_getHash( const StackCtxt* stack ) XP_U32 hash = 0; if ( !!stack->data ) { XP_U16 len = 0; - stream_copyBits( stack->data, 0, stack->top, NULL, &len ); + stream_copyBits( stack->data, stack->top, NULL, &len ); if ( 0 < len ) { XP_U8 buf[len]; - stream_copyBits( stack->data, 0, stack->top, buf, &len ); + stream_copyBits( stack->data, stack->top, buf, &len ); #ifdef DEBUG_HASHING LOG_HEX( buf, len, __func__ ); #endif diff --git a/xwords4/common/server.c b/xwords4/common/server.c index e9f6bea8d..9da915301 100644 --- a/xwords4/common/server.c +++ b/xwords4/common/server.c @@ -2087,8 +2087,7 @@ readMoveInfo( ServerCtxt* server, XWStreamCtxt* stream, if ( STREAM_VERS_BIGBOARD <= stream_getVersion( stream ) ) { XP_U32 hashReceived = stream_getU32( stream ); success = model_hashMatches( server->vol.model, hashReceived ) - || model_revertToHash( server->vol.model, hashReceived, - server->pool ); + || model_popToHash( server->vol.model, hashReceived, server->pool ); // XP_ASSERT( success ); /* I need to understand when this can fail */ #ifdef DEBUG_HASHING if ( success ) { diff --git a/xwords4/common/xwstream.h b/xwords4/common/xwstream.h index dc5dfd060..cc6305d3a 100644 --- a/xwords4/common/xwstream.h +++ b/xwords4/common/xwstream.h @@ -49,8 +49,8 @@ typedef struct StreamCtxVTable { XP_U32 (*m_stream_getU32)( XWStreamCtxt* dctx ); XP_U32 (*m_stream_getBits)( XWStreamCtxt* dctx, XP_U16 nBits ); #if defined HASH_STREAM || defined DEBUG - void (*m_stream_copyBits)( const XWStreamCtxt* dctx, XWStreamPos startPos, - XWStreamPos endPos, XP_U8* buf, XP_U16* len ); + void (*m_stream_copyBits)( const XWStreamCtxt* dctx, XWStreamPos endPos, + XP_U8* buf, XP_U16* len ); #endif void (*m_stream_putU8)( XWStreamCtxt* dctx, XP_U8 byt ); @@ -114,8 +114,8 @@ struct XWStreamCtxt { (sc)->vtable->m_stream_getBits((sc), (n)) #if defined HASH_STREAM || defined DEBUG -#define stream_copyBits(sc, s, e, b, l) \ - (sc)->vtable->m_stream_copyBits((sc), (s), (e), (b), (l)) +#define stream_copyBits(sc, e, b, l) \ + (sc)->vtable->m_stream_copyBits((sc), (e), (b), (l)) #endif #define stream_putU8(sc, b) \