mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +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
|
||||
|
||||
static void
|
||||
augmentChannelAddr( CommsCtxt* comms, AddressRecord * const rec,
|
||||
augmentChannelAddr( CommsCtxt* XP_UNUSED_DBG(comms), AddressRecord * const rec,
|
||||
const CommsAddrRec* addr, XWHostID hostID )
|
||||
{
|
||||
if ( !!addr ) {
|
||||
|
|
|
@ -1372,8 +1372,8 @@ curses_util_getVTManager(XW_UtilCtxt* uc)
|
|||
|
||||
static void
|
||||
curses_util_informNeedPassword( XW_UtilCtxt* XP_UNUSED(uc),
|
||||
XP_U16 playerNum,
|
||||
const XP_UCHAR* name )
|
||||
XP_U16 XP_UNUSED_DBG(playerNum),
|
||||
const XP_UCHAR* XP_UNUSED_DBG(name) )
|
||||
{
|
||||
XP_WARNF( "curses_util_informNeedPassword(num=%d, name=%s", playerNum, name );
|
||||
} /* curses_util_askPassword */
|
||||
|
@ -1391,7 +1391,7 @@ curses_util_yOffsetChange( XW_UtilCtxt* XP_UNUSED(uc),
|
|||
|
||||
#ifdef XWFEATURE_TURNCHANGENOTIFY
|
||||
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 );
|
||||
}
|
||||
|
@ -1725,7 +1725,7 @@ cursesGotBuf( void* closure, const CommsAddrRec* addr,
|
|||
|
||||
static void
|
||||
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 )
|
||||
{
|
||||
LOG_FUNC();
|
||||
|
|
|
@ -31,8 +31,8 @@ static void getColumnText( sqlite3_stmt *ppStmt, int iCol, XP_UCHAR* buf,
|
|||
int len );
|
||||
#ifdef DEBUG
|
||||
static char* sqliteErr2str( int err );
|
||||
static void assertPrintResult( sqlite3* pDb, int result, int expect );
|
||||
#endif
|
||||
static void assertPrintResult( sqlite3* pDb, int result, int expect );
|
||||
|
||||
sqlite3*
|
||||
openGamesDB( const char* dbName )
|
||||
|
@ -590,17 +590,15 @@ sqliteErr2str( int err )
|
|||
}
|
||||
return "<unknown>";
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
assertPrintResult( sqlite3* pDb, int result, int expect )
|
||||
assertPrintResult( sqlite3* pDb, int XP_UNUSED_DBG(result), int expect )
|
||||
{
|
||||
int code = sqlite3_errcode( pDb );
|
||||
XP_ASSERT( code == result ); /* do I need to pass it? */
|
||||
if ( code != expect ) {
|
||||
const char* msg = sqlite3_errmsg( pDb );
|
||||
XP_LOGF( "sqlite3 error: %s", msg );
|
||||
XP_LOGF( "sqlite3 error: %s", sqlite3_errmsg( pDb ) );
|
||||
XP_ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -435,7 +435,7 @@ tryConnectToServer(CommonGlobals* cGlobals)
|
|||
{
|
||||
LaunchParams* params = cGlobals->params;
|
||||
XWStreamCtxt* stream =
|
||||
mem_stream_make( cGlobals->util->mpool, params->vtMgr,
|
||||
mem_stream_make( MPPARM(cGlobals->util->mpool) params->vtMgr,
|
||||
cGlobals, CHANNEL_NONE,
|
||||
sendOnClose );
|
||||
(void)server_initClientConnection( cGlobals->game.server,
|
||||
|
|
|
@ -1460,8 +1460,7 @@ gtkDrawCtxtMake( GtkWidget* drawing_area, GtkGameGlobals* globals )
|
|||
dctx->drawing_area = drawing_area;
|
||||
dctx->globals = globals;
|
||||
|
||||
GdkWindow* window = gtk_widget_get_window(drawing_area);
|
||||
XP_ASSERT( !!window );
|
||||
XP_ASSERT( !!gtk_widget_get_window(drawing_area) );
|
||||
#ifdef USE_CAIRO
|
||||
/* dctx->cairo = gdk_cairo_create( window ); */
|
||||
/* XP_LOGF( "dctx->cairo=%p", dctx->cairo ); */
|
||||
|
@ -1514,6 +1513,7 @@ removeSurface( GtkDrawCtx* dctx )
|
|||
dctx->surface = NULL;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static cairo_status_t
|
||||
write_func( void *closure, const unsigned char *data,
|
||||
unsigned int length )
|
||||
|
@ -1522,16 +1522,19 @@ write_func( void *closure, const unsigned char *data,
|
|||
stream_putBytes( stream, data, length );
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
getImage( GtkDrawCtx* dctx, XWStreamCtxt* stream )
|
||||
getImage( GtkDrawCtx* XP_UNUSED_DBG(dctx), XWStreamCtxt* XP_UNUSED_DBG(stream) )
|
||||
{
|
||||
LOG_FUNC();
|
||||
XP_ASSERT( !!dctx->surface );
|
||||
#ifdef DEBUG
|
||||
cairo_status_t status =
|
||||
cairo_surface_write_to_png_stream( dctx->surface,
|
||||
write_func, stream );
|
||||
XP_ASSERT( CAIRO_STATUS_SUCCESS == status );
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1242,7 +1242,7 @@ linux_reset( void* closure )
|
|||
#endif
|
||||
|
||||
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,
|
||||
void* closure )
|
||||
{
|
||||
|
|
|
@ -480,8 +480,9 @@ relayThread( void* arg )
|
|||
while ( !storage->relayTaskList ) {
|
||||
pthread_cond_wait( &storage->relayCondVar, &storage->relayMutex );
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
int len = g_slist_length( storage->relayTaskList );
|
||||
#endif
|
||||
gchar* strs = listTasks( storage->relayTaskList );
|
||||
GSList* head = storage->relayTaskList;
|
||||
storage->relayTaskList = g_slist_remove_link( storage->relayTaskList,
|
||||
|
@ -740,12 +741,16 @@ relaycon_cleanup( LaunchParams* params )
|
|||
RelayConStorage* storage = (RelayConStorage*)params->relayConStorage;
|
||||
if ( storage->params->useHTTP ) {
|
||||
pthread_mutex_lock( &storage->relayMutex );
|
||||
#ifdef DEBUG
|
||||
int nRelayTasks = g_slist_length( storage->relayTaskList );
|
||||
#endif
|
||||
gchar* taskStrs = listTasks( storage->relayTaskList );
|
||||
pthread_mutex_unlock( &storage->relayMutex );
|
||||
|
||||
pthread_mutex_lock( &storage->gotDataMutex );
|
||||
#ifdef DEBUG
|
||||
int nDataTasks = g_slist_length( storage->gotDataTaskList );
|
||||
#endif
|
||||
gchar* gotStrs = listTasks( storage->gotDataTaskList );
|
||||
pthread_mutex_unlock( &storage->gotDataMutex );
|
||||
|
||||
|
@ -905,17 +910,16 @@ onGotQueryData( RelayTask* task )
|
|||
if ( !!reply ) {
|
||||
CommsAddrRec addr = {0};
|
||||
addr_addType( &addr, COMMS_CONN_RELAY );
|
||||
|
||||
#ifdef DEBUG
|
||||
GList* ids = g_hash_table_get_keys( task->u.query.map );
|
||||
const char* xxx = ids->data;
|
||||
|
||||
#endif
|
||||
json_object* jMsgs;
|
||||
if ( json_object_object_get_ex( reply, "msgs", &jMsgs ) ) {
|
||||
/* 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_ASSERT( json_object_object_length(jMsgs) <= 1 );
|
||||
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 );
|
||||
if ( len1 > 0 ) {
|
||||
sqlite3_int64 rowid = *(sqlite3_int64*)g_hash_table_lookup( task->u.query.map, relayID );
|
||||
|
|
Loading…
Reference in a new issue