pvif type code mapping cleanup
DBR2PVD() remove default: so that missed case is a compile warning. return -1 for invalid codes. PVD2DBR() correct int64 (not used so far)
This commit is contained in:
@ -634,22 +634,29 @@ pvd::ScalarType DBR2PVD(short dbr)
|
||||
#undef CASE_SKIP_BOOL
|
||||
#undef CASE
|
||||
case DBF_STRING: return pvd::pvString;
|
||||
default:
|
||||
throw std::invalid_argument("Unsupported DBR code");
|
||||
}
|
||||
throw std::invalid_argument("Unsupported DBR code");
|
||||
}
|
||||
|
||||
short PVD2DBR(pvd::ScalarType pvt)
|
||||
{
|
||||
switch(pvt) {
|
||||
#define CASE(BASETYPE, PVATYPE, DBFTYPE, PVACODE) case pvd::pv##PVACODE: return DBR_##DBFTYPE;
|
||||
#define CASE_SQUEEZE_INT64
|
||||
#ifdef USE_INT64
|
||||
# define CASE_REAL_INT64
|
||||
#else
|
||||
# define CASE_SQUEEZE_INT64
|
||||
#endif
|
||||
#include "pv/typemap.h"
|
||||
#undef CASE_SQUEEZE_INT64
|
||||
#ifdef USE_INT64
|
||||
# undef CASE_REAL_INT64
|
||||
#else
|
||||
# undef CASE_SQUEEZE_INT64
|
||||
#endif
|
||||
#undef CASE
|
||||
default:
|
||||
throw std::invalid_argument("Unsupported pvType code");
|
||||
case pvd::pvString: return DBF_STRING;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
epics::pvData::FieldConstPtr
|
||||
|
@ -229,7 +229,7 @@ struct DBManyLock
|
||||
{
|
||||
dbLocker *plock;
|
||||
DBManyLock() :plock(NULL) {}
|
||||
DBManyLock(const std::vector<dbCommon*>& recs, unsigned flags)
|
||||
DBManyLock(const std::vector<dbCommon*>& recs, unsigned flags=0)
|
||||
:plock(dbLockerAlloc((dbCommon**)&recs[0], recs.size(), flags))
|
||||
{
|
||||
if(!plock) throw std::invalid_argument("Failed to create locker");
|
||||
|
Reference in New Issue
Block a user