mirror of
https://github.com/YosysHQ/yosys
synced 2025-09-18 07:31:31 +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:
parent
c2291c10a6
commit
e0ae7b7af4
140 changed files with 623 additions and 623 deletions
|
@ -242,7 +242,7 @@ struct arg_map_t
|
|||
void add_arg(const std::string &name, const char *default_value)
|
||||
{
|
||||
if (find(name)) {
|
||||
log_error("Duplicate macro arguments with name `%s'.\n", name.c_str());
|
||||
log_error("Duplicate macro arguments with name `%s'.\n", name);
|
||||
}
|
||||
|
||||
name_to_pos[name] = args.size();
|
||||
|
@ -789,14 +789,14 @@ frontend_verilog_preproc(std::istream &f,
|
|||
else if (ifdef_pass_level > 0)
|
||||
ifdef_pass_level--;
|
||||
else
|
||||
log_error("Found %s outside of macro conditional branch!\n", tok.c_str());
|
||||
log_error("Found %s outside of macro conditional branch!\n", tok);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (tok == "`else") {
|
||||
if (ifdef_fail_level == 0) {
|
||||
if (ifdef_pass_level == 0)
|
||||
log_error("Found %s outside of macro conditional branch!\n", tok.c_str());
|
||||
log_error("Found %s outside of macro conditional branch!\n", tok);
|
||||
ifdef_pass_level--;
|
||||
ifdef_fail_level = 1;
|
||||
ifdef_already_satisfied = true;
|
||||
|
@ -813,7 +813,7 @@ frontend_verilog_preproc(std::istream &f,
|
|||
std::string name = next_token(true);
|
||||
if (ifdef_fail_level == 0) {
|
||||
if (ifdef_pass_level == 0)
|
||||
log_error("Found %s outside of macro conditional branch!\n", tok.c_str());
|
||||
log_error("Found %s outside of macro conditional branch!\n", tok);
|
||||
ifdef_pass_level--;
|
||||
ifdef_fail_level = 1;
|
||||
ifdef_already_satisfied = true;
|
||||
|
|
|
@ -497,7 +497,7 @@ struct VerilogFrontend : public Frontend {
|
|||
if (!flag_nopp) {
|
||||
code_after_preproc = frontend_verilog_preproc(*f, filename, defines_map, *design->verilog_defines, include_dirs, parse_state, parse_mode);
|
||||
if (flag_ppdump)
|
||||
log("-- Verilog code after preprocessor --\n%s-- END OF DUMP --\n", code_after_preproc.c_str());
|
||||
log("-- Verilog code after preprocessor --\n%s-- END OF DUMP --\n", code_after_preproc);
|
||||
parse_state.lexin = new std::istringstream(code_after_preproc);
|
||||
}
|
||||
|
||||
|
|
|
@ -3261,7 +3261,7 @@ basic_expr:
|
|||
ConstParser p{@4};
|
||||
auto val = p.const2ast(*$4, extra->case_type_stack.size() == 0 ? 0 : extra->case_type_stack.back(), !mode->lib);
|
||||
if (val == nullptr)
|
||||
log_error("Value conversion failed: `%s'\n", $4->c_str());
|
||||
log_error("Value conversion failed: `%s'\n", *$4);
|
||||
$$ = std::make_unique<AstNode>(@$, AST_TO_BITS, std::move($2), std::move(val));
|
||||
} |
|
||||
hierarchical_id integral_number {
|
||||
|
@ -3274,7 +3274,7 @@ basic_expr:
|
|||
auto val = p.const2ast(*$2, extra->case_type_stack.size() == 0 ? 0 : extra->case_type_stack.back(), !mode->lib);
|
||||
SET_AST_NODE_LOC(val.get(), @2, @2);
|
||||
if (val == nullptr)
|
||||
log_error("Value conversion failed: `%s'\n", $2->c_str());
|
||||
log_error("Value conversion failed: `%s'\n", *$2);
|
||||
$$ = std::make_unique<AstNode>(@$, AST_TO_BITS, std::move(bits), std::move(val));
|
||||
} |
|
||||
integral_number {
|
||||
|
@ -3282,7 +3282,7 @@ basic_expr:
|
|||
$$ = p.const2ast(*$1, extra->case_type_stack.size() == 0 ? 0 : extra->case_type_stack.back(), !mode->lib);
|
||||
SET_AST_NODE_LOC($$.get(), @1, @1);
|
||||
if ($$ == nullptr)
|
||||
log_error("Value conversion failed: `%s'\n", $1->c_str());
|
||||
log_error("Value conversion failed: `%s'\n", *$1);
|
||||
} |
|
||||
TOK_REALVAL {
|
||||
$$ = std::make_unique<AstNode>(@$, AST_REALVALUE);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue