Changeset 348 for cpp/frams/param
- Timestamp:
- 04/09/15 23:51:28 (10 years ago)
- Location:
- cpp/frams/param
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/param/multiparamload.cpp
r333 r348 107 107 else if (status==BeforeUnknown) 108 108 { 109 FMprintf("MultiParamLoader","go",FMLV_WARN,"Skipping object '%s'", (const char*)lastunknown);109 FMprintf("MultiParamLoader","go",FMLV_WARN,"Skipping object '%s'",lastunknown.c_str()); 110 110 loadObjectNow(&emptyparam,false); 111 111 continue; … … 126 126 if (buf.startsWith("#include")) 127 127 { 128 const char* t=strchr( (const char*)buf,'\"'),*t2=0;128 const char* t=strchr(buf.c_str(),'\"'),*t2=0; 129 129 if (t) 130 130 t2=strchr(t+1,'\"'); … … 137 137 { 138 138 const char* thisfilename=file->VgetPath(); 139 FMprintf("MultiParamLoader","go",FMLV_WARN,"invalid \"%s\"%s%s", (const char*)buf,139 FMprintf("MultiParamLoader","go",FMLV_WARN,"invalid \"%s\"%s%s",buf.c_str(), 140 140 (thisfilename?" in ":""),(thisfilename?thisfilename:"")); 141 141 } … … 157 157 FOREACH(ExtObject*,o,objects) 158 158 { 159 if (!strcmp(o->interfaceName(),lastunknown )) {lastobject=*o; break;}159 if (!strcmp(o->interfaceName(),lastunknown.c_str())) {lastobject=*o; break;} 160 160 } 161 161 if (!lastobject.isEmpty()) … … 202 202 newfilename=filename; 203 203 204 if (alreadyIncluded(newfilename ))204 if (alreadyIncluded(newfilename.c_str())) 205 205 { 206 206 FMprintf("MultiParamLoader","include",FMLV_WARN,"circular reference ignored (\"%s\")", 207 (const char*)filename);207 filename.c_str()); 208 208 return; 209 209 } 210 210 211 VirtFILE *f=Vfopen(newfilename ,FOPEN_READ_BINARY);211 VirtFILE *f=Vfopen(newfilename.c_str(),FOPEN_READ_BINARY); 212 212 if (!f) 213 213 { 214 FMprintf("MultiParamLoader","include",FMLV_WARN,"\"%s\" not found", (const char*)newfilename);214 FMprintf("MultiParamLoader","include",FMLV_WARN,"\"%s\" not found",newfilename.c_str()); 215 215 } 216 216 else -
cpp/frams/param/mutableparam.cpp
r286 r348 33 33 if (ignoreprefix) 34 34 { 35 const char *noprefix= (const char*)groupname(i);35 const char *noprefix=groupname(i).c_str(); 36 36 if ((int)strlen(noprefix) < skipprefix) continue; 37 37 noprefix+=skipprefix; 38 if (!strcmp(noprefix, (const char*)name)) return i;38 if (!strcmp(noprefix,name.c_str())) return i; 39 39 } 40 40 else … … 183 183 void MutableParam::p_addprop(ExtValue *args,ExtValue *ret) 184 184 { 185 int i=addProperty(0,args[2].getString() ,args[1].getString(),args[0].getString());185 int i=addProperty(0,args[2].getString().c_str(),args[1].getString().c_str(),args[0].getString().c_str()); 186 186 ret->setInt(i); 187 187 } … … 284 284 { 285 285 SString *n=(SString*)store(i); 286 int prop=p.findId( (const char*)*n);286 int prop=p.findId(n->c_str()); 287 287 if (prop<0) 288 prop=p.addProperty(0, (const char*)*n,"x",0,0,0,0,-1);288 prop=p.addProperty(0,n->c_str(),"x",0,0,0,0,-1); 289 289 p.setExtValue(prop,*(ExtValue*)store(i+1)); 290 290 } -
cpp/frams/param/mutableparam.h
r286 r348 36 36 int getGroupCount() {return groups.size();} 37 37 int getPropCount() {return entries.size()+staticprops;} 38 const char *grname(int i) {return (i>=groups.size()) ? 0 : (const char*)groupname(i);}38 const char *grname(int i) {return (i>=groups.size()) ? 0 : groupname(i).c_str();} 39 39 int grmember(int g,int a); 40 40 -
cpp/frams/param/param.cpp
r343 r348 301 301 ws = get(i); 302 302 quoteTilde(ws); 303 w = ws ;303 w = ws.c_str(); 304 304 if (ws.len() > 50) cr = 1; 305 305 else for (t = w; *t; t++) if ((*t == 10) || (*t == 13)) { cr = 1; break; } … … 372 372 { // string - special case 373 373 SString str = getString(i); 374 if (strContainsOneOf(str , ", \\\n\r\t\""))374 if (strContainsOneOf(str.c_str(), ", \\\n\r\t\"")) 375 375 { 376 376 t += "\""; … … 403 403 { 404 404 if (linenum) (*linenum)++; 405 const char* t = (const char*)buf;405 const char* t = buf.c_str(); 406 406 p0 = t; while ((*p0 == ' ') || (*p0 == '\t')) p0++; 407 407 if (!*p0) break; … … 419 419 czytdotyldy(f, s); 420 420 int lfcount = 1; 421 const char* tmp = s ;421 const char* tmp = s.c_str(); 422 422 while (tmp) 423 423 if ((tmp = strchr(tmp, '\n'))) … … 430 430 if (linenum && (flags(i)&PARAM_LINECOMMENT)) 431 431 s = SString::sprintf("@file %s\n@line %d\n", f->VgetPath(), *linenum + 1) + s; 432 set(i, (const char*)s);432 set(i, s.c_str()); 433 433 if (linenum) 434 434 (*linenum) += lfcount; … … 445 445 { 446 446 SString name(p0, p_len); 447 FMprintf("ParamInterface", "load", FMLV_WARN, "Unknown property '%s' while reading object '%s' (ignored)", (const char*)name, getName());447 FMprintf("ParamInterface", "load", FMLV_WARN, "Unknown property '%s' while reading object '%s' (ignored)", name.c_str(), getName()); 448 448 } 449 449 … … 454 454 if (linenum) 455 455 { 456 const char* tmp = s ;456 const char* tmp = s.c_str(); 457 457 int lfcount = 1; 458 458 while (tmp) … … 562 562 if (v.type == TObj) 563 563 { 564 FMprintf("ParamInterface", "set", FMLV_WARN, "Getting integer value from object reference (%s)", (const char*)v.getString());564 FMprintf("ParamInterface", "set", FMLV_WARN, "Getting integer value from object reference (%s)", v.getString().c_str()); 565 565 return 0; 566 566 } 567 567 else 568 return setInt(i, (const char*)v.getString());568 return setInt(i, v.getString().c_str()); 569 569 } 570 570 case 'f': … … 574 574 if (v.type == TObj) 575 575 { 576 FMprintf("ParamInterface", "set", FMLV_WARN, "Getting floating point value from object reference (%s)", (const char*)v.getString());576 FMprintf("ParamInterface", "set", FMLV_WARN, "Getting floating point value from object reference (%s)", v.getString().c_str()); 577 577 return 0; 578 578 } 579 579 else 580 return setDouble(i, (const char*)v.getString());580 return setDouble(i, v.getString().c_str()); 581 581 } 582 582 case 's': { SString t = v.getString(); return setString(i, t); } … … 990 990 static const char *getline(const SString &s, int &poz, int &len) 991 991 { 992 const char *beg = (const char*)s+ poz;993 if (poz >= s.len()) { poz = s.len(); len = 0; return (const char*)s+ s.len(); }992 const char *beg = s.c_str() + poz; 993 if (poz >= s.len()) { poz = s.len(); len = 0; return s.c_str() + s.len(); } 994 994 const char *lf = strchr(beg, '\n'); 995 if (!lf) { lf = (const char*)s+ s.len() - 1; poz = s.len(); }996 else { poz = (int)(lf - (const char*)s) + 1; if (poz > s.len()) poz = s.len(); }995 if (!lf) { lf = s.c_str() + s.len() - 1; poz = s.len(); } 996 else { poz = (int)(lf - s.c_str()) + 1; if (poz > s.len()) poz = s.len(); } 997 997 while (lf >= beg) if ((*lf == '\n') || (*lf == '\r')) lf--; else break; 998 998 len = (int)(lf - beg) + 1; … … 1014 1014 SString tmpvalue; 1015 1015 if (poz >= s.len()) return fields_loaded; 1016 t = (const char*)s+ poz;1016 t = s.c_str() + poz; 1017 1017 1018 1018 lin = getline(s, poz, len); // all fields must be encoded in a single line … … 1060 1060 { 1061 1061 SString name(t, (int)(equals_sign - t)); 1062 FMprintf("Param", "load2", FMLV_WARN, "Unknown property '%s' while reading object '%s' (ignored)", (const char*)name, getName());1062 FMprintf("Param", "load2", FMLV_WARN, "Unknown property '%s' while reading object '%s' (ignored)", name.c_str(), getName()); 1063 1063 } 1064 1064 t = equals_sign + 1; // t=value … … 1081 1081 tmpvalue.copyFrom(quote + 1, (int)(quote2 - quote) - 1); 1082 1082 sstringUnquote(tmpvalue); 1083 value = tmpvalue ;1083 value = tmpvalue.c_str(); 1084 1084 valstop = quote2; 1085 1085 } -
cpp/frams/param/param.h
r333 r348 274 274 SString actual = get(i); 275 275 FMprintf("Param", "set", FMLV_WARN, "Setting '%s.%s = %s' exceeded allowed range (too %s). Adjusted to %s.", 276 getName(), id(i), (const char*)svaluetoset, (setflags&PSET_HITMAX) ? "big" : "small", (const char*)actual);276 getName(), id(i), svaluetoset.c_str(), (setflags&PSET_HITMAX) ? "big" : "small", actual.c_str()); 277 277 } 278 278 } -
cpp/frams/param/paramobj.cpp
r326 r348 58 58 t->name = maybedup(dupentries, "create new object"); 59 59 SString tmp = SString::sprintf("p o%s()", pi->getName()); 60 t->type = maybedup(dupentries, (const char*)tmp);60 t->type = maybedup(dupentries, tmp.c_str()); 61 61 t->help = maybedup(dupentries, pi->help(i)); 62 62 t->flags = 0;
Note: See TracChangeset
for help on using the changeset viewer.