Skip to content

Commit

Permalink
Fix missing initialization
Browse files Browse the repository at this point in the history
tttr_container_type_str was not
correctly initialized
  • Loading branch information
tpeulen committed Sep 30, 2024
1 parent 5b3ca15 commit 9d47fc0
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/TTTR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ TTTR::TTTR(const TTTR &p2){

TTTR::TTTR(const char *fn, int container_type, bool read_input) : TTTR(){
if(container_type >= 0){
filename.assign(fn);
tttr_container_type_str = container_names.right.at(container_type);
tttr_container_type = container_type;
filename.assign(fn);
if(read_input){
if(read_file())
find_used_routing_channels();
Expand All @@ -133,17 +134,6 @@ TTTR::TTTR(const char *fn, int container_type, bool read_input) : TTTR(){
}
}

TTTR::TTTR(const char *fn, int container_type) : TTTR(fn, container_type, true) {
try {
tttr_container_type_str.assign(
container_names.right.at(container_type)
);
}
catch(...) {
std::cerr << "TTTR::TTTR(const char *fn, int container_type): Container type " << container_type << " not supported." << std::endl;
}
}

TTTR::TTTR(const char *fn, const char *container_type) : TTTR() {
try {
tttr_container_type_str.assign(container_type);
Expand All @@ -157,6 +147,17 @@ TTTR::TTTR(const char *fn, const char *container_type) : TTTR() {
}
}

TTTR::TTTR(const char *fn, int container_type) : TTTR(fn, container_type, true) {
try {
tttr_container_type_str.assign(
container_names.right.at(container_type)
);
}
catch(...) {
std::cerr << "TTTR::TTTR(const char *fn, int container_type): Container type " << container_type << " not supported." << std::endl;
}
}

TTTR::TTTR(const char* filename) : TTTR(filename, inferTTTRFileType(filename), true) {}


Expand Down

0 comments on commit 9d47fc0

Please sign in to comment.