- Timestamp:
- 07/03/16 17:36:35 (9 years ago)
- Location:
- cpp/frams
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/param/multiparamload.cpp
r413 r523 66 66 if (file && ownfile) 67 67 { 68 fclose(file);68 delete file; 69 69 file=0; 70 70 } … … 258 258 { 259 259 VirtFILE *f; 260 while(f=popstack()) fclose(f);260 while(f=popstack()) delete f; 261 261 } 262 262 … … 264 264 { 265 265 if (!filestack.size()) return false; 266 if (file) fclose(file);266 if (file) delete file; 267 267 file=popstack(); 268 268 return true; -
cpp/frams/param/param.cpp
r483 r523 25 25 int z; 26 26 char last_char = 0; 27 while ((z = f getc(f)) != EOF)27 while ((z = f->Vgetc()) != EOF) 28 28 { 29 29 if (z == '~') … … 267 267 if ((altname == NULL) || (altname[0] != 0)) 268 268 { 269 err |= (f puts(altname ? altname : getName(), f) == EOF);270 err |= (f puts(":\n", f) == EOF);269 err |= (f->Vputs(altname ? altname : getName()) == EOF); 270 err |= (f->Vputs(":\n") == EOF); 271 271 withname = true; 272 272 } … … 274 274 err |= saveprop(f, i, p, force); 275 275 if (withname) 276 err |= (f puts("\n", f) == EOF);276 err |= (f->Vputs("\n") == EOF); 277 277 return err; 278 278 } … … 290 290 int err = 0, cr; 291 291 292 err |= (f puts(p, f) == EOF); fputc(':', f);292 err |= (f->Vputs(p) == EOF); f->Vputc(':'); 293 293 cr = 0; 294 294 if ((*typ == 'x') || (*typ == 'o')) … … 304 304 if (ws.len() > 50) cr = 1; 305 305 else for (t = w; *t; t++) if ((*t == 10) || (*t == 13)) { cr = 1; break; } 306 if (cr) f puts("~\n", f);307 err |= (f puts(w, f) == EOF);308 err |= (f puts(cr ? "~\n" : "\n", f) == EOF);306 if (cr) f->Vputs("~\n"); 307 err |= (f->Vputs(w) == EOF); 308 err |= (f->Vputs(cr ? "~\n" : "\n") == EOF); 309 309 return err; 310 310 } … … 464 464 } 465 465 removeCR(s); 466 int ch; while ((ch = f getc(f)) != EOF) if (ch == '\n') break;466 int ch; while ((ch = f->Vgetc()) != EOF) if (ch == '\n') break; 467 467 unquoteTilde(s); 468 468 if (linenum && (flags(i)&PARAM_LINECOMMENT)) … … 501 501 (*linenum) += lfcount; 502 502 } 503 int ch; while ((ch = f getc(f)) != EOF) if (ch == '\n') break;503 int ch; while ((ch = f->Vgetc()) != EOF) if (ch == '\n') break; 504 504 } 505 505 } -
cpp/frams/util/sstringutils.cpp
r512 r523 16 16 loadSString(f, s); 17 17 ret = 1; 18 fclose(f);18 delete f; 19 19 } 20 20 else if (framsgmodule) … … 29 29 while (!f->Veof()) 30 30 { 31 len = f read(buf, 1, sizeof(buf), f);31 len = f->Vread(buf, 1, sizeof(buf)); 32 32 s.append(buf, len); 33 33 } … … 44 44 while (!eolfound) 45 45 { 46 char *r = f gets(buf, sizeof(buf), f);46 char *r = f->Vgets(buf, sizeof(buf)); 47 47 if (r == NULL) break; 48 48 ret = true; -
cpp/frams/vm/framscript.y
r489 r523 149 149 150 150 asmlines: /* empty */ 151 | ASMLINE { fputs(str($1),trctx.out);fputc('\n',trctx.out);}152 | asmlines ASMLINE { fputs(str($2),trctx.out);fputc('\n',trctx.out);}151 | ASMLINE {trctx.out->Vputs(str($1));trctx.out->Vputc('\n');} 152 | asmlines ASMLINE {trctx.out->Vputs(str($2));trctx.out->Vputc('\n');} 153 153 ; 154 154
Note: See TracChangeset
for help on using the changeset viewer.