mirror of https://github.com/YosysHQ/yosys.git
Replaced strlen by GetSize into simplify.cc
As recommended in CodingReadme. Signed-off-by: Rodrigo Alejandro Melo <rmelo@inti.gob.ar>
This commit is contained in:
parent
8217f579b7
commit
71f3afb9a2
|
@ -2886,15 +2886,15 @@ AstNode *AstNode::readmem(bool is_readmemh, std::string mem_filename, AstNode *m
|
||||||
int meminit_size=0;
|
int meminit_size=0;
|
||||||
|
|
||||||
std::ifstream f;
|
std::ifstream f;
|
||||||
std::string path = filename.substr(0, filename.find_last_of("\\/")+1);
|
|
||||||
f.open(mem_filename.c_str());
|
f.open(mem_filename.c_str());
|
||||||
if (f.fail()) {
|
if (f.fail()) {
|
||||||
|
std::string path = filename.substr(0, filename.find_last_of("\\/")+1);
|
||||||
f.open(path + mem_filename.c_str());
|
f.open(path + mem_filename.c_str());
|
||||||
yosys_input_files.insert(path + mem_filename);
|
yosys_input_files.insert(path + mem_filename);
|
||||||
} else {
|
} else {
|
||||||
yosys_input_files.insert(mem_filename);
|
yosys_input_files.insert(mem_filename);
|
||||||
}
|
}
|
||||||
if (f.fail() || strlen(mem_filename.c_str()) == 0)
|
if (f.fail() || GetSize(mem_filename) == 0)
|
||||||
log_file_error(filename, linenum, "Can not open file `%s` for %s.\n", mem_filename.c_str(), str.c_str());
|
log_file_error(filename, linenum, "Can not open file `%s` for %s.\n", mem_filename.c_str(), str.c_str());
|
||||||
|
|
||||||
log_assert(GetSize(memory->children) == 2 && memory->children[1]->type == AST_RANGE && memory->children[1]->range_valid);
|
log_assert(GetSize(memory->children) == 2 && memory->children[1]->type == AST_RANGE && memory->children[1]->range_valid);
|
||||||
|
|
Loading…
Reference in New Issue