mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-08 20:46:12 +01:00
fix logging macro to allow a single argument
This commit is contained in:
parent
4d63604a84
commit
674b9dbccf
9 changed files with 13 additions and 13 deletions
|
@ -964,7 +964,7 @@ comms_writeToStream( CommsCtxt* comms, XWStreamCtxt* stream,
|
||||||
static void
|
static void
|
||||||
resetBackoff( CommsCtxt* comms )
|
resetBackoff( CommsCtxt* comms )
|
||||||
{
|
{
|
||||||
XP_LOGFF( "%s", "resetting backoff" );
|
XP_LOGFF( "resetting backoff" );
|
||||||
comms->resendBackoff = 0;
|
comms->resendBackoff = 0;
|
||||||
comms->nextResend = 0;
|
comms->nextResend = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -309,7 +309,7 @@ typedef struct _PlayerDicts {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define LOG_FUNC() XP_LOGFF( "%s", "IN" )
|
#define LOG_FUNC() XP_LOGFF( "IN" )
|
||||||
#define LOG_RETURNF(fmt, ...) XP_LOGFF( "OUT: => " fmt, __VA_ARGS__ )
|
#define LOG_RETURNF(fmt, ...) XP_LOGFF( "OUT: => " fmt, __VA_ARGS__ )
|
||||||
#define LOG_RETURN_VOID() LOG_RETURNF("%s","void")
|
#define LOG_RETURN_VOID() LOG_RETURNF("%s","void")
|
||||||
#define XP_LOGLOC() XP_LOGF( "%s(), line %d", __func__, __LINE__ )
|
#define XP_LOGLOC() XP_LOGF( "%s(), line %d", __func__, __LINE__ )
|
||||||
|
|
|
@ -559,7 +559,7 @@ engine_findMove( EngineCtxt* engine, const ModelCtxt* model,
|
||||||
engine_reset( engine );
|
engine_reset( engine );
|
||||||
if ( !isRetry ) {
|
if ( !isRetry ) {
|
||||||
isRetry = XP_TRUE;
|
isRetry = XP_TRUE;
|
||||||
XP_LOGFF( "%s", "no moves found so retrying" );
|
XP_LOGFF( "no moves found so retrying" );
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2530,7 +2530,7 @@ nextTurn( ServerCtxt* server, XP_S16 nxtTurn )
|
||||||
nxtTurn = model_getNextTurn( server->vol.model );
|
nxtTurn = model_getNextTurn( server->vol.model );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
XP_LOGFF( "%s", "turn == -1 so dropping" );
|
XP_LOGFF( "turn == -1 so dropping" );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* We're doing an undo, and so won't bother figuring out who the
|
/* We're doing an undo, and so won't bother figuring out who the
|
||||||
|
@ -2552,7 +2552,7 @@ nextTurn( ServerCtxt* server, XP_S16 nxtTurn )
|
||||||
SETSTATE( server, XWSTATE_NEEDSEND_ENDGAME ); /* this is it */
|
SETSTATE( server, XWSTATE_NEEDSEND_ENDGAME ); /* this is it */
|
||||||
moreToDo = XP_TRUE;
|
moreToDo = XP_TRUE;
|
||||||
} else if ( currentTurn >= 0 ) {
|
} else if ( currentTurn >= 0 ) {
|
||||||
XP_LOGFF( "%s", "Doing nothing; waiting for server to end game" );
|
XP_LOGFF( "Doing nothing; waiting for server to end game" );
|
||||||
setTurn( server, -1 );
|
setTurn( server, -1 );
|
||||||
/* I'm the client. Do ++nothing++. */
|
/* I'm the client. Do ++nothing++. */
|
||||||
}
|
}
|
||||||
|
@ -2930,7 +2930,7 @@ reflectMove( ServerCtxt* server, XWStreamCtxt* stream )
|
||||||
XP_LOGFF( "BAD: currentTurn %d < 0", server->nv.currentTurn );
|
XP_LOGFF( "BAD: currentTurn %d < 0", server->nv.currentTurn );
|
||||||
} else if ( ! readMoveInfo( server, stream, &whoMoved, &isTrade, &newTiles,
|
} else if ( ! readMoveInfo( server, stream, &whoMoved, &isTrade, &newTiles,
|
||||||
&tradedTiles, &isLegal, &badStack ) ) { /* modifies model */
|
&tradedTiles, &isLegal, &badStack ) ) { /* modifies model */
|
||||||
XP_LOGFF( "%s", "BAD: readMoveInfo() failed" );
|
XP_LOGFF( "BAD: readMoveInfo() failed" );
|
||||||
} else {
|
} else {
|
||||||
moveOk = XP_TRUE;
|
moveOk = XP_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -4072,7 +4072,7 @@ server_receiveMessage( ServerCtxt* server, XWStreamCtxt* incoming )
|
||||||
XP_LOGF( "%s: somebody's registering!!!", __func__ );
|
XP_LOGF( "%s: somebody's registering!!!", __func__ );
|
||||||
accepted = handleRegistrationMsg( server, incoming );
|
accepted = handleRegistrationMsg( server, incoming );
|
||||||
} else {
|
} else {
|
||||||
XP_LOGFF( "%s", "WTF: I'm not a server!!" );
|
XP_LOGFF( "WTF: I'm not a server!!" );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XWPROTO_CLIENT_SETUP:
|
case XWPROTO_CLIENT_SETUP:
|
||||||
|
|
|
@ -648,7 +648,7 @@ savePartials( SMSProto* state )
|
||||||
|
|
||||||
XP_U16 newSize = stream_getSize( stream );
|
XP_U16 newSize = stream_getSize( stream );
|
||||||
if ( state->lastStoredSize == 2 && newSize == 2 ) {
|
if ( state->lastStoredSize == 2 && newSize == 2 ) {
|
||||||
XP_LOGFF( "%s", "not storing empty again" );
|
XP_LOGFF( "not storing empty again" );
|
||||||
} else {
|
} else {
|
||||||
dutil_storeStream( state->dutil, KEY_PARTIALS, stream );
|
dutil_storeStream( state->dutil, KEY_PARTIALS, stream );
|
||||||
state->lastStoredSize = newSize;
|
state->lastStoredSize = newSize;
|
||||||
|
|
|
@ -1297,7 +1297,7 @@ cursesDevIDReceived( void* closure, const XP_UCHAR* devID,
|
||||||
}
|
}
|
||||||
(void)g_timeout_add_seconds( maxInterval, keepalive_timer, aGlobals );
|
(void)g_timeout_add_seconds( maxInterval, keepalive_timer, aGlobals );
|
||||||
} else {
|
} else {
|
||||||
XP_LOGFF( "%s", "bad relayid" );
|
XP_LOGFF( "bad relayid" );
|
||||||
db_remove( pDb, KEY_RDEVID );
|
db_remove( pDb, KEY_RDEVID );
|
||||||
|
|
||||||
DevIDType typ;
|
DevIDType typ;
|
||||||
|
|
|
@ -771,7 +771,7 @@ secondTimerFired( gpointer data )
|
||||||
XP_U16 undoRatio = cGlobals->params->undoRatio;
|
XP_U16 undoRatio = cGlobals->params->undoRatio;
|
||||||
if ( 0 != undoRatio ) {
|
if ( 0 != undoRatio ) {
|
||||||
if ( (XP_RANDOM() % 1000) < undoRatio ) {
|
if ( (XP_RANDOM() % 1000) < undoRatio ) {
|
||||||
XP_LOGFF( "%s", "calling server_handleUndo()" );
|
XP_LOGFF( "calling server_handleUndo()" );
|
||||||
if ( server_handleUndo( game->server, 1 ) ) {
|
if ( server_handleUndo( game->server, 1 ) ) {
|
||||||
board_draw( game->board );
|
board_draw( game->board );
|
||||||
}
|
}
|
||||||
|
|
|
@ -678,7 +678,7 @@ process( RelayConStorage* storage, XP_U8* buf, ssize_t nRead )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XWPDEV_GOTINVITE: {
|
case XWPDEV_GOTINVITE: {
|
||||||
XP_LOGFF( "%s", "got XWPDEV_GOTINVITE" );
|
XP_LOGFF( "got XWPDEV_GOTINVITE" );
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
XP_U32 sender =
|
XP_U32 sender =
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -78,7 +78,7 @@ extern void linux_debugf(const char*, ...)
|
||||||
extern void linux_debugff(const char* func, const char* file, const char* fmt, ...)
|
extern void linux_debugff(const char* func, const char* file, const char* fmt, ...)
|
||||||
__attribute__ ((format (printf, 3, 4)));
|
__attribute__ ((format (printf, 3, 4)));
|
||||||
# define XP_LOGFF( FMT, ... ) \
|
# define XP_LOGFF( FMT, ... ) \
|
||||||
linux_debugff( __func__, __FILE__, FMT, __VA_ARGS__ )
|
linux_debugff( __func__, __FILE__, FMT, ##__VA_ARGS__ )
|
||||||
#define XP_LOG(STR) \
|
#define XP_LOG(STR) \
|
||||||
linux_debugff( __func__, __FILE__, "%s", STR )
|
linux_debugff( __func__, __FILE__, "%s", STR )
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ void linux_lowerstr( XP_UCHAR* str );
|
||||||
#define XP_ABS(a) ((a)>=0?(a):-(a))
|
#define XP_ABS(a) ((a)>=0?(a):-(a))
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
# define XP_ASSERT(B) do { if (!(B)) { XP_LOGFF( "%s", "firing assert"); } assert(B); } while (0)
|
# define XP_ASSERT(B) do { if (!(B)) { XP_LOGFF( "firing assert"); } assert(B); } while (0)
|
||||||
void linux_backtrace( void );
|
void linux_backtrace( void );
|
||||||
# define XP_BACKTRACE linux_backtrace
|
# define XP_BACKTRACE linux_backtrace
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Reference in a new issue