- Timestamp:
- 06/22/23 03:27:28 (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/param/param.cpp
r1217 r1253 11 11 #include <frams/util/sstringutils.h> 12 12 #include <common/virtfile/stringfile.h> 13 #include <common/nonstd_math.h> 13 14 14 15 #ifdef _DEBUG … … 358 359 { 359 360 SString ret = getName(); 360 if (ret.size() >0) //name might be unavailable, happened in GenMan sub-Params361 if (ret.size() > 0) //name might be unavailable, happened in GenMan sub-Params 361 362 ret += "."; 362 363 ret += id(prop); … … 367 368 { 368 369 SString name_dot_prop = nameDotProperty(prop); 369 if (getName() ==NULL || getLongName()==NULL) //name/longname might be unavailable, happened in GenMan sub-Params370 if (getName() == NULL || getLongName() == NULL) //name/longname might be unavailable, happened in GenMan sub-Params 370 371 return name_dot_prop; 371 372 372 373 if (strcmp(getName(), getLongName()) == 0) 373 374 { … … 422 423 // t+=SString(getName()); t+=':'; 423 424 for (i = 0; p = id(i); i++) 424 if ((!((fl = flags(i)) & PARAM_DONTSAVE)) && type(i)[0] !='p')425 if ((!((fl = flags(i)) & PARAM_DONTSAVE)) && type(i)[0] != 'p') 425 426 { 426 427 if (defdata && isequal(i, defdata)) … … 716 717 int ParamInterface::findGroupId(const char* name) 717 718 { 718 for(int i=0;i<getGroupCount();i++)719 if (!strcmp(grname(i),name))720 return i;721 return -1;719 for (int i = 0; i < getGroupCount(); i++) 720 if (!strcmp(grname(i), name)) 721 return i; 722 return -1; 722 723 } 723 724 … … 1131 1132 if (x < mn) { x = mn; result = PSET_HITMIN; } 1132 1133 else if (x > mx) { x = mx; result = PSET_HITMAX; } 1134 clipNegativeZeroIfNeeded(x, mn); //by the official standard, 0.0 == -0.0 and so it is not true that -0.0 < 0.0, so -0.0 would not be clipped to 0.0, i.e., if we defined the allowed range to be, for example, [0.0, 1.0], then without this call, x==-0.0 would be accepted. Since we never allow x==-0.0 for mn==0 past this point, we don't need to check below if the value changed from -0.0 to 0.0 (which would require comparing old and new std::signbit(x) etc.), because -0.0 could have never been set earlier. 1133 1135 } 1134 1136
Note: See TracChangeset
for help on using the changeset viewer.