From b2dcaf31132330261b379a8e7530cca229879f7c Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 24 Sep 1998 21:22:58 +0000 Subject: [PATCH] conn.c --- src/ca/Makefile.Host | 2 +- src/ca/convert.c | 10 +++++----- src/ca/net_convert.h | 21 +++++++++++++-------- src/ca/windows_depen.c | 11 +++++++++++ 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/ca/Makefile.Host b/src/ca/Makefile.Host index b55a8aa94..abd285e12 100644 --- a/src/ca/Makefile.Host +++ b/src/ca/Makefile.Host @@ -48,7 +48,7 @@ PROD := caRepeater PROD_LIBS := ca Com SYS_PROD_LIBS_WIN32 := ws2_32 user32 advapi32 -TESTPROD := catime acctst +TESTPROD := catime acctst connTest include $(TOP)/config/RULES.Host diff --git a/src/ca/convert.c b/src/ca/convert.c index 719934ba4..7f30328a0 100644 --- a/src/ca/convert.c +++ b/src/ca/convert.c @@ -1707,7 +1707,7 @@ void dbr_ntohf(dbr_float_t *pNet, dbr_float_t *pHost) #endif /*CA_FLOAT_MIT*/ -#if defined(CA_FLOAT_IEEE) && 0 +#if defined(CA_FLOAT_IEEE) && 1 /* * dbr_htond () @@ -1716,8 +1716,8 @@ void dbr_ntohf(dbr_float_t *pNet, dbr_float_t *pHost) void dbr_htond (dbr_double_t *IEEEhost, dbr_double_t *IEEEnet) { #ifdef CA_LITTLE_ENDIAN - ca_uint32_t *pHost = (ca_uint32_t *) IEEEhost; - ca_uint32_t *pNet = (ca_uint32_t *) IEEEnet; + ca_uint32_t *pHost = (ca_uint32_t *) IEEEhost; + ca_uint32_t *pNet = (ca_uint32_t *) IEEEnet; ca_uint32_t tmp; /* @@ -1740,8 +1740,8 @@ void dbr_htond (dbr_double_t *IEEEhost, dbr_double_t *IEEEnet) void dbr_ntohd (dbr_double_t *IEEEnet, dbr_double_t *IEEEhost) { #ifdef CA_LITTLE_ENDIAN - ca_uint32_t *pHost = (ca_uint32_t *) IEEEhost; - ca_uint32_t *pNet = (ca_uint32_t *) IEEEnet; + ca_uint32_t *pHost = (ca_uint32_t *) IEEEhost; + ca_uint32_t *pNet = (ca_uint32_t *) IEEEnet; ca_uint32_t tmp; /* diff --git a/src/ca/net_convert.h b/src/ca/net_convert.h index 61834c3e1..6b730eb30 100644 --- a/src/ca/net_convert.h +++ b/src/ca/net_convert.h @@ -102,19 +102,22 @@ epicsShareExtern CACVRTFUNC *cac_dbr_cvrt[LAST_BUFFER_TYPE+1]; * so we need a tmp variable in e.g. 'double' conversions. */ -#ifdef CA_LITTLE_ENDIAN +#if defined(CA_LITTLE_ENDIAN) +#if 0 +( (dbr_short_t) ((((dbr_ushort_t)SHORT)>>8) | (((dbr_ushort_t)SHORT)<<8)) # ifndef ntohs # define ntohs(SHORT)\ ( (dbr_short_t)\ - (((SHORT) & (dbr_short_t) 0x00ff) << 8 |\ - ((SHORT) & (dbr_short_t) 0xff00) >> 8) ) + ((((dbr_ushort_t)SHORT) & (dbr_ushort_t) 0x00ff) << 8 |\ + (((dbr_ushort_t)SHORT) & (dbr_ushort_t) 0xff00) >> 8) ) # endif # ifndef htons # define htons(SHORT)\ ( (dbr_short_t)\ - (((SHORT) & (dbr_short_t) 0x00ff) << 8 |\ - ((SHORT) & (dbr_short_t) 0xff00) >> 8) ) + ((((dbr_ushort_t)SHORT) & (dbr_ushort_t) 0x00ff) << 8 |\ + (((dbr_ushort_t)SHORT) & (dbr_ushort_t) 0xff00) >> 8) ) # endif +#endif #else # ifndef ntohs # define ntohs(SHORT) (SHORT) @@ -125,7 +128,8 @@ epicsShareExtern CACVRTFUNC *cac_dbr_cvrt[LAST_BUFFER_TYPE+1]; #endif -#ifdef CA_LITTLE_ENDIAN +#if defined(CA_LITTLE_ENDIAN) +#if 0 # ifndef ntohl # define ntohl(LONG)\ ( (dbr_long_t) (\ @@ -144,7 +148,8 @@ epicsShareExtern CACVRTFUNC *cac_dbr_cvrt[LAST_BUFFER_TYPE+1]; ( ((dbr_ulong_t)(LONG)) & 0x0000ff00 ) << 8u )\ ) # endif -# else +#endif +#else # ifndef ntohl # define ntohl(LONG) (LONG) # endif @@ -162,7 +167,7 @@ epicsShareExtern CACVRTFUNC *cac_dbr_cvrt[LAST_BUFFER_TYPE+1]; (*(dbr_float_t *)(IEEEnet) = *(dbr_float_t *)(IEEEhost)) # define dbr_ntohf(IEEEnet, IEEEhost) \ (*(dbr_float_t *)(IEEEhost) = *(dbr_float_t *)(IEEEnet)) -#elif defined(CA_FLOAT_IEEE) && defined(CA_LITTLE_ENDIAN) +#elif defined(CA_FLOAT_IEEE) && defined(CA_LITTLE_ENDIAN) && 0 # define dbr_ntohf(NET,HOST) \ {*((dbr_long_t *)(HOST)) = ntohl(*((dbr_long_t *)(NET )));} # define dbr_htonf(HOST,NET) \ diff --git a/src/ca/windows_depen.c b/src/ca/windows_depen.c index 23ac6c393..1ccd6b7e7 100644 --- a/src/ca/windows_depen.c +++ b/src/ca/windows_depen.c @@ -32,6 +32,9 @@ * Modification Log: * ----------------- * $Log$ + * Revision 1.41 1998/07/07 23:01:42 jhill + * use high precision timers + * * Revision 1.40 1998/06/22 22:32:03 jhill * EPICS_DLL => EPICS_DLL_NO (so we are backwards compatible * @@ -76,6 +79,9 @@ * * Revision 1.19 1995/11/29 19:15:42 jhill * added $Log$ + * added Revision 1.41 1998/07/07 23:01:42 jhill + * added use high precision timers + * added * added Revision 1.40 1998/06/22 22:32:03 jhill * added EPICS_DLL => EPICS_DLL_NO (so we are backwards compatible * added @@ -742,20 +748,25 @@ BOOL epicsShareAPI DllMain (HANDLE hModule, DWORD dwReason, LPVOID lpReserved) } # endif +#if 0 status = ca_task_initialize(); if (status!=ECA_NORMAL) { return FALSE; } +#endif + # ifdef _DEBUG fprintf(stderr, "Process attached to ca.dll version %s\n", EPICS_VERSION_STRING); # endif break; case DLL_PROCESS_DETACH: +#if 0 status = ca_task_exit (); if (status!=ECA_NORMAL) { return FALSE; } +#endif # ifdef _DEBUG fprintf(stderr, "Process detached from ca.dll version %s\n", EPICS_VERSION_STRING); # endif