Skip to content

Commit e62945d

Browse files
committed
fixes name scope warnings
1 parent a497be8 commit e62945d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

libmamba/include/mamba/util/parsers.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -343,21 +343,21 @@ namespace mamba::util
343343
{
344344
// TODO(C++20): After allocating tokens and depths here, call an impl function using
345345
// std::span defined in .cpp
346-
static constexpr auto npos = std::string_view::npos;
346+
static constexpr auto sv_npos = std::string_view::npos;
347347

348348
const auto tokens = detail_parsers::concat_array<char>(open, close);
349349
const auto tokens_str = std::string_view(tokens.data(), tokens.size());
350350

351351
auto depths = std::array<int, P + 1>{}; // Plus one for branchless depths code
352352

353353
const auto start = searcher.find_first(text, tokens_str);
354-
if (start == npos)
354+
if (start == sv_npos)
355355
{
356-
return { npos, npos };
356+
return { sv_npos, sv_npos };
357357
}
358358

359359
auto pos = start;
360-
while (pos != npos)
360+
while (pos != sv_npos)
361361
{
362362
// Change depth of corresponding open/close pair, writing in index P for
363363
// the one not matching.
@@ -390,7 +390,7 @@ namespace mamba::util
390390
}
391391

392392
err = ParseError::InvalidInput;
393-
return { start, npos };
393+
return { start, sv_npos };
394394
}
395395

396396
template <std::size_t P, typename Str, typename Searcher>
@@ -405,12 +405,12 @@ namespace mamba::util
405405
{
406406
// TODO(C++20): After allocating tokens and depths here, call an impl function using
407407
// std::span defined in .cpp
408-
static constexpr auto npos = std::string_view::npos;
408+
static constexpr auto sv_npos = std::string_view::npos;
409409

410410
if (detail_parsers::empty(val))
411411
{
412412
err = ParseError::InvalidInput;
413-
return npos;
413+
return sv_npos;
414414
}
415415

416416
const auto tokens = detail_parsers::concat_array<char>(
@@ -421,9 +421,9 @@ namespace mamba::util
421421
const auto tokens_str = std::string_view(tokens.data(), tokens.size());
422422

423423
auto depths = std::array<int, P + 1>{}; // last for easy branchless access
424-
auto first_val_pos = npos;
424+
auto first_val_pos = sv_npos;
425425
auto pos = searcher.find_first(text, tokens_str);
426-
while (pos != npos)
426+
while (pos != sv_npos)
427427
{
428428
const auto open_pos = detail_parsers::find(open, text[pos]);
429429
const auto close_pos = detail_parsers::find(close, text[pos]);
@@ -441,7 +441,7 @@ namespace mamba::util
441441
err = if_else(d < 0, ParseError::InvalidInput, err);
442442
}
443443
const bool match = starts_with(text.substr(pos), val);
444-
first_val_pos = if_else(match && (pos == npos), pos, first_val_pos);
444+
first_val_pos = if_else(match && (pos == sv_npos), pos, first_val_pos);
445445
if (match && (depths == decltype(depths){}))
446446
{
447447
return pos;
@@ -454,7 +454,7 @@ namespace mamba::util
454454
err = ParseError::InvalidInput;
455455
return first_val_pos;
456456
}
457-
return npos; // not found
457+
return sv_npos; // not found
458458
}
459459
}
460460

0 commit comments

Comments
 (0)