From 497eb2d1c4f7c87a2a9f646c4ebf6d22ec037fcc Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Tue, 5 Feb 2002 12:58:31 +0000 Subject: [PATCH] Moved CA_..._PORT static casts from caProto.h into C++ sources. --- src/ca/caProto.h | 6 ++---- src/ca/casw.cpp | 6 ++++-- src/ca/repeater.cpp | 3 ++- src/ca/udpiiu.cpp | 6 ++++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/ca/caProto.h b/src/ca/caProto.h index 2476ad1aa..5dfcac50a 100644 --- a/src/ca/caProto.h +++ b/src/ca/caProto.h @@ -81,10 +81,8 @@ * "EPICS_CA_SERVER_PORT" */ #define CA_PORT_BASE IPPORT_USERRESERVED + 56U -#define CA_SERVER_PORT static_cast \ - (CA_PORT_BASE+CA_MAJOR_PROTOCOL_REVISION*2u) -#define CA_REPEATER_PORT static_cast \ - (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) diff --git a/src/ca/casw.cpp b/src/ca/casw.cpp index 9f3dfd89d..a5f16f676 100644 --- a/src/ca/casw.cpp +++ b/src/ca/casw.cpp @@ -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 (CA_SERVER_PORT) ); repeaterPort = - envGetInetPortConfigParam ( &EPICS_CA_REPEATER_PORT, CA_REPEATER_PORT ); + envGetInetPortConfigParam ( &EPICS_CA_REPEATER_PORT, + static_cast (CA_REPEATER_PORT) ); caStartRepeaterIfNotInstalled ( repeaterPort ); diff --git a/src/ca/repeater.cpp b/src/ca/repeater.cpp index 5071ae49f..3a12f13d2 100644 --- a/src/ca/repeater.cpp +++ b/src/ca/repeater.cpp @@ -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 (CA_REPEATER_PORT) ); msr = makeSocket ( port, true ); if ( msr.sock == INVALID_SOCKET ) { diff --git a/src/ca/udpiiu.cpp b/src/ca/udpiiu.cpp index a61c3294b..ff25a5088 100644 --- a/src/ca/udpiiu.cpp +++ b/src/ca/udpiiu.cpp @@ -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 (CA_REPEATER_PORT) ); this->serverPort = - envGetInetPortConfigParam ( &EPICS_CA_SERVER_PORT, CA_SERVER_PORT ); + envGetInetPortConfigParam ( &EPICS_CA_SERVER_PORT, + static_cast (CA_SERVER_PORT) ); this->sock = socket ( AF_INET, SOCK_DGRAM, IPPROTO_UDP ); if ( this->sock == INVALID_SOCKET ) {