Moved CA_..._PORT static casts from caProto.h into C++ sources.

This commit is contained in:
Ralph Lange
2002-02-05 12:58:31 +00:00
parent 1876eac721
commit 497eb2d1c4
4 changed files with 12 additions and 9 deletions

View File

@@ -81,10 +81,8 @@
* "EPICS_CA_SERVER_PORT"
*/
#define CA_PORT_BASE IPPORT_USERRESERVED + 56U
#define CA_SERVER_PORT static_cast <unsigned short> \
(CA_PORT_BASE+CA_MAJOR_PROTOCOL_REVISION*2u)
#define CA_REPEATER_PORT static_cast <unsigned short> \
(CA_PORT_BASE+CA_MAJOR_PROTOCOL_REVISION*2u+1u)
#define CA_SERVER_PORT (CA_PORT_BASE+CA_MAJOR_PROTOCOL_REVISION*2u)
#define CA_REPEATER_PORT (CA_PORT_BASE+CA_MAJOR_PROTOCOL_REVISION*2u+1u)
/*
* 1500 (max of ethernet and 802.{2,3} MTU) - 20(IP) - 8(UDP)
* (the MTU of Ethernet is currently independent of its speed varient)

View File

@@ -35,10 +35,12 @@ int main ( int, char ** )
int status;
serverPort =
envGetInetPortConfigParam ( &EPICS_CA_SERVER_PORT, CA_SERVER_PORT );
envGetInetPortConfigParam ( &EPICS_CA_SERVER_PORT,
static_cast <unsigned short> (CA_SERVER_PORT) );
repeaterPort =
envGetInetPortConfigParam ( &EPICS_CA_REPEATER_PORT, CA_REPEATER_PORT );
envGetInetPortConfigParam ( &EPICS_CA_REPEATER_PORT,
static_cast <unsigned short> (CA_REPEATER_PORT) );
caStartRepeaterIfNotInstalled ( repeaterPort );

View File

@@ -504,7 +504,8 @@ void ca_repeater ()
assert ( osiSockAttach() );
port = envGetInetPortConfigParam ( &EPICS_CA_REPEATER_PORT, CA_REPEATER_PORT );
port = envGetInetPortConfigParam ( &EPICS_CA_REPEATER_PORT,
static_cast <unsigned short> (CA_REPEATER_PORT) );
msr = makeSocket ( port, true );
if ( msr.sock == INVALID_SOCKET ) {

View File

@@ -61,10 +61,12 @@ udpiiu::udpiiu ( cac &cac ) :
int status;
this->repeaterPort =
envGetInetPortConfigParam ( &EPICS_CA_REPEATER_PORT, CA_REPEATER_PORT );
envGetInetPortConfigParam ( &EPICS_CA_REPEATER_PORT,
static_cast <unsigned short> (CA_REPEATER_PORT) );
this->serverPort =
envGetInetPortConfigParam ( &EPICS_CA_SERVER_PORT, CA_SERVER_PORT );
envGetInetPortConfigParam ( &EPICS_CA_SERVER_PORT,
static_cast <unsigned short> (CA_SERVER_PORT) );
this->sock = socket ( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
if ( this->sock == INVALID_SOCKET ) {