Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(855)

Unified Diff: src/string-search.h

Issue 3521002: Add cast to make Win-64 compile without warnings. (Closed)
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string-search.h
diff --git a/src/string-search.h b/src/string-search.h
index 1de375018b1d0c9cdd69d2dabceaf077d259f1a7..4412e32ed3d735c61818fa4bcd901f11e94fff0c 100644
--- a/src/string-search.h
+++ b/src/string-search.h
@@ -334,8 +334,9 @@ int StringSearch<PatternChar, SubjectChar>::BoyerMooreSearch(
} else if (j < start) {
// we have matched more than our tables allow us to be smart about.
// Fall back on BMH shift.
- index +=
- pattern_length - 1 - CharOccurrence(bad_char_occurence, last_char);
+ index += pattern_length - 1
+ - CharOccurrence(bad_char_occurence,
+ static_cast<SubjectChar>(last_char));
} else {
int gs_shift = good_suffix_shift[j + 1];
int bc_occ =
@@ -432,7 +433,7 @@ int StringSearch<PatternChar, SubjectChar>::BoyerMooreHorspoolSearch(
// How bad we are doing without a good-suffix table.
PatternChar last_char = pattern[pattern_length - 1];
int last_char_shift = pattern_length - 1 -
- CharOccurrence(char_occurrences, last_char);
+ CharOccurrence(char_occurrences, static_cast<SubjectChar>(last_char));
// Perform search
int index = start_index; // No matches found prior to this index.
while (index <= subject_length - pattern_length) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698