diff --git a/src/native/corehost/fxr/framework_info.cpp b/src/native/corehost/fxr/framework_info.cpp index 4e19a036643b08..2a680992a05bb9 100644 --- a/src/native/corehost/fxr/framework_info.cpp +++ b/src/native/corehost/fxr/framework_info.cpp @@ -83,7 +83,7 @@ bool compare_by_name_and_version(const framework_info &a, const framework_info & { // Make sure we filter out any non-version folders. fx_ver_t parsed; - if (!fx_ver_t::parse(ver, &parsed, false)) + if (!fx_ver_t::parse(ver, &parsed)) continue; // Check that the framework's .deps.json exists. diff --git a/src/native/corehost/fxr/fx_resolver.cpp b/src/native/corehost/fxr/fx_resolver.cpp index bdd3e17833e578..0cc68ba7130d25 100644 --- a/src/native/corehost/fxr/fx_resolver.cpp +++ b/src/native/corehost/fxr/fx_resolver.cpp @@ -196,7 +196,7 @@ namespace assert(!fx_ref.get_fx_version().empty()); fx_ver_t _debug_ver; - assert(fx_ver_t::parse(fx_ref.get_fx_version(), &_debug_ver, false)); + assert(fx_ver_t::parse(fx_ref.get_fx_version(), &_debug_ver)); assert(_debug_ver == fx_ref.get_fx_version_number()); #endif // defined(DEBUG) @@ -257,7 +257,7 @@ namespace for (const auto& version : list) { fx_ver_t ver; - if (fx_ver_t::parse(version, &ver, false)) + if (fx_ver_t::parse(version, &ver)) { if (std::find(disabled_versions.begin(), disabled_versions.end(), version) != disabled_versions.end()) { diff --git a/src/native/corehost/fxr/fx_ver.cpp b/src/native/corehost/fxr/fx_ver.cpp index 5cf320769786e7..dc855d7a83422f 100644 --- a/src/native/corehost/fxr/fx_ver.cpp +++ b/src/native/corehost/fxr/fx_ver.cpp @@ -112,10 +112,10 @@ int fx_ver_t::compare(const fx_ver_t& a, const fx_ver_t& b) } /* static */ -bool fx_ver_t::parse(const pal::string_t& ver, fx_ver_t* fx_ver, bool parse_only_production) +bool fx_ver_t::parse(const pal::string_t& ver, fx_ver_t* fx_ver) { c_fx_ver_t c_ver; - if (!c_fx_ver_parse(ver.c_str(), &c_ver, parse_only_production)) + if (!c_fx_ver_parse(ver.c_str(), &c_ver)) { c_fx_ver_cleanup(&c_ver); return false; diff --git a/src/native/corehost/fxr/sdk_info.cpp b/src/native/corehost/fxr/sdk_info.cpp index 69e51c0e21204b..18ba09a00ee3e8 100644 --- a/src/native/corehost/fxr/sdk_info.cpp +++ b/src/native/corehost/fxr/sdk_info.cpp @@ -52,7 +52,7 @@ void sdk_info::enumerate_sdk_paths( { // Make sure we filter out any non-version folders. fx_ver_t version; - if (!fx_ver_t::parse(version_str, &version, false)) + if (!fx_ver_t::parse(version_str, &version)) { trace::verbose(_X("Ignoring invalid version [%s]"), version_str.c_str()); continue; diff --git a/src/native/corehost/fxr/sdk_resolver.cpp b/src/native/corehost/fxr/sdk_resolver.cpp index d1bab0d4a5bb2f..39a93d4272cfaa 100644 --- a/src/native/corehost/fxr/sdk_resolver.cpp +++ b/src/native/corehost/fxr/sdk_resolver.cpp @@ -374,7 +374,7 @@ sdk_resolver::global_file_info sdk_resolver::parse_global_file(const pal::string return ret; } - if (!fx_ver_t::parse(version_value->value.GetString(), &requested_version, false)) + if (!fx_ver_t::parse(version_value->value.GetString(), &requested_version)) { ret.error_message = utils::format_string(_X("Version '%s' is not valid for the 'sdk/version' value"), version_value->value.GetString()); return ret; diff --git a/src/native/corehost/fxr_resolver.c b/src/native/corehost/fxr_resolver.c index de907b3e4932f6..224495977e92e3 100644 --- a/src/native/corehost/fxr_resolver.c +++ b/src/native/corehost/fxr_resolver.c @@ -25,7 +25,7 @@ static bool find_max_version_callback(const pal_char_t* entry_name, void* ctx_in c_fx_ver_t ver; c_fx_ver_init(&ver); - if (!c_fx_ver_parse(entry_name, &ver, /*parse_only_production*/ false)) + if (!c_fx_ver_parse(entry_name, &ver)) { c_fx_ver_cleanup(&ver); return true; diff --git a/src/native/corehost/hostmisc/fx_ver.c b/src/native/corehost/hostmisc/fx_ver.c index 2cfc4cec4127d6..9605f78f806698 100644 --- a/src/native/corehost/hostmisc/fx_ver.c +++ b/src/native/corehost/hostmisc/fx_ver.c @@ -160,7 +160,7 @@ static bool validate_dot_separated_identifiers(const pal_char_t* ids, size_t len return true; } -static bool parse_internal(const pal_char_t* ver_str, c_fx_ver_t* out_ver, bool parse_only_production) +static bool parse_internal(const pal_char_t* ver_str, c_fx_ver_t* out_ver) { if (ver_str[0] == _X('\0')) return false; @@ -198,9 +198,6 @@ static bool parse_internal(const pal_char_t* ver_str, c_fx_ver_t* out_ver, bool return true; } - if (parse_only_production) - return false; - if (!try_parse_version_number(pat_start, pat_non_numeric, &patch_val)) return false; @@ -245,10 +242,10 @@ static bool parse_internal(const pal_char_t* ver_str, c_fx_ver_t* out_ver, bool return true; } -bool c_fx_ver_parse(const pal_char_t* ver_str, c_fx_ver_t* out_ver, bool parse_only_production) +bool c_fx_ver_parse(const pal_char_t* ver_str, c_fx_ver_t* out_ver) { c_fx_ver_init(out_ver); - return parse_internal(ver_str, out_ver, parse_only_production); + return parse_internal(ver_str, out_ver); } // Length of the dot-delimited identifier starting at position id_start. diff --git a/src/native/corehost/hostmisc/fx_ver.h b/src/native/corehost/hostmisc/fx_ver.h index 9d742c8d016d7b..9cbafc8c30f328 100644 --- a/src/native/corehost/hostmisc/fx_ver.h +++ b/src/native/corehost/hostmisc/fx_ver.h @@ -41,7 +41,7 @@ bool c_fx_ver_is_empty(const c_fx_ver_t* ver); // Parse a version string. On success out_ver is populated and the caller is // responsible for calling c_fx_ver_cleanup on it. Returns false on failure; // out_ver is left in a freshly initialized state (no allocations) in that case. -bool c_fx_ver_parse(const pal_char_t* ver_str, c_fx_ver_t* out_ver, bool parse_only_production); +bool c_fx_ver_parse(const pal_char_t* ver_str, c_fx_ver_t* out_ver); // Compare two versions. Returns <0, 0, >0 (semver semantics). int c_fx_ver_compare(const c_fx_ver_t* a, const c_fx_ver_t* b); @@ -87,7 +87,7 @@ struct fx_ver_t bool operator <=(const fx_ver_t& b) const; bool operator >=(const fx_ver_t& b) const; - static bool parse(const pal::string_t& ver, fx_ver_t* fx_ver, bool parse_only_production = false); + static bool parse(const pal::string_t& ver, fx_ver_t* fx_ver); private: int m_major;