mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2024-12-23 04:15:31 +00:00
Fixed int overflow problem
This commit is contained in:
parent
be3b09f704
commit
5ff1caf38c
2
peglib.h
2
peglib.h
@ -441,7 +441,7 @@ inline std::pair<size_t, size_t> line_info(const char* start, const char* cur) {
|
|||||||
/*
|
/*
|
||||||
* String tag
|
* String tag
|
||||||
*/
|
*/
|
||||||
inline constexpr unsigned int str2tag(const char* str, int h = 0) {
|
inline constexpr unsigned int str2tag(const char* str, unsigned int h = 0) {
|
||||||
return (*str == '\0') ? h : str2tag(str + 1, (h * 33) ^ static_cast<unsigned char>(*str));
|
return (*str == '\0') ? h : str2tag(str + 1, (h * 33) ^ static_cast<unsigned char>(*str));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user