mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
use string_printf
This commit is contained in:
parent
fac3e6b678
commit
7437a71aa6
1 changed files with 5 additions and 7 deletions
|
@ -52,9 +52,9 @@ CidLock::~CidLock()
|
||||||
void
|
void
|
||||||
CidLock::print_claimed( const char* caller )
|
CidLock::print_claimed( const char* caller )
|
||||||
{
|
{
|
||||||
char buf[512] = {0};
|
|
||||||
int unclaimed = 0;
|
int unclaimed = 0;
|
||||||
int len = snprintf( buf, sizeof(buf), "after %s: ", caller );
|
string str;
|
||||||
|
string_printf( str, "after %s: ", caller );
|
||||||
// Assume we have the mutex!!!!
|
// Assume we have the mutex!!!!
|
||||||
map< CookieID, CidInfo*>::iterator iter;
|
map< CookieID, CidInfo*>::iterator iter;
|
||||||
for ( iter = m_infos.begin(); iter != m_infos.end(); ++iter ) {
|
for ( iter = m_infos.begin(); iter != m_infos.end(); ++iter ) {
|
||||||
|
@ -62,13 +62,11 @@ CidLock::print_claimed( const char* caller )
|
||||||
if ( 0 == info->GetOwner() ) {
|
if ( 0 == info->GetOwner() ) {
|
||||||
++unclaimed;
|
++unclaimed;
|
||||||
} else {
|
} else {
|
||||||
len += snprintf( &buf[len], sizeof(buf)-len, "%d,",
|
string_printf( str, "%d,", info->GetCid() );
|
||||||
info->GetCid() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
len += snprintf( &buf[len], sizeof(buf)-len, " (plus %d unclaimed.)",
|
string_printf( str, "%d,", " (plus %d unclaimed.)", unclaimed );
|
||||||
unclaimed );
|
logf( XW_LOGINFO, "%s: claimed: %s", __func__, str.c_str() );
|
||||||
logf( XW_LOGINFO, "%s: claimed: %s", __func__, buf );
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# define PRINT_CLAIMED()
|
# define PRINT_CLAIMED()
|
||||||
|
|
Loading…
Add table
Reference in a new issue