minor changes; fix bug in nttable.cpp

This commit is contained in:
Marty Kraimer
2012-08-02 14:05:22 -04:00
parent 0f251f5eb1
commit 63268f3823
3 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* ntArgument.h */
/* ntfield.cpp */
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found

View File

@ -1,4 +1,4 @@
/* ntnameValue.h */
/* ntnameValue.cpp */
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
@ -47,7 +47,7 @@ NTNameValuePtr NTNameValue::create(
fields[0] = fieldCreate->createScalarArray(pvString);
names[1] = "values";
fields[1] = fieldCreate->createScalarArray(pvString);
int ind = 2;
size_t ind = 2;
if(hasFunction) {
names[ind] = "function";
fields[ind++] = fieldCreate->createScalar(pvString);

View File

@ -1,4 +1,4 @@
/* nttable.h */
/* nttable.cpp */
/**
* Copyright - See the COPYRIGHT that is included with this distribution.
* EPICS pvDataCPP is distributed subject to a Software License Agreement found
@ -14,7 +14,6 @@ using std::tr1::static_pointer_cast;
bool NTTable::isNTTable(PVStructurePtr const & pvStructure)
{
NTFieldPtr ntfield = NTField::get();
//StandardField *standardField = getStandardField();
PVStringArrayPtr pvLabel = static_pointer_cast<PVStringArray>
(pvStructure->getScalarArrayField("label",pvString));
if(pvLabel.get()==NULL) return false;
@ -31,10 +30,11 @@ bool NTTable::isNTTable(PVStructurePtr const & pvStructure)
if(pvField.get()!=NULL && ntfield->isAlarm(pvField->getField())) {
nextra++;
}
if(nfields!=(pvStructure->getStructure()->getNumberFields()-nextra)) return false;
if(nfields!=(pvStructure->getStructure()->getNumberFields()-nextra)) {
return false;
}
FieldConstPtrArray fields = pvStructure->getStructure()->getFields();
int n = nfields - nextra;
for(int i=0; i<n; i++) {
for(size_t i=0; i<nfields; i++) {
FieldConstPtr field = fields[i+nextra];
Type type = field->getType();
if(type!=scalarArray && type!=structureArray) return false;