From 933a4e964617549ed382e72876a80bac5f15f817 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 6 Feb 2002 02:13:43 +0000 Subject: [PATCH] fuixed warning messages --- src/ca/access.cpp | 58 ++++++++++++++++++++-------------------- src/ca/acctst.c | 8 +++--- src/libCom/env/envSubr.c | 8 +++--- 3 files changed, 36 insertions(+), 38 deletions(-) diff --git a/src/ca/access.cpp b/src/ca/access.cpp index 5b7b6fcaf..6a7ee01fd 100644 --- a/src/ca/access.cpp +++ b/src/ca/access.cpp @@ -1308,37 +1308,37 @@ epicsShareDef const unsigned short dbr_value_offset[LAST_BUFFER_TYPE+1] = { 0, /* character */ 0, /* long */ 0, /* IEEE double */ - offsetof(dbr_sts_string,value[0]),/* string field with status */ - offsetof(dbr_sts_short,value), /* short field with status */ - offsetof(dbr_sts_float,value), /* float field with status */ - offsetof(dbr_sts_enum,value), /* item number with status */ - offsetof(dbr_sts_char,value), /* char field with status */ - offsetof(dbr_sts_long,value), /* long field with status */ - offsetof(dbr_sts_double,value), /* double field with time */ - offsetof(dbr_time_string,value[0]),/* string field with time */ - offsetof(dbr_time_short,value), /* short field with time */ - offsetof(dbr_time_float,value), /* float field with time */ - offsetof(dbr_time_enum,value), /* item number with time */ - offsetof(dbr_time_char,value), /* char field with time */ - offsetof(dbr_time_long,value), /* long field with time */ - offsetof(dbr_time_double,value), /* double field with time */ - offsetof(dbr_sts_string,value[0]),/* graphic string info */ - offsetof(dbr_gr_short,value), /* graphic short info */ - offsetof(dbr_gr_float,value), /* graphic float info */ - offsetof(dbr_gr_enum,value), /* graphic item info */ - offsetof(dbr_gr_char,value), /* graphic char info */ - offsetof(dbr_gr_long,value), /* graphic long info */ - offsetof(dbr_gr_double,value), /* graphic double info */ - offsetof(dbr_sts_string,value[0]),/* control string info */ - offsetof(dbr_ctrl_short,value), /* control short info */ - offsetof(dbr_ctrl_float,value), /* control float info */ - offsetof(dbr_ctrl_enum,value), /* control item info */ - offsetof(dbr_ctrl_char,value), /* control char info */ - offsetof(dbr_ctrl_long,value), /* control long info */ - offsetof(dbr_ctrl_double,value), /* control double info */ + (unsigned short) offsetof(dbr_sts_string,value[0]),/* string field with status */ + (unsigned short) offsetof(dbr_sts_short,value), /* short field with status */ + (unsigned short) offsetof(dbr_sts_float,value), /* float field with status */ + (unsigned short) offsetof(dbr_sts_enum,value), /* item number with status */ + (unsigned short) offsetof(dbr_sts_char,value), /* char field with status */ + (unsigned short) offsetof(dbr_sts_long,value), /* long field with status */ + (unsigned short) offsetof(dbr_sts_double,value), /* double field with time */ + (unsigned short) offsetof(dbr_time_string,value[0] ),/* string field with time */ + (unsigned short) offsetof(dbr_time_short,value), /* short field with time */ + (unsigned short) offsetof(dbr_time_float,value), /* float field with time */ + (unsigned short) offsetof(dbr_time_enum,value), /* item number with time */ + (unsigned short) offsetof(dbr_time_char,value), /* char field with time */ + (unsigned short) offsetof(dbr_time_long,value), /* long field with time */ + (unsigned short) offsetof(dbr_time_double,value), /* double field with time */ + (unsigned short) offsetof(dbr_sts_string,value[0]),/* graphic string info */ + (unsigned short) offsetof(dbr_gr_short,value), /* graphic short info */ + (unsigned short) offsetof(dbr_gr_float,value), /* graphic float info */ + (unsigned short) offsetof(dbr_gr_enum,value), /* graphic item info */ + (unsigned short) offsetof(dbr_gr_char,value), /* graphic char info */ + (unsigned short) offsetof(dbr_gr_long,value), /* graphic long info */ + (unsigned short) offsetof(dbr_gr_double,value), /* graphic double info */ + (unsigned short) offsetof(dbr_sts_string,value[0]),/* control string info */ + (unsigned short) offsetof(dbr_ctrl_short,value), /* control short info */ + (unsigned short) offsetof(dbr_ctrl_float,value), /* control float info */ + (unsigned short) offsetof(dbr_ctrl_enum,value), /* control item info */ + (unsigned short) offsetof(dbr_ctrl_char,value), /* control char info */ + (unsigned short) offsetof(dbr_ctrl_long,value), /* control long info */ + (unsigned short) offsetof(dbr_ctrl_double,value), /* control double info */ 0, /* put ackt */ 0, /* put acks */ - offsetof(dbr_stsack_string,value[0]),/* string field with status */ + (unsigned short) offsetof(dbr_stsack_string,value[0]),/* string field with status */ 0, /* string */ }; diff --git a/src/ca/acctst.c b/src/ca/acctst.c index 7a26018c1..28ebab66f 100644 --- a/src/ca/acctst.c +++ b/src/ca/acctst.c @@ -2022,9 +2022,9 @@ void verifyOldPend () * verify that the old ca_pend() is in the symbol table */ status = ca_pend ( 100000.0, 1 ); - assert ( status = ECA_NORMAL ); + assert ( status == ECA_NORMAL ); status = ca_pend ( 1e-12, 0 ); - assert ( status = ECA_TIMEOUT ); + assert ( status == ECA_TIMEOUT ); } void verifyTimeStamps ( chid chan ) @@ -2042,12 +2042,12 @@ void verifyTimeStamps ( chid chan ) status = ca_get ( DBR_TIME_DOUBLE, chan, &first ); SEVCHK ( status, "fetch of dbr time double failed\n" ); status = ca_pend_io ( 20.0 ); - assert ( status = ECA_NORMAL ); + assert ( status == ECA_NORMAL ); status = ca_get ( DBR_TIME_DOUBLE, chan, &last ); SEVCHK ( status, "fetch of dbr time double failed\n" ); status = ca_pend_io ( 20.0 ); - assert ( status = ECA_NORMAL ); + assert ( status == ECA_NORMAL ); length = epicsTimeToStrftime ( buf, sizeof ( buf ), "%a %b %d %Y %H:%M:%S.%f", &first.stamp ); diff --git a/src/libCom/env/envSubr.c b/src/libCom/env/envSubr.c index 3bc522bdd..06dc6394c 100644 --- a/src/libCom/env/envSubr.c +++ b/src/libCom/env/envSubr.c @@ -73,6 +73,7 @@ #include #include #include +#include #include "shareLib.h" @@ -420,7 +421,6 @@ epicsShareFunc unsigned short epicsShareAPI envGetInetPortConfigParam { long longStatus; long epicsParam; - int port; longStatus = envGetLongConfigParam (pEnv, &epicsParam); if (longStatus!=0) { @@ -429,7 +429,7 @@ epicsShareFunc unsigned short epicsShareAPI envGetInetPortConfigParam errlogPrintf ("setting \"%s\" = %ld\n", pEnv->name, epicsParam); } - if (epicsParam<=IPPORT_USERRESERVED || epicsParam>0xffff) { + if (epicsParam<=IPPORT_USERRESERVED || epicsParam>USHRT_MAX) { errlogPrintf ("EPICS Environment \"%s\" out of range\n", pEnv->name); /* * Quit if the port is wrong due coding error @@ -442,8 +442,6 @@ epicsShareFunc unsigned short epicsShareAPI envGetInetPortConfigParam /* * ok to clip to unsigned short here because we checked the range */ - port = (unsigned short) epicsParam; - - return port; + return (unsigned short) epicsParam; }