mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
Merge branch 'android_branch' into android_dictname
This commit is contained in:
commit
4325d4e709
3 changed files with 16 additions and 12 deletions
|
@ -239,7 +239,7 @@
|
|||
<!-- -->
|
||||
<item>Viccionari</item>
|
||||
<item>:ca:</item>
|
||||
<item>http://ca.m.wiktionary.org/wiki/%2$s</item>
|
||||
<item>http://ca.wiktionary.org/w/index.php?search=%2$s</item>
|
||||
<!-- -->
|
||||
<item>Google</item>
|
||||
<item></item> <!-- means all supported -->
|
||||
|
|
|
@ -37,6 +37,7 @@ typedef struct MemPoolEntry {
|
|||
XP_U32 lineNo;
|
||||
XP_U32 size;
|
||||
void* ptr;
|
||||
XP_U16 index;
|
||||
} MemPoolEntry;
|
||||
|
||||
struct MemPoolCtx {
|
||||
|
@ -97,14 +98,16 @@ void
|
|||
mpool_destroy( MemPoolCtx* mpool )
|
||||
{
|
||||
if ( mpool->nUsed > 0 ) {
|
||||
XP_WARNF( "leaking %d blocks", mpool->nUsed );
|
||||
XP_WARNF( "leaking %d blocks (of %d allocs)", mpool->nUsed,
|
||||
mpool->nAllocs );
|
||||
}
|
||||
if ( !!mpool->usedList ) {
|
||||
MemPoolEntry* entry;
|
||||
for ( entry = mpool->usedList; !!entry; entry = entry->next ) {
|
||||
#ifndef FOR_GREMLINS /* I don't want to hear about this right now */
|
||||
XP_LOGF( "%s: " XP_P " in %s, ln %ld of %s\n", __func__,
|
||||
entry->ptr, entry->func, entry->lineNo, entry->fileName );
|
||||
XP_LOGF( "%s: " XP_P " index=%d, in %s, ln %ld of %s\n", __func__,
|
||||
entry->ptr, entry->index,
|
||||
entry->func, entry->lineNo, entry->fileName );
|
||||
#ifdef DEBUG
|
||||
{
|
||||
char* tryTxt;
|
||||
|
@ -149,13 +152,13 @@ mpool_alloc( MemPoolCtx* mpool, XP_U32 size, const char* file,
|
|||
entry->size = size;
|
||||
entry->ptr = XP_PLATMALLOC( size );
|
||||
XP_ASSERT( !!entry->ptr );
|
||||
entry->index = ++mpool->nAllocs;
|
||||
|
||||
++mpool->nUsed;
|
||||
++mpool->nAllocs;
|
||||
|
||||
#ifdef MPOOL_DEBUG
|
||||
XP_LOGF( "%s(size=%ld,file=%s,lineNo=%ld)=>%p",
|
||||
__func__, size, file, lineNo, entry->ptr );
|
||||
XP_LOGF( "%s(size=%ld,index=%d,file=%s,lineNo=%ld)=>%p",
|
||||
__func__, size, entry->index, file, lineNo, entry->ptr );
|
||||
#endif
|
||||
|
||||
return entry->ptr;
|
||||
|
@ -226,8 +229,8 @@ mpool_free( MemPoolCtx* mpool, void* ptr, const char* file,
|
|||
} else {
|
||||
|
||||
#ifdef MPOOL_DEBUG
|
||||
XP_LOGF( "%s(ptr=%p):size=%ld,func=%s,file=%s,lineNo=%ld)", __func__,
|
||||
entry->ptr, entry->size, entry->func, entry->fileName,
|
||||
XP_LOGF( "%s(ptr=%p):size=%ld,index=%d,func=%s,file=%s,lineNo=%ld)", __func__,
|
||||
entry->ptr, entry->size, entry->index, entry->func, entry->fileName,
|
||||
entry->lineNo );
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1404,7 +1404,6 @@ server_sendInitialMessage( ServerCtxt* server )
|
|||
static void
|
||||
freeBWI( MPFORMAL BadWordInfo* bwi )
|
||||
{
|
||||
/* BadWordInfo* bwi = &server->illegalWordInfo; */
|
||||
XP_U16 nWords = bwi->nWords;
|
||||
|
||||
while ( nWords-- ) {
|
||||
|
@ -1884,7 +1883,7 @@ storeBadWords( const XP_UCHAR* word, XP_Bool isLegal,
|
|||
if ( !isLegal ) {
|
||||
ServerCtxt* server = (ServerCtxt*)closure;
|
||||
|
||||
XP_STATUSF( "storeBadWords called with \"%s\"", word );
|
||||
XP_LOGF( "storeBadWords called with \"%s\"", word );
|
||||
|
||||
server->illegalWordInfo.words[server->illegalWordInfo.nWords++]
|
||||
= copyString( server->mpool, word );
|
||||
|
@ -2115,7 +2114,9 @@ reflectMoveAndInform( ServerCtxt* server, XWStreamCtxt* stream )
|
|||
(TrayTileSet*)NULL, sourceClientIndex );
|
||||
|
||||
server->vol.showPrevMove = XP_TRUE;
|
||||
mvStream = makeMoveReportIf( server, &wordsStream );
|
||||
if ( isLegalMove ) {
|
||||
mvStream = makeMoveReportIf( server, &wordsStream );
|
||||
}
|
||||
|
||||
success = model_commitTurn( model, whoMoved, &newTiles );
|
||||
resetEngines( server );
|
||||
|
|
Loading…
Add table
Reference in a new issue