Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/native/corehost/fxr/framework_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/native/corehost/fxr/fx_resolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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())
{
Expand Down
4 changes: 2 additions & 2 deletions src/native/corehost/fxr/fx_ver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/native/corehost/fxr/sdk_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/native/corehost/fxr/sdk_resolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/native/corehost/fxr_resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 3 additions & 6 deletions src/native/corehost/hostmisc/fx_ver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/native/corehost/hostmisc/fx_ver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
Loading