Merged changes from 3.14 branch to revno 12590
This commit is contained in:
@@ -233,6 +233,17 @@ static void dbtpnCallFunc(const iocshArgBuf *args)
|
||||
static const iocshFuncDef dbNotifyDumpFuncDef = {"dbNotifyDump",0,0};
|
||||
static void dbNotifyDumpCallFunc(const iocshArgBuf *args) { dbNotifyDump();}
|
||||
|
||||
/* dbPutAttribute */
|
||||
static const iocshArg dbPutAttrArg0 = { "record type",iocshArgString};
|
||||
static const iocshArg dbPutAttrArg1 = { "attribute name",iocshArgString};
|
||||
static const iocshArg dbPutAttrArg2 = { "value",iocshArgString};
|
||||
static const iocshArg * const dbPutAttrArgs[] =
|
||||
{&dbPutAttrArg0, &dbPutAttrArg1, &dbPutAttrArg2};
|
||||
static const iocshFuncDef dbPutAttrFuncDef =
|
||||
{"dbPutAttribute",3,dbPutAttrArgs};
|
||||
static void dbPutAttrCallFunc(const iocshArgBuf *args)
|
||||
{ dbPutAttribute(args[0].sval,args[1].sval,args[2].sval);}
|
||||
|
||||
/* tpn */
|
||||
static const iocshArg tpnArg0 = { "record name",iocshArgString};
|
||||
static const iocshArg tpnArg1 = { "value",iocshArgString};
|
||||
@@ -405,6 +416,7 @@ void dbIocRegister(void)
|
||||
iocshRegister(&pftFuncDef,pftCallFunc);
|
||||
iocshRegister(&dbtpnFuncDef,dbtpnCallFunc);
|
||||
iocshRegister(&dbNotifyDumpFuncDef,dbNotifyDumpCallFunc);
|
||||
iocshRegister(&dbPutAttrFuncDef,dbPutAttrCallFunc);
|
||||
iocshRegister(&tpnFuncDef,tpnCallFunc);
|
||||
iocshRegister(&dblsrFuncDef,dblsrCallFunc);
|
||||
iocshRegister(&dbLockShowLockedFuncDef,dbLockShowLockedCallFunc);
|
||||
|
||||
@@ -132,7 +132,7 @@ const char *initHookName(int state)
|
||||
"initHookAfterInterruptAccept",
|
||||
"initHookAtEnd"
|
||||
};
|
||||
if (state < 0 || state > NELEMENTS(stateName)) {
|
||||
if (state < 0 || state >= NELEMENTS(stateName)) {
|
||||
return "Not an initHookState";
|
||||
}
|
||||
return stateName[state];
|
||||
|
||||
+3
-3
@@ -309,11 +309,11 @@ static void getMaxRangeValues(short field_type, double *pupper_limit,
|
||||
{
|
||||
switch(field_type){
|
||||
case DBF_CHAR:
|
||||
*pupper_limit = -128.0;
|
||||
*plower_limit = 127.0;
|
||||
*pupper_limit = (double) CHAR_MAX;
|
||||
*plower_limit = (double) CHAR_MIN;
|
||||
break;
|
||||
case DBF_UCHAR:
|
||||
*pupper_limit = 255.0;
|
||||
*pupper_limit = (double) UCHAR_MAX;
|
||||
*plower_limit = 0.0;
|
||||
break;
|
||||
case DBF_SHORT:
|
||||
|
||||
@@ -1198,7 +1198,7 @@ long dbPutRecordAttribute(
|
||||
|
||||
pnew = dbCalloc(1,sizeof(dbRecordAttribute));
|
||||
if(pattribute) {
|
||||
ellInsert(&precordType->attributeList,&pattribute->node,
|
||||
ellInsert(&precordType->attributeList,pattribute->node.previous,
|
||||
&pnew->node);
|
||||
} else {
|
||||
ellAdd(&precordType->attributeList,&pnew->node);
|
||||
@@ -1232,11 +1232,16 @@ long dbGetAttributePart(DBENTRY *pdbentry, const char **ppname)
|
||||
size_t nameLen = strlen(pattribute->name);
|
||||
int compare = strncmp(pattribute->name, pname, nameLen);
|
||||
int ch = pname[nameLen];
|
||||
if (compare == 0 && !(ch == '_' || isalnum(ch))) {
|
||||
pdbentry->pflddes = pattribute->pdbFldDes;
|
||||
pdbentry->pfield = pattribute->value;
|
||||
*ppname = &pname[nameLen];
|
||||
return 0;
|
||||
if (compare == 0) {
|
||||
if (!(ch == '_' || isalnum(ch))) {
|
||||
pdbentry->pflddes = pattribute->pdbFldDes;
|
||||
pdbentry->pfield = pattribute->value;
|
||||
*ppname = &pname[nameLen];
|
||||
return 0;
|
||||
}
|
||||
if (strlen(pname) > nameLen) {
|
||||
compare = -1;
|
||||
}
|
||||
}
|
||||
if (compare >= 0) break;
|
||||
pattribute = (dbRecordAttribute *)ellNext(&pattribute->node);
|
||||
|
||||
Reference in New Issue
Block a user