3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-11-09 07:45:08 +00:00

Remove .c_str() calls from log()/log_error()

There are some leftovers, but this is an easy regex-based approach that removes most of them.
This commit is contained in:
Robert O'Callahan 2025-09-11 05:25:26 +00:00
parent c2291c10a6
commit e0ae7b7af4
140 changed files with 623 additions and 623 deletions

View file

@ -710,7 +710,7 @@ bool run_frontend(std::string filename, std::string command, RTLIL::Design *desi
} else if (filename == "-") {
command = "script";
} else {
log_error("Can't guess frontend for input file `%s' (missing -f option)!\n", filename.c_str());
log_error("Can't guess frontend for input file `%s' (missing -f option)!\n", filename);
}
}
@ -731,7 +731,7 @@ bool run_frontend(std::string filename, std::string command, RTLIL::Design *desi
from_to_active = run_from.empty();
}
log("\n-- Executing script file `%s' --\n", filename.c_str());
log("\n-- Executing script file `%s' --\n", filename);
FILE *f = stdin;
@ -741,7 +741,7 @@ bool run_frontend(std::string filename, std::string command, RTLIL::Design *desi
}
if (f == NULL)
log_error("Can't open script file `%s' for reading: %s\n", filename.c_str(), strerror(errno));
log_error("Can't open script file `%s' for reading: %s\n", filename, strerror(errno));
FILE *backup_script_file = Frontend::current_script_file;
Frontend::current_script_file = f;
@ -790,9 +790,9 @@ bool run_frontend(std::string filename, std::string command, RTLIL::Design *desi
}
if (filename == "-") {
log("\n-- Parsing stdin using frontend `%s' --\n", command.c_str());
log("\n-- Parsing stdin using frontend `%s' --\n", command);
} else {
log("\n-- Parsing `%s' using frontend `%s' --\n", filename.c_str(), command.c_str());
log("\n-- Parsing `%s' using frontend `%s' --\n", filename, command);
}
if (command[0] == ' ') {
@ -811,7 +811,7 @@ void run_pass(std::string command, RTLIL::Design *design)
if (design == nullptr)
design = yosys_design;
log("\n-- Running command `%s' --\n", command.c_str());
log("\n-- Running command `%s' --\n", command);
Pass::call(design, command);
}
@ -843,16 +843,16 @@ void run_backend(std::string filename, std::string command, RTLIL::Design *desig
else if (filename.empty())
return;
else
log_error("Can't guess backend for output file `%s' (missing -b option)!\n", filename.c_str());
log_error("Can't guess backend for output file `%s' (missing -b option)!\n", filename);
}
if (filename.empty())
filename = "-";
if (filename == "-") {
log("\n-- Writing to stdout using backend `%s' --\n", command.c_str());
log("\n-- Writing to stdout using backend `%s' --\n", command);
} else {
log("\n-- Writing to `%s' using backend `%s' --\n", filename.c_str(), command.c_str());
log("\n-- Writing to `%s' using backend `%s' --\n", filename, command);
}
Backend::backend_call(design, NULL, filename, command);