From 22f7a42c1d23bcd6de67b8116aa99261acf028b1 Mon Sep 17 00:00:00 2001 From: Andy2 Date: Mon, 8 Nov 2010 17:22:38 -0800 Subject: [PATCH] make comms_getChannelSeed non-static so jni can call it --- xwords4/common/comms.c | 10 +++++----- xwords4/common/comms.h | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/xwords4/common/comms.c b/xwords4/common/comms.c index bcc0b4922..db9bc2ab2 100644 --- a/xwords4/common/comms.c +++ b/xwords4/common/comms.c @@ -896,8 +896,8 @@ makeElemWithID( CommsCtxt* comms, MsgID msgID, AddressRecord* rec, return newMsgElem; } /* makeElemWithID */ -static XP_U16 -getChannelSeed( CommsCtxt* comms ) +XP_U16 +comms_getChannelSeed( CommsCtxt* comms ) { while ( comms->channelSeed == 0 ) { comms->channelSeed = XP_RANDOM(); @@ -919,7 +919,7 @@ comms_send( CommsCtxt* comms, XWStreamCtxt* stream ) XP_S16 result = -1; if ( 0 == channelNo ) { - channelNo = getChannelSeed(comms) & ~CHANNEL_MASK; + channelNo = comms_getChannelSeed(comms) & ~CHANNEL_MASK; } XP_DEBUGF( "%s: assigning msgID=" XP_LD " on chnl %x", __func__, @@ -1983,7 +1983,7 @@ send_via_relay( CommsCtxt* comms, XWRELAY_Cmd cmd, XWHostID destID, comms->r.nPlayersTotal ); stream_putU8( tmpStream, comms->r.nPlayersHere ); stream_putU8( tmpStream, comms->r.nPlayersTotal ); - stream_putU16( tmpStream, getChannelSeed(comms) ); + stream_putU16( tmpStream, comms_getChannelSeed(comms) ); stream_putU8( tmpStream, comms->util->gameInfo->dictLang ); set_relay_state( comms, COMMS_RELAYSTATE_CONNECT_PENDING ); break; @@ -2002,7 +2002,7 @@ send_via_relay( CommsCtxt* comms, XWRELAY_Cmd cmd, XWHostID destID, comms->r.nPlayersTotal ); stream_putU8( tmpStream, comms->r.nPlayersHere ); stream_putU8( tmpStream, comms->r.nPlayersTotal ); - stream_putU16( tmpStream, getChannelSeed(comms) ); + stream_putU16( tmpStream, comms_getChannelSeed(comms) ); stream_putU8( tmpStream, comms->util->gameInfo->dictLang ); stringToStream( tmpStream, comms->r.connName ); set_relay_state( comms, COMMS_RELAYSTATE_CONNECT_PENDING ); diff --git a/xwords4/common/comms.h b/xwords4/common/comms.h index b73bcc89e..902e01504 100644 --- a/xwords4/common/comms.h +++ b/xwords4/common/comms.h @@ -180,6 +180,7 @@ void comms_writeToStream( const CommsCtxt* comms, XWStreamCtxt* stream ); XP_S16 comms_send( CommsCtxt* comms, XWStreamCtxt* stream ); XP_S16 comms_resendAll( CommsCtxt* comms ); +XP_U16 comms_getChannelSeed( CommsCtxt* comms ); XP_Bool comms_checkIncomingStream( CommsCtxt* comms, XWStreamCtxt* stream,