mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-01 06:19:57 +01:00
cleanup for wince compile
This commit is contained in:
parent
30f1e9b6db
commit
711e0cdc36
1 changed files with 19 additions and 4 deletions
|
@ -142,7 +142,7 @@ comms_make( MPFORMAL XW_UtilCtxt* util, XP_Bool isServer,
|
||||||
hostID = HOST_ID_SERVER;
|
hostID = HOST_ID_SERVER;
|
||||||
} else {
|
} else {
|
||||||
do {
|
do {
|
||||||
hostID = XP_RANDOM();
|
hostID = (XWHostID)XP_RANDOM();
|
||||||
} while ( hostID == HOST_ID_NONE || hostID == HOST_ID_SERVER );
|
} while ( hostID == HOST_ID_NONE || hostID == HOST_ID_SERVER );
|
||||||
}
|
}
|
||||||
result->myHostID = hostID;
|
result->myHostID = hostID;
|
||||||
|
@ -325,10 +325,12 @@ comms_makeFromStream( MPFORMAL XWStreamCtxt* stream, XW_UtilCtxt* util,
|
||||||
void
|
void
|
||||||
comms_start( CommsCtxt* comms )
|
comms_start( CommsCtxt* comms )
|
||||||
{
|
{
|
||||||
|
#ifdef BEYOND_IR
|
||||||
if ( comms->addr.conType == COMMS_CONN_RELAY ) {
|
if ( comms->addr.conType == COMMS_CONN_RELAY ) {
|
||||||
comms->relayState = COMMS_RELAYSTATE_UNCONNECTED;
|
comms->relayState = COMMS_RELAYSTATE_UNCONNECTED;
|
||||||
relayConnect( comms );
|
relayConnect( comms );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -426,15 +428,18 @@ comms_getAddr( CommsCtxt* comms, CommsAddrRec* addr )
|
||||||
} /* comms_getAddr */
|
} /* comms_getAddr */
|
||||||
|
|
||||||
void
|
void
|
||||||
comms_setAddr( CommsCtxt* comms, CommsAddrRec* addr )
|
comms_setAddr( CommsCtxt* comms, const CommsAddrRec* addr )
|
||||||
{
|
{
|
||||||
|
XP_ASSERT( comms );
|
||||||
#ifdef BEYOND_IR
|
#ifdef BEYOND_IR
|
||||||
util_addrChange( comms->util, &comms->addr, addr );
|
util_addrChange( comms->util, &comms->addr, addr );
|
||||||
#endif
|
#endif
|
||||||
XP_MEMCPY( &comms->addr, addr, sizeof(comms->addr) );
|
XP_MEMCPY( &comms->addr, addr, sizeof(comms->addr) );
|
||||||
|
|
||||||
|
#ifdef BEYOND_IR
|
||||||
/* We should now have a cookie so we can connect??? */
|
/* We should now have a cookie so we can connect??? */
|
||||||
relayConnect( comms );
|
relayConnect( comms );
|
||||||
|
#endif
|
||||||
} /* comms_setAddr */
|
} /* comms_setAddr */
|
||||||
|
|
||||||
#ifdef BEYOND_IR
|
#ifdef BEYOND_IR
|
||||||
|
@ -619,7 +624,9 @@ sendMsg( CommsCtxt* comms, MsgQueueElem* elem )
|
||||||
|
|
||||||
channelNo = elem->channelNo;
|
channelNo = elem->channelNo;
|
||||||
|
|
||||||
if ( comms_getConType( comms ) == COMMS_CONN_RELAY ) {
|
if ( 0 ) {
|
||||||
|
#ifdef BEYOND_IR
|
||||||
|
} else if ( comms_getConType( comms ) == COMMS_CONN_RELAY ) {
|
||||||
if ( comms->relayState == COMMS_RELAYSTATE_CONNECTED ) {
|
if ( comms->relayState == COMMS_RELAYSTATE_CONNECTED ) {
|
||||||
XWHostID destID = getDestID( comms, channelNo );
|
XWHostID destID = getDestID( comms, channelNo );
|
||||||
result = send_via_relay( comms, XWRELAY_MSG_TORELAY, destID,
|
result = send_via_relay( comms, XWRELAY_MSG_TORELAY, destID,
|
||||||
|
@ -627,6 +634,7 @@ sendMsg( CommsCtxt* comms, MsgQueueElem* elem )
|
||||||
} else {
|
} else {
|
||||||
XP_LOGF( "skipping message: not connected" );
|
XP_LOGF( "skipping message: not connected" );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if ( !channelToAddress( comms, channelNo, &addr ) ) {
|
if ( !channelToAddress( comms, channelNo, &addr ) ) {
|
||||||
|
@ -657,6 +665,7 @@ comms_resendAll( CommsCtxt* comms )
|
||||||
return result;
|
return result;
|
||||||
} /* comms_resend */
|
} /* comms_resend */
|
||||||
|
|
||||||
|
#ifdef BEYOND_IR
|
||||||
static XP_Bool
|
static XP_Bool
|
||||||
relayPreProcess( CommsCtxt* comms, XWStreamCtxt* stream, XWHostID* senderID )
|
relayPreProcess( CommsCtxt* comms, XWStreamCtxt* stream, XWHostID* senderID )
|
||||||
{
|
{
|
||||||
|
@ -709,6 +718,7 @@ relayPreProcess( CommsCtxt* comms, XWStreamCtxt* stream, XWHostID* senderID )
|
||||||
}
|
}
|
||||||
return consumed;
|
return consumed;
|
||||||
} /* checkForRelay */
|
} /* checkForRelay */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* read a raw buffer into a stream, stripping off the headers and keeping
|
/* read a raw buffer into a stream, stripping off the headers and keeping
|
||||||
* any necessary stats.
|
* any necessary stats.
|
||||||
|
@ -741,9 +751,11 @@ comms_checkIncomingStream( CommsCtxt* comms, XWStreamCtxt* stream,
|
||||||
|
|
||||||
XP_ASSERT( addr == NULL || comms->addr.conType == addr->conType );
|
XP_ASSERT( addr == NULL || comms->addr.conType == addr->conType );
|
||||||
|
|
||||||
|
#ifdef BEYOND_IR
|
||||||
if ( relayPreProcess( comms, stream, &senderID ) ) {
|
if ( relayPreProcess( comms, stream, &senderID ) ) {
|
||||||
return XP_FALSE;
|
return XP_FALSE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
connID = stream_getU32( stream );
|
connID = stream_getU32( stream );
|
||||||
XP_STATUSF( "read connID of %lx", connID );
|
XP_STATUSF( "read connID of %lx", connID );
|
||||||
|
@ -801,6 +813,7 @@ comms_checkIncomingStream( CommsCtxt* comms, XWStreamCtxt* stream,
|
||||||
return validMessage;
|
return validMessage;
|
||||||
} /* comms_checkIncomingStream */
|
} /* comms_checkIncomingStream */
|
||||||
|
|
||||||
|
#ifdef BEYOND_IR
|
||||||
static void
|
static void
|
||||||
p_comms_timerFired( void* closure, XWTimerReason why )
|
p_comms_timerFired( void* closure, XWTimerReason why )
|
||||||
{
|
{
|
||||||
|
@ -819,6 +832,7 @@ setHeartbeatTimer( CommsCtxt* comms )
|
||||||
util_setTimer( comms->util, TIMER_HEARTBEAT, comms->heartbeat,
|
util_setTimer( comms->util, TIMER_HEARTBEAT, comms->heartbeat,
|
||||||
p_comms_timerFired, comms );
|
p_comms_timerFired, comms );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
void
|
void
|
||||||
|
@ -953,6 +967,7 @@ countAddrRecs( CommsCtxt* comms )
|
||||||
return count;
|
return count;
|
||||||
} /* countAddrRecs */
|
} /* countAddrRecs */
|
||||||
|
|
||||||
|
#ifdef BEYOND_IR
|
||||||
static XP_Bool
|
static XP_Bool
|
||||||
send_via_relay( CommsCtxt* comms, XWRELAY_Cmd cmd, XWHostID destID,
|
send_via_relay( CommsCtxt* comms, XWRELAY_Cmd cmd, XWHostID destID,
|
||||||
void* data, int dlen )
|
void* data, int dlen )
|
||||||
|
@ -1033,7 +1048,7 @@ relayConnect( CommsCtxt* comms )
|
||||||
comms->connecting = XP_FALSE;
|
comms->connecting = XP_FALSE;
|
||||||
}
|
}
|
||||||
} /* relayConnect */
|
} /* relayConnect */
|
||||||
|
#endif
|
||||||
|
|
||||||
EXTERN_C_END
|
EXTERN_C_END
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue