Changeset 478 for cpp/frams/param
- Timestamp:
- 03/22/16 01:19:47 (9 years ago)
- Location:
- cpp/frams/param
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/param/mutableparam.cpp
r348 r478 171 171 ParamEntry *pe=new ParamEntry(); 172 172 pe->fun1=0; pe->fun2=0; 173 pe->group=( short)group;174 pe->flags=( short)(flags | MUTPARAM_ALLOCENTRY);173 pe->group=(paInt)group; 174 pe->flags=(paInt)(flags | MUTPARAM_ALLOCENTRY); 175 175 pe->offset=(intptr_t)data; 176 176 pe->id=strdup(id); -
cpp/frams/param/param.cpp
r464 r478 602 602 if (v.type == TObj) 603 603 { 604 logPrintf("ParamInterface", "set", LOG_ WARN, "Getting integer value from object reference (%s)", v.getString().c_str());604 logPrintf("ParamInterface", "set", LOG_ERROR, "Setting int '%s.%s' from object reference (%s)", getName(), id(i), v.getString().c_str()); 605 605 return 0; 606 606 } … … 614 614 if (v.type == TObj) 615 615 { 616 logPrintf("ParamInterface", "set", LOG_ WARN, "Getting floating point value from object reference (%s)", v.getString().c_str());616 logPrintf("ParamInterface", "set", LOG_ERROR, "Setting float '%s.%s' from object reference (%s)", getName(), id(i), v.getString().c_str()); 617 617 return 0; 618 618 } … … 621 621 } 622 622 case 's': { SString t = v.getString(); return setString(i, t); } 623 case 'o': return setObject(i, v.getObject()); 623 case 'o': 624 if ((v.type!=TUnknown)&&(v.type!=TObj)) 625 logPrintf("ParamInterface", "set", LOG_ERROR, "Setting object '%s.%s' from %s", getName(), id(i), v.typeAndValue().c_str()); 626 else 627 return setObject(i, v.getObject()); 628 break; 624 629 case 'x': return setExtValue(i, v); 625 630 default: logPrintf("ParamInterface", "set", LOG_ERROR, "'%s.%s' is not a field", getName(), id(i)); … … 645 650 if ((after == NULL) || (*after)) 646 651 { 647 logPrintf("ParamInterface", "set", LOG_ WARN, "serialization format mismatch in %s.%s", (getName() ? getName() : "<Unknown>"), id(i));652 logPrintf("ParamInterface", "set", LOG_ERROR, "serialization format mismatch in %s.%s", (getName() ? getName() : "<Unknown>"), id(i)); 648 653 e.setEmpty(); 649 654 } … … 956 961 ParamEntry *pe = entry(i); 957 962 if (pe->flags&PARAM_READONLY) return PSET_RONLY; 963 if (pe->flags&PARAM_OBJECTSET) 964 { 965 ExtObject o=getObject(i); 966 Param tmp; 967 ParamInterface* oif=o.getParamInterface(tmp); 968 int ass; 969 if (oif && ((ass=oif->findId("assign"))>=0)) 970 { 971 ExtValue arg=x; 972 oif->call(ass,&arg,&v); 973 } 974 else 975 logPrintf("SimpleAbstractParam", "setObject", LOG_ERROR, 976 "'%s.%s' is PARAM_OBJECTSET but no 'assign()' in %s", getName(), pe->id, o.interfaceName()); 977 return PSET_CHANGED; 978 } 958 979 ExtObject xcopy = x; //only needed for messageOnExceedRange(): retain original, requested value of x because it may be changed below 959 980 if (pe->fun2) -
cpp/frams/param/param.h
r393 r478 33 33 #define PARAM_DEPRECATED 8192 //< this member is deprecated 34 34 #define PARAM_LINECOMMENT 16384 //< Param::load() adds "@line ..." comment when loading multiline (internal use) 35 #define PARAM_OBJECTSET 32768 //< setting this field is handled by the object's assign(...) function and cannot change the object reference 35 36 36 37 typedef int32_t paInt; … … 216 217 { 217 218 const char *id; 218 short group, flags;219 paInt group, flags; 219 220 const char *name, *type; 220 221 intptr_t offset; … … 227 228 { 228 229 public: 229 ParamEntryConstructor(const char *_id, short _group = 0, short _flags = 0, const char *_name = 0, const char *_type = 0, intptr_t _offset = 0, void *_fun1 = 0, void *_fun2 = 0, const char *_help = 0)230 ParamEntryConstructor(const char *_id, paInt _group = 0, paInt _flags = 0, const char *_name = 0, const char *_type = 0, intptr_t _offset = 0, void *_fun1 = 0, void *_fun2 = 0, const char *_help = 0) 230 231 { 231 232 id = _id; group = _group; flags = _flags; name = _name; type = _type; offset = _offset; fun1 = _fun1; fun2 = _fun2; help = _help; -
cpp/frams/param/paramobj.cpp
r396 r478 41 41 if (addnew) count++; 42 42 t = tab = (ParamEntry*)malloc(sizeof(ParamEntry)*(count + gcount + 1)); 43 t->group = ( short)gcount;44 t->flags = ( short)count;43 t->group = (paInt)gcount; 44 t->flags = (paInt)count; 45 45 t->name = maybedup(dupentries, rename ? rename : pi->getName()); 46 46 t->type = maybedup(dupentries, pi->getDescription()); … … 82 82 offset += sizeof(ExtValue); 83 83 } 84 t->group = ( short)(stripgroups ? 0 : pi->group(i));85 t->flags = ( short)pi->flags(i);84 t->group = (paInt)(stripgroups ? 0 : pi->group(i)); 85 t->flags = (paInt)pi->flags(i); 86 86 if (readonly_into_userreadonly && (t->flags & PARAM_READONLY)) 87 87 t->flags=(t->flags & ~PARAM_READONLY) | PARAM_USERREADONLY; -
cpp/frams/param/paramtabobj.cpp
r286 r478 25 25 memmove(tab+siz-count,p,sizeof(ParamEntry)*count); 26 26 memset(tab+siz,0,sizeof(ParamEntry)); 27 if (siz>0) tab[0].flags=( short)(siz-tab[0].group);27 if (siz>0) tab[0].flags=(paInt)(siz-tab[0].group); 28 28 return siz-1; 29 29 } … … 34 34 resize(siz-count); 35 35 memset(tab+siz,0,sizeof(ParamEntry)); 36 if (siz>0) tab[0].flags=( short)(siz-tab[0].group);36 if (siz>0) tab[0].flags=(paInt)(siz-tab[0].group); 37 37 } 38 38
Note: See TracChangeset
for help on using the changeset viewer.