Skip to content

Commit 380d57e

Browse files
committed
fix warnings
1 parent 8618f04 commit 380d57e

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

include/ada/url_pattern-inl.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ inline std::string_view constructor_string_parser::make_component_string() {
313313
const auto end_index = token.index;
314314
// Return the code point substring from component start input index to end
315315
// index within parser’s input.
316-
return input.substr(component_start_input_index, end_index);
316+
return std::string_view(input).substr(component_start_input_index, end_index);
317317
}
318318

319319
inline bool constructor_string_parser::is_an_identity_terminator() {
@@ -360,9 +360,9 @@ inline void Tokenizer::get_next_code_point() {
360360
next_index++;
361361
}
362362

363-
inline void Tokenizer::seek_and_get_next_code_point(size_t index) {
363+
inline void Tokenizer::seek_and_get_next_code_point(size_t new_index) {
364364
// Set tokenizer’s next index to index.
365-
next_index = index;
365+
next_index = new_index;
366366
// Run get the next code point given tokenizer.
367367
get_next_code_point();
368368
}
@@ -405,13 +405,13 @@ Tokenizer::process_tokenizing_error(size_t next_position,
405405
}
406406

407407
// @see https://urlpattern.spec.whatwg.org/#is-a-valid-name-code-point
408-
inline bool Tokenizer::is_valid_name_code_point(char code_point, bool first) {
408+
inline bool Tokenizer::is_valid_name_code_point(char cp, bool first) {
409409
// If first is true return the result of checking if code point is contained
410410
// in the IdentifierStart set of code points. Otherwise return the result of
411411
// checking if code point is contained in the IdentifierPart set of code
412412
// points.
413413
// TODO: Implement this
414-
(void)code_point;
414+
(void)cp;
415415
(void)first;
416416
return true;
417417
}

include/ada/url_pattern.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ struct url_pattern_part {
148148
struct url_pattern_compile_component_options {
149149
url_pattern_compile_component_options() = default;
150150
explicit url_pattern_compile_component_options(
151-
std::optional<char> delimiter = std::nullopt,
152-
std::optional<char> prefix = std::nullopt)
153-
: delimiter(delimiter), prefix(prefix){};
151+
std::optional<char> new_delimiter = std::nullopt,
152+
std::optional<char> new_prefix = std::nullopt)
153+
: delimiter(new_delimiter), prefix(new_prefix){};
154154

155155
// @see https://urlpattern.spec.whatwg.org/#options-delimiter-code-point
156156
std::optional<char> delimiter{};
@@ -338,7 +338,7 @@ struct Token {
338338

339339
// @see https://urlpattern.spec.whatwg.org/#tokenizer
340340
class Tokenizer {
341-
public:
341+
public:
342342
explicit Tokenizer(std::string_view input, token_policy policy)
343343
: input(input), policy(policy) {}
344344

0 commit comments

Comments
 (0)