diff options
| author | Tyge Løvset <[email protected]> | 2022-11-21 17:59:06 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-11-21 17:59:06 +0100 |
| commit | dcaf91987cfacd6a6ed66532e5a2a4200c46651b (patch) | |
| tree | 009953e3aeb97708a3dc8ddae6072ac411a81637 /include/stc/csview.h | |
| parent | a084d28b651b988b244b1c6be1d4714e6a4b15c9 (diff) | |
| download | STC-modified-dcaf91987cfacd6a6ed66532e5a2a4200c46651b.tar.gz STC-modified-dcaf91987cfacd6a6ed66532e5a2a4200c46651b.zip | |
Updated shootout_hashmap.cpp, and fixed some unsigned warnings.
Diffstat (limited to 'include/stc/csview.h')
| -rw-r--r-- | include/stc/csview.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/stc/csview.h b/include/stc/csview.h index b94e93b4..cccf21ea 100644 --- a/include/stc/csview.h +++ b/include/stc/csview.h @@ -164,7 +164,7 @@ STC_API uint64_t csview_hash(const csview *self); STC_DEF size_t csview_find_sv(csview sv, csview search) { char* res = cstrnstrn(sv.str, search.str, sv.size, search.size); - return res ? res - sv.str : csview_npos; + return res ? (size_t)(res - sv.str) : csview_npos; } STC_DEF uint64_t csview_hash(const csview *self) @@ -196,7 +196,7 @@ STC_DEF csview csview_token(csview sv, const char* sep, size_t* start) { size_t sep_size = strlen(sep); csview slice = {sv.str + *start, sv.size - *start}; const char* res = cstrnstrn(slice.str, sep, slice.size, sep_size); - csview tok = {slice.str, res ? res - slice.str : slice.size}; + csview tok = {slice.str, res ? (size_t)(res - slice.str) : slice.size}; *start += tok.size + sep_size; return tok; } |
