mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
make "release" builds compile again
Release isn't really a thing on linux, but I'm fixing something that only reproduces when DEBUG is undefined.
This commit is contained in:
parent
0bccf565c6
commit
4504302b3b
7 changed files with 26 additions and 21 deletions
|
@ -2704,7 +2704,7 @@ logAddrs( const CommsCtxt* comms, const char* caller )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
augmentChannelAddr( CommsCtxt* comms, AddressRecord * const rec,
|
augmentChannelAddr( CommsCtxt* XP_UNUSED_DBG(comms), AddressRecord * const rec,
|
||||||
const CommsAddrRec* addr, XWHostID hostID )
|
const CommsAddrRec* addr, XWHostID hostID )
|
||||||
{
|
{
|
||||||
if ( !!addr ) {
|
if ( !!addr ) {
|
||||||
|
|
|
@ -1372,8 +1372,8 @@ curses_util_getVTManager(XW_UtilCtxt* uc)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
curses_util_informNeedPassword( XW_UtilCtxt* XP_UNUSED(uc),
|
curses_util_informNeedPassword( XW_UtilCtxt* XP_UNUSED(uc),
|
||||||
XP_U16 playerNum,
|
XP_U16 XP_UNUSED_DBG(playerNum),
|
||||||
const XP_UCHAR* name )
|
const XP_UCHAR* XP_UNUSED_DBG(name) )
|
||||||
{
|
{
|
||||||
XP_WARNF( "curses_util_informNeedPassword(num=%d, name=%s", playerNum, name );
|
XP_WARNF( "curses_util_informNeedPassword(num=%d, name=%s", playerNum, name );
|
||||||
} /* curses_util_askPassword */
|
} /* curses_util_askPassword */
|
||||||
|
@ -1391,7 +1391,7 @@ curses_util_yOffsetChange( XW_UtilCtxt* XP_UNUSED(uc),
|
||||||
|
|
||||||
#ifdef XWFEATURE_TURNCHANGENOTIFY
|
#ifdef XWFEATURE_TURNCHANGENOTIFY
|
||||||
static void
|
static void
|
||||||
curses_util_turnChanged( XW_UtilCtxt* XP_UNUSED(uc), XP_S16 newTurn )
|
curses_util_turnChanged( XW_UtilCtxt* XP_UNUSED(uc), XP_S16 XP_UNUSED_DBG(newTurn) )
|
||||||
{
|
{
|
||||||
XP_LOGF( "%s(turn=%d)", __func__, newTurn );
|
XP_LOGF( "%s(turn=%d)", __func__, newTurn );
|
||||||
}
|
}
|
||||||
|
@ -1725,7 +1725,7 @@ cursesGotBuf( void* closure, const CommsAddrRec* addr,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
cursesGotForRow( void* closure, const CommsAddrRec* from,
|
cursesGotForRow( void* closure, const CommsAddrRec* from,
|
||||||
sqlite3_int64 rowid, const XP_U8* buf,
|
sqlite3_int64 XP_UNUSED_DBG(rowid), const XP_U8* buf,
|
||||||
XP_U16 len )
|
XP_U16 len )
|
||||||
{
|
{
|
||||||
LOG_FUNC();
|
LOG_FUNC();
|
||||||
|
|
|
@ -31,8 +31,8 @@ static void getColumnText( sqlite3_stmt *ppStmt, int iCol, XP_UCHAR* buf,
|
||||||
int len );
|
int len );
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
static char* sqliteErr2str( int err );
|
static char* sqliteErr2str( int err );
|
||||||
static void assertPrintResult( sqlite3* pDb, int result, int expect );
|
|
||||||
#endif
|
#endif
|
||||||
|
static void assertPrintResult( sqlite3* pDb, int result, int expect );
|
||||||
|
|
||||||
sqlite3*
|
sqlite3*
|
||||||
openGamesDB( const char* dbName )
|
openGamesDB( const char* dbName )
|
||||||
|
@ -590,17 +590,15 @@ sqliteErr2str( int err )
|
||||||
}
|
}
|
||||||
return "<unknown>";
|
return "<unknown>";
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
assertPrintResult( sqlite3* pDb, int result, int expect )
|
assertPrintResult( sqlite3* pDb, int XP_UNUSED_DBG(result), int expect )
|
||||||
{
|
{
|
||||||
int code = sqlite3_errcode( pDb );
|
int code = sqlite3_errcode( pDb );
|
||||||
XP_ASSERT( code == result ); /* do I need to pass it? */
|
XP_ASSERT( code == result ); /* do I need to pass it? */
|
||||||
if ( code != expect ) {
|
if ( code != expect ) {
|
||||||
const char* msg = sqlite3_errmsg( pDb );
|
XP_LOGF( "sqlite3 error: %s", sqlite3_errmsg( pDb ) );
|
||||||
XP_LOGF( "sqlite3 error: %s", msg );
|
|
||||||
XP_ASSERT(0);
|
XP_ASSERT(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -435,7 +435,7 @@ tryConnectToServer(CommonGlobals* cGlobals)
|
||||||
{
|
{
|
||||||
LaunchParams* params = cGlobals->params;
|
LaunchParams* params = cGlobals->params;
|
||||||
XWStreamCtxt* stream =
|
XWStreamCtxt* stream =
|
||||||
mem_stream_make( cGlobals->util->mpool, params->vtMgr,
|
mem_stream_make( MPPARM(cGlobals->util->mpool) params->vtMgr,
|
||||||
cGlobals, CHANNEL_NONE,
|
cGlobals, CHANNEL_NONE,
|
||||||
sendOnClose );
|
sendOnClose );
|
||||||
(void)server_initClientConnection( cGlobals->game.server,
|
(void)server_initClientConnection( cGlobals->game.server,
|
||||||
|
|
|
@ -1460,8 +1460,7 @@ gtkDrawCtxtMake( GtkWidget* drawing_area, GtkGameGlobals* globals )
|
||||||
dctx->drawing_area = drawing_area;
|
dctx->drawing_area = drawing_area;
|
||||||
dctx->globals = globals;
|
dctx->globals = globals;
|
||||||
|
|
||||||
GdkWindow* window = gtk_widget_get_window(drawing_area);
|
XP_ASSERT( !!gtk_widget_get_window(drawing_area) );
|
||||||
XP_ASSERT( !!window );
|
|
||||||
#ifdef USE_CAIRO
|
#ifdef USE_CAIRO
|
||||||
/* dctx->cairo = gdk_cairo_create( window ); */
|
/* dctx->cairo = gdk_cairo_create( window ); */
|
||||||
/* XP_LOGF( "dctx->cairo=%p", dctx->cairo ); */
|
/* XP_LOGF( "dctx->cairo=%p", dctx->cairo ); */
|
||||||
|
@ -1514,6 +1513,7 @@ removeSurface( GtkDrawCtx* dctx )
|
||||||
dctx->surface = NULL;
|
dctx->surface = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
static cairo_status_t
|
static cairo_status_t
|
||||||
write_func( void *closure, const unsigned char *data,
|
write_func( void *closure, const unsigned char *data,
|
||||||
unsigned int length )
|
unsigned int length )
|
||||||
|
@ -1522,16 +1522,19 @@ write_func( void *closure, const unsigned char *data,
|
||||||
stream_putBytes( stream, data, length );
|
stream_putBytes( stream, data, length );
|
||||||
return CAIRO_STATUS_SUCCESS;
|
return CAIRO_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
getImage( GtkDrawCtx* dctx, XWStreamCtxt* stream )
|
getImage( GtkDrawCtx* XP_UNUSED_DBG(dctx), XWStreamCtxt* XP_UNUSED_DBG(stream) )
|
||||||
{
|
{
|
||||||
LOG_FUNC();
|
LOG_FUNC();
|
||||||
XP_ASSERT( !!dctx->surface );
|
XP_ASSERT( !!dctx->surface );
|
||||||
|
#ifdef DEBUG
|
||||||
cairo_status_t status =
|
cairo_status_t status =
|
||||||
cairo_surface_write_to_png_stream( dctx->surface,
|
cairo_surface_write_to_png_stream( dctx->surface,
|
||||||
write_func, stream );
|
write_func, stream );
|
||||||
XP_ASSERT( CAIRO_STATUS_SUCCESS == status );
|
XP_ASSERT( CAIRO_STATUS_SUCCESS == status );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -1242,7 +1242,7 @@ linux_reset( void* closure )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
XP_S16
|
XP_S16
|
||||||
linux_send( const XP_U8* buf, XP_U16 buflen, const XP_UCHAR* msgNo,
|
linux_send( const XP_U8* buf, XP_U16 buflen, const XP_UCHAR* XP_UNUSED_DBG(msgNo),
|
||||||
const CommsAddrRec* addrRec, CommsConnType conType, XP_U32 gameID,
|
const CommsAddrRec* addrRec, CommsConnType conType, XP_U32 gameID,
|
||||||
void* closure )
|
void* closure )
|
||||||
{
|
{
|
||||||
|
|
|
@ -480,8 +480,9 @@ relayThread( void* arg )
|
||||||
while ( !storage->relayTaskList ) {
|
while ( !storage->relayTaskList ) {
|
||||||
pthread_cond_wait( &storage->relayCondVar, &storage->relayMutex );
|
pthread_cond_wait( &storage->relayCondVar, &storage->relayMutex );
|
||||||
}
|
}
|
||||||
|
#ifdef DEBUG
|
||||||
int len = g_slist_length( storage->relayTaskList );
|
int len = g_slist_length( storage->relayTaskList );
|
||||||
|
#endif
|
||||||
gchar* strs = listTasks( storage->relayTaskList );
|
gchar* strs = listTasks( storage->relayTaskList );
|
||||||
GSList* head = storage->relayTaskList;
|
GSList* head = storage->relayTaskList;
|
||||||
storage->relayTaskList = g_slist_remove_link( storage->relayTaskList,
|
storage->relayTaskList = g_slist_remove_link( storage->relayTaskList,
|
||||||
|
@ -740,12 +741,16 @@ relaycon_cleanup( LaunchParams* params )
|
||||||
RelayConStorage* storage = (RelayConStorage*)params->relayConStorage;
|
RelayConStorage* storage = (RelayConStorage*)params->relayConStorage;
|
||||||
if ( storage->params->useHTTP ) {
|
if ( storage->params->useHTTP ) {
|
||||||
pthread_mutex_lock( &storage->relayMutex );
|
pthread_mutex_lock( &storage->relayMutex );
|
||||||
|
#ifdef DEBUG
|
||||||
int nRelayTasks = g_slist_length( storage->relayTaskList );
|
int nRelayTasks = g_slist_length( storage->relayTaskList );
|
||||||
|
#endif
|
||||||
gchar* taskStrs = listTasks( storage->relayTaskList );
|
gchar* taskStrs = listTasks( storage->relayTaskList );
|
||||||
pthread_mutex_unlock( &storage->relayMutex );
|
pthread_mutex_unlock( &storage->relayMutex );
|
||||||
|
|
||||||
pthread_mutex_lock( &storage->gotDataMutex );
|
pthread_mutex_lock( &storage->gotDataMutex );
|
||||||
|
#ifdef DEBUG
|
||||||
int nDataTasks = g_slist_length( storage->gotDataTaskList );
|
int nDataTasks = g_slist_length( storage->gotDataTaskList );
|
||||||
|
#endif
|
||||||
gchar* gotStrs = listTasks( storage->gotDataTaskList );
|
gchar* gotStrs = listTasks( storage->gotDataTaskList );
|
||||||
pthread_mutex_unlock( &storage->gotDataMutex );
|
pthread_mutex_unlock( &storage->gotDataMutex );
|
||||||
|
|
||||||
|
@ -905,17 +910,16 @@ onGotQueryData( RelayTask* task )
|
||||||
if ( !!reply ) {
|
if ( !!reply ) {
|
||||||
CommsAddrRec addr = {0};
|
CommsAddrRec addr = {0};
|
||||||
addr_addType( &addr, COMMS_CONN_RELAY );
|
addr_addType( &addr, COMMS_CONN_RELAY );
|
||||||
|
#ifdef DEBUG
|
||||||
GList* ids = g_hash_table_get_keys( task->u.query.map );
|
GList* ids = g_hash_table_get_keys( task->u.query.map );
|
||||||
const char* xxx = ids->data;
|
#endif
|
||||||
|
|
||||||
json_object* jMsgs;
|
json_object* jMsgs;
|
||||||
if ( json_object_object_get_ex( reply, "msgs", &jMsgs ) ) {
|
if ( json_object_object_get_ex( reply, "msgs", &jMsgs ) ) {
|
||||||
/* Currently there's an array of arrays for each relayID (value) */
|
/* Currently there's an array of arrays for each relayID (value) */
|
||||||
XP_LOGF( "%s: got result of len %d", __func__, json_object_object_length(jMsgs) );
|
XP_LOGF( "%s: got result of len %d", __func__, json_object_object_length(jMsgs) );
|
||||||
XP_ASSERT( json_object_object_length(jMsgs) <= 1 );
|
XP_ASSERT( json_object_object_length(jMsgs) <= 1 );
|
||||||
json_object_object_foreach(jMsgs, relayID, arrOfArrOfMoves) {
|
json_object_object_foreach(jMsgs, relayID, arrOfArrOfMoves) {
|
||||||
XP_ASSERT( 0 == strcmp( relayID, xxx ) );
|
XP_ASSERT( 0 == strcmp( relayID, ids->data ) );
|
||||||
int len1 = json_object_array_length( arrOfArrOfMoves );
|
int len1 = json_object_array_length( arrOfArrOfMoves );
|
||||||
if ( len1 > 0 ) {
|
if ( len1 > 0 ) {
|
||||||
sqlite3_int64 rowid = *(sqlite3_int64*)g_hash_table_lookup( task->u.query.map, relayID );
|
sqlite3_int64 rowid = *(sqlite3_int64*)g_hash_table_lookup( task->u.query.map, relayID );
|
||||||
|
|
Loading…
Reference in a new issue