From 8bb5d875a8ead5fd7d1a51e6517cc524c36e2d50 Mon Sep 17 00:00:00 2001 From: coolbreeze413 Date: Thu, 12 Oct 2023 01:57:43 +0530 Subject: [PATCH 1/3] Add 'not found' check for finding file extension of arch xml --- libs/libarchfpga/src/read_xml_arch_file.cpp | 2 +- libs/libpugiutil/src/pugixml_util.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libs/libarchfpga/src/read_xml_arch_file.cpp b/libs/libarchfpga/src/read_xml_arch_file.cpp index 978865ec6de..368105d68ff 100644 --- a/libs/libarchfpga/src/read_xml_arch_file.cpp +++ b/libs/libarchfpga/src/read_xml_arch_file.cpp @@ -317,7 +317,7 @@ void XmlReadArch(const char* ArchFile, pugi::xml_node Next; ReqOpt POWER_REQD, SWITCHBLOCKLIST_REQD; - if ((vtr::check_file_name_extension(ArchFile, ".xml") == false) && (vtr::check_file_name_extension(ArchFile, ".xml") == false)) { + if ((vtr::check_file_name_extension(ArchFile, ".xml") == false) && (vtr::check_file_name_extension(ArchFile, ".xmle") == false)) { VTR_LOG_WARN( "Architecture file '%s' may be in incorrect format. " "Expecting .xml or .xmle format for architecture files.\n", diff --git a/libs/libpugiutil/src/pugixml_util.cpp b/libs/libpugiutil/src/pugixml_util.cpp index 8002ce620ff..68badf0e3f3 100644 --- a/libs/libpugiutil/src/pugixml_util.cpp +++ b/libs/libpugiutil/src/pugixml_util.cpp @@ -9,9 +9,12 @@ namespace pugiutil { loc_data load_xml(pugi::xml_document& doc, //Document object to be loaded with file contents const std::string filename) { //Filename to load from //store the position of last '.' in the file name - int position = filename.find_last_of("."); - //store the characters after the '.' from the file_name string - std::string result = filename.substr(position); + size_t position = filename.find_last_of("."); + std::string result = ""; + if(position != std::string::npos) { + //store the characters after the '.' from the file_name string + result = filename.substr(position); + } if (result == ".xmle") { Decryption E1(filename); std::string fn_file = E1.getDecryptedContent(); From 5d2977df2f7adb82fe04c5a08aedc0f7f61e2098 Mon Sep 17 00:00:00 2001 From: coolbreeze413 Date: Thu, 12 Oct 2023 11:59:35 +0530 Subject: [PATCH 2/3] Fix clang-14 formatting complaints --- libs/libpugiutil/src/pugixml_util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/libpugiutil/src/pugixml_util.cpp b/libs/libpugiutil/src/pugixml_util.cpp index 68badf0e3f3..b1597d34963 100644 --- a/libs/libpugiutil/src/pugixml_util.cpp +++ b/libs/libpugiutil/src/pugixml_util.cpp @@ -11,7 +11,7 @@ loc_data load_xml(pugi::xml_document& doc, //Document object to be loaded w //store the position of last '.' in the file name size_t position = filename.find_last_of("."); std::string result = ""; - if(position != std::string::npos) { + if (position != std::string::npos) { //store the characters after the '.' from the file_name string result = filename.substr(position); } From 86ecab70b4d38019b96ea79c797a24f670488c35 Mon Sep 17 00:00:00 2001 From: coolbreeze413 Date: Thu, 12 Oct 2023 12:00:16 +0530 Subject: [PATCH 3/3] Fix missing separator in .github/scripts/hostsetup.sh --- .github/scripts/hostsetup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/hostsetup.sh b/.github/scripts/hostsetup.sh index b274953f791..835c3e95c81 100755 --- a/.github/scripts/hostsetup.sh +++ b/.github/scripts/hostsetup.sh @@ -71,7 +71,7 @@ apt install -y \ gcc-9 \ wget \ openssl \ - libssl-dev + libssl-dev \ libtbb-dev # installing the latest version of cmake