From c704b7ff4f116c333a62645009a95baae0f4481a Mon Sep 17 00:00:00 2001 From: Eric House Date: Mon, 10 Nov 2014 07:31:33 -0800 Subject: [PATCH] remove dead code --- xwords4/linux/cursesmain.c | 83 -------------------------------------- 1 file changed, 83 deletions(-) diff --git a/xwords4/linux/cursesmain.c b/xwords4/linux/cursesmain.c index 33efd395c..7ac314bab 100644 --- a/xwords4/linux/cursesmain.c +++ b/xwords4/linux/cursesmain.c @@ -998,89 +998,6 @@ cursesListenOnSocket( void* closure, int newSock #endif } /* cursesListenOnSocket */ -#ifdef USE_GLIBLOOP -#if 0 -static gboolean -data_socket_proc( GIOChannel* source, GIOCondition condition, gpointer data ) -{ - gboolean keep = TRUE; - if ( 0 != ((G_IO_HUP|G_IO_ERR|G_IO_NVAL) & condition) ) { - XP_LOGF( "%s: got error condition; returning FALSE", __func__ ); - keep = FALSE; - } else if ( 0 != (G_IO_IN & condition) ) { - CursesAppGlobals* globals = (CursesAppGlobals*)data; - int fd = g_io_channel_unix_get_fd( source ); - unsigned char buf[1024]; - int nBytes; - // CommsAddrRec addrRec; - CommsAddrRec* addrp = NULL; - // XP_Bool oneSent = XP_FALSE; - - /* It's a normal data socket */ - CommsConnType typ; - for ( XP_U32 st = 0; - addr_iter( &globals->cGlobals.params->addr, &typ, &st ); ) { - switch ( typ ) { -#ifdef XWFEATURE_RELAY - case COMMS_CONN_RELAY: - nBytes = linux_relay_receive( &globals->cGlobals, buf, - sizeof(buf) ); - break; -#endif -#ifdef XWFEATURE_SMS - case COMMS_CONN_SMS: - XP_ASSERT(0); - /* addrp = &addrRec; */ - /* nBytes = linux_sms_receive( &globals->cGlobals, fd, */ - /* buf, sizeof(buf), addrp ); */ - break; -#endif -#ifdef XWFEATURE_BLUETOOTH - case COMMS_CONN_BT: - nBytes = linux_bt_receive( fd, buf, sizeof(buf) ); - break; -#endif - - case COMMS_CONN_IP_DIRECT: - XP_LOGF( "OOPS: need separate data procs per address type!!" ); - XP_ASSERT( 0 ); - break; - case COMMS_CONN_NONE: - break; - - default: - XP_ASSERT( 0 ); /* fired */ - } - } - - if ( nBytes != -1 ) { - XWStreamCtxt* inboundS; - XP_Bool redraw = XP_FALSE; - - inboundS = stream_from_msgbuf( &globals->cGlobals, buf, nBytes ); - if ( !!inboundS ) { - if ( comms_checkIncomingStream( globals->cGlobals.game.comms, - inboundS, addrp ) ) { - redraw = server_receiveMessage( globals->cGlobals.game.server, - inboundS ); - } - stream_destroy( inboundS ); - } - - /* if there's something to draw resulting from the - message, we need to give the main loop time to reflect - that on the screen before giving the server another - shot. So just call the idle proc. */ - if ( redraw ) { - curses_util_requestTime( globals->cGlobals.util ); - } - } - } - return keep; -} /* data_socket_proc */ -#endif -#endif - static void curses_socket_added( void* closure, int newSock, GIOFunc func ) {