CleanupWhitespace
removed spaces at end of line replaced tabs with spaces
This commit is contained in:
1 parent
055223dbe4
commit
36a8b51d8e
610 files changed
+19733
-19733
No files matched your search
@@ -12,11 +12,11 @@
|
||||
* Author: D. Kersteins
|
||||
*
|
||||
*
|
||||
* NOTES:
|
||||
* NOTES:
|
||||
*
|
||||
* 1) All routines in this file have an encode argument which
|
||||
* determines if we are converting from the standard format to
|
||||
* the local format or vise versa. To date only float and double data
|
||||
* the local format or vise versa. To date only float and double data
|
||||
* types must be converted differently depending on the encode
|
||||
* argument - joh
|
||||
*
|
||||
@@ -44,38 +44,38 @@
|
||||
*
|
||||
* net format: big endian and IEEE float
|
||||
*/
|
||||
typedef void ( * CACVRTFUNCPTR ) (
|
||||
typedef void ( * CACVRTFUNCPTR ) (
|
||||
const void *pSrc, void *pDest, int hton, arrayElementCount count );
|
||||
|
||||
inline void dbr_htond (
|
||||
inline void dbr_htond (
|
||||
const dbr_double_t * pHost, dbr_double_t * pNet )
|
||||
{
|
||||
AlignedWireRef < epicsFloat64 > tmp ( *pNet );
|
||||
tmp = *pHost;
|
||||
}
|
||||
inline void dbr_ntohd (
|
||||
inline void dbr_ntohd (
|
||||
const dbr_double_t * pNet, dbr_double_t * pHost )
|
||||
{
|
||||
*pHost = AlignedWireRef < const epicsFloat64 > ( *pNet );
|
||||
}
|
||||
inline void dbr_htonf (
|
||||
inline void dbr_htonf (
|
||||
const dbr_float_t * pHost, dbr_float_t * pNet )
|
||||
{
|
||||
AlignedWireRef < epicsFloat32 > tmp ( *pNet );
|
||||
tmp = *pHost;
|
||||
}
|
||||
inline void dbr_ntohf (
|
||||
inline void dbr_ntohf (
|
||||
const dbr_float_t * pNet, dbr_float_t * pHost )
|
||||
{
|
||||
*pHost = AlignedWireRef < const epicsFloat32 > ( *pNet );
|
||||
}
|
||||
|
||||
inline epicsUInt16 dbr_ntohs( const epicsUInt16 & net )
|
||||
inline epicsUInt16 dbr_ntohs( const epicsUInt16 & net )
|
||||
{
|
||||
return AlignedWireRef < const epicsUInt16 > ( net );
|
||||
}
|
||||
|
||||
inline epicsUInt16 dbr_htons ( const epicsUInt16 & host )
|
||||
inline epicsUInt16 dbr_htons ( const epicsUInt16 & host )
|
||||
{
|
||||
epicsUInt16 tmp;
|
||||
AlignedWireRef < epicsUInt16 > awr ( tmp );
|
||||
@@ -101,7 +101,7 @@ inline epicsUInt32 dbr_htonl ( const epicsUInt32 & host )
|
||||
* otherwise vise-versa
|
||||
*
|
||||
* net format: big endian and IEEE float
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -120,7 +120,7 @@ arrayElementCount num /* number of values */
|
||||
/* convert "in place" -> nothing to do */
|
||||
if (s == d)
|
||||
return;
|
||||
memcpy ( pDest, pSrc, num*MAX_STRING_SIZE );
|
||||
memcpy ( pDest, pSrc, num*MAX_STRING_SIZE );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -232,7 +232,7 @@ arrayElementCount num /* number of values */
|
||||
*
|
||||
*
|
||||
* NOTES:
|
||||
* placing encode outside the loop results in more
|
||||
* placing encode outside the loop results in more
|
||||
* code but better performance.
|
||||
*
|
||||
*/
|
||||
@@ -289,10 +289,10 @@ arrayElementCount num /* number of values */
|
||||
** struct dbr_sts_string *d pointer to destination struct
|
||||
** int encode; boolean, if true vax to ieee
|
||||
** else ieee to vax
|
||||
**
|
||||
**
|
||||
** converts fields of struct in HOST format to NET format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -305,7 +305,7 @@ arrayElementCount num /* number of values */
|
||||
{
|
||||
struct dbr_sts_string *pSrc = (struct dbr_sts_string *) s;
|
||||
struct dbr_sts_string *pDest = (struct dbr_sts_string *) d;
|
||||
|
||||
|
||||
/* convert ieee to vax format or vax to ieee */
|
||||
pDest->status = dbr_ntohs(pSrc->status);
|
||||
pDest->severity = dbr_ntohs(pSrc->severity);
|
||||
@@ -326,8 +326,8 @@ arrayElementCount num /* number of values */
|
||||
** else ieee to vax
|
||||
**
|
||||
** converts fields ofstruct in HOST format to ieee format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format
|
||||
****************************************************************************/
|
||||
|
||||
@@ -359,10 +359,10 @@ arrayElementCount num /* number of values */
|
||||
** int encode; boolean, if true vax to ieee
|
||||
** else ieee to vax
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -385,10 +385,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_sts_double(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -416,9 +416,9 @@ arrayElementCount num /* number of values */
|
||||
** else ieee to vax
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_sts_enum(
|
||||
@@ -444,9 +444,9 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_gr_short()
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_gr_short(
|
||||
@@ -483,9 +483,9 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_gr_char()
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_gr_char(
|
||||
@@ -524,9 +524,9 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_gr_long()
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_gr_long(
|
||||
@@ -562,10 +562,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_gr_enum(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -597,10 +597,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_gr_double(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -661,10 +661,10 @@ arrayElementCount num /* number of values */
|
||||
** int encode; boolean, if true vax to ieee
|
||||
** else ieee to vax
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -728,9 +728,9 @@ arrayElementCount num /* number of values */
|
||||
** else ieee to vax
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_ctrl_short(
|
||||
@@ -770,9 +770,9 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_ctrl_long(s,d)
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_ctrl_long(
|
||||
@@ -812,9 +812,9 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_ctrl_short(s,d)
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_ctrl_char(
|
||||
@@ -831,7 +831,7 @@ arrayElementCount num /* number of values */
|
||||
pDest->status = dbr_ntohs(pSrc->status);
|
||||
pDest->severity = dbr_ntohs(pSrc->severity);
|
||||
|
||||
if ( s == d )
|
||||
if ( s == d )
|
||||
return;
|
||||
|
||||
pDest->upper_disp_limit = pSrc->upper_disp_limit;
|
||||
@@ -851,10 +851,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_ctrl_double(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -917,10 +917,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_ctrl_float(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -982,10 +982,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_ctrl_enum(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1001,7 +1001,7 @@ arrayElementCount num /* number of values */
|
||||
|
||||
pDest->status = dbr_ntohs(pSrc->status);
|
||||
pDest->severity = dbr_ntohs(pSrc->severity);
|
||||
pDest->no_str = dbr_ntohs(pSrc->no_str);
|
||||
pDest->no_str = dbr_ntohs(pSrc->no_str);
|
||||
if ( s != d ) {
|
||||
memcpy((void *)pDest->strs,(void *)pSrc->strs,sizeof(pSrc->strs));
|
||||
}
|
||||
@@ -1022,8 +1022,8 @@ arrayElementCount num /* number of values */
|
||||
** else ieee to vax
|
||||
**
|
||||
** converts fields ofstruct in HOST format to ieee format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1041,7 +1041,7 @@ arrayElementCount num /* number of values */
|
||||
pDest->status = dbr_ntohs(pSrc->status);
|
||||
pDest->severity = dbr_ntohs(pSrc->severity);
|
||||
|
||||
if ( s == d )
|
||||
if ( s == d )
|
||||
return;
|
||||
|
||||
if (num == 1) /* single value */
|
||||
@@ -1056,8 +1056,8 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_sts_long(s,d)
|
||||
**
|
||||
** converts fields ofstruct in HOST format to ieee format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1086,10 +1086,10 @@ arrayElementCount num /* number of values */
|
||||
|
||||
/****************************************************************************
|
||||
** cvrt_time_string(s,d)
|
||||
**
|
||||
**
|
||||
** converts fields of struct in HOST format to NET format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1102,7 +1102,7 @@ arrayElementCount num /* number of values */
|
||||
{
|
||||
struct dbr_time_string *pSrc = (struct dbr_time_string *) s;
|
||||
struct dbr_time_string *pDest = (struct dbr_time_string *) d;
|
||||
|
||||
|
||||
/* convert ieee to vax format or vax to ieee */
|
||||
pDest->status = dbr_ntohs(pSrc->status);
|
||||
pDest->severity = dbr_ntohs(pSrc->severity);
|
||||
@@ -1118,8 +1118,8 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_time_short(s,d)
|
||||
**
|
||||
** converts fields ofstruct in HOST format to ieee format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1150,10 +1150,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_time_float(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1178,10 +1178,10 @@ arrayElementCount num /* number of values */
|
||||
/****************************************************************************
|
||||
** cvrt_time_double(s,d)
|
||||
**
|
||||
** if encode
|
||||
** if encode
|
||||
** converts struct in HOST format to ieee format
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** else
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1209,9 +1209,9 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_time_enum(s,d)
|
||||
**
|
||||
** converts fields of struct in NET format to fields with HOST format
|
||||
** or
|
||||
** or
|
||||
** converts fields of struct in HOST format to fields with NET format
|
||||
**
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
static void cvrt_time_enum(
|
||||
@@ -1239,8 +1239,8 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_sts_char(s,d)
|
||||
**
|
||||
** converts fields ofstruct in HOST format to ieee format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1260,7 +1260,7 @@ arrayElementCount num /* number of values */
|
||||
pDest->stamp.secPastEpoch = dbr_ntohl(pSrc->stamp.secPastEpoch);
|
||||
pDest->stamp.nsec = dbr_ntohl(pSrc->stamp.nsec);
|
||||
|
||||
if ( s == d )
|
||||
if ( s == d )
|
||||
return;
|
||||
|
||||
if (num == 1) /* single value */
|
||||
@@ -1274,8 +1274,8 @@ arrayElementCount num /* number of values */
|
||||
** cvrt_time_long(s,d)
|
||||
**
|
||||
** converts fields ofstruct in HOST format to ieee format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1324,7 +1324,7 @@ arrayElementCount num /* number of values */
|
||||
for(i=0; i<num; i++){
|
||||
*pDest = dbr_ntohs( *pSrc );
|
||||
/*
|
||||
* dont increment these inside the MACRO
|
||||
* dont increment these inside the MACRO
|
||||
*/
|
||||
pDest++;
|
||||
pSrc++;
|
||||
@@ -1337,10 +1337,10 @@ arrayElementCount num /* number of values */
|
||||
** struct dbr_stsack_string *d pointer to destination struct
|
||||
** int encode; boolean, if true vax to ieee
|
||||
** else ieee to vax
|
||||
**
|
||||
**
|
||||
** converts fields of struct in HOST format to NET format
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** or
|
||||
** converts fields of struct in NET format to fields with HOST
|
||||
** format;
|
||||
****************************************************************************/
|
||||
|
||||
@@ -1353,7 +1353,7 @@ arrayElementCount num /* number of values */
|
||||
{
|
||||
struct dbr_stsack_string *pSrc = (struct dbr_stsack_string *) s;
|
||||
struct dbr_stsack_string *pDest = (struct dbr_stsack_string *) d;
|
||||
|
||||
|
||||
/* convert ieee to vax format or vax to ieee */
|
||||
pDest->status = dbr_ntohs(pSrc->status);
|
||||
pDest->severity = dbr_ntohs(pSrc->severity);
|
||||
@@ -1409,7 +1409,7 @@ static CACVRTFUNCPTR cac_dbr_cvrt[] = {
|
||||
cvrt_ctrl_long,
|
||||
cvrt_ctrl_double,
|
||||
|
||||
cvrt_put_ackt,
|
||||
cvrt_put_ackt,
|
||||
cvrt_put_ackt, /* DBR_PUT_ACKS identical to DBR_PUT_ACKT */
|
||||
cvrt_stsack_string,
|
||||
cvrt_string
|
||||
@@ -1417,18 +1417,18 @@ static CACVRTFUNCPTR cac_dbr_cvrt[] = {
|
||||
|
||||
#endif /* EPICS_CONVERSION_REQUIRED */
|
||||
|
||||
int caNetConvert ( unsigned type, const void *pSrc, void *pDest,
|
||||
int caNetConvert ( unsigned type, const void *pSrc, void *pDest,
|
||||
int hton, arrayElementCount count )
|
||||
{
|
||||
# ifdef EPICS_CONVERSION_REQUIRED
|
||||
if ( type >= NELEMENTS ( cac_dbr_cvrt ) ) {
|
||||
return ECA_BADTYPE;
|
||||
}
|
||||
}
|
||||
( * cac_dbr_cvrt [ type ] ) ( pSrc, pDest, hton, count );
|
||||
# else
|
||||
if ( INVALID_DB_REQ ( type ) ) {
|
||||
return ECA_BADTYPE;
|
||||
}
|
||||
}
|
||||
if ( pSrc != pDest ) {
|
||||
memcpy ( pDest, pSrc, dbr_size_n ( type, count ) );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user