forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[antlr4] Update to 4.10.1 (microsoft#25416)
* [antlr4] Update to 4.10.1 * x-add-version * update portfile.cmake * x-add-version Co-authored-by: LilyWangLL <[email protected]>
- Loading branch information
1 parent
ca0f810
commit c168ce4
Showing
7 changed files
with
82 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
diff --git a/runtime/src/misc/MurmurHash.cpp b/runtime/src/misc/MurmurHash.cpp | ||
index 73562cd..57aa3bf 100644 | ||
--- a/runtime/src/misc/MurmurHash.cpp | ||
+++ b/runtime/src/misc/MurmurHash.cpp | ||
@@ -63,23 +63,6 @@ size_t MurmurHash::update(size_t hash, size_t value) { | ||
return hash; | ||
} | ||
|
||
-size_t MurmurHash::update(size_t hash, const void *data, size_t size) { | ||
- size_t value; | ||
- const uint8_t *bytes = static_cast<const uint8_t*>(data); | ||
- while (size >= sizeof(size_t)) { | ||
- std::memcpy(&value, bytes, sizeof(size_t)); | ||
- hash = update(hash, value); | ||
- bytes += sizeof(size_t); | ||
- size -= sizeof(size_t); | ||
- } | ||
- if (size != 0) { | ||
- value = 0; | ||
- std::memcpy(&value, bytes, size); | ||
- hash = update(hash, value); | ||
- } | ||
- return hash; | ||
-} | ||
- | ||
size_t MurmurHash::finish(size_t hash, size_t entryCount) { | ||
hash ^= entryCount * 8; | ||
hash ^= hash >> 33; | ||
@@ -118,3 +101,20 @@ size_t MurmurHash::finish(size_t hash, size_t entryCount) { | ||
#else | ||
#error "Expected sizeof(size_t) to be 4 or 8." | ||
#endif | ||
+ | ||
+size_t MurmurHash::update(size_t hash, const void *data, size_t size) { | ||
+ size_t value; | ||
+ const uint8_t *bytes = static_cast<const uint8_t*>(data); | ||
+ while (size >= sizeof(size_t)) { | ||
+ std::memcpy(&value, bytes, sizeof(size_t)); | ||
+ hash = update(hash, value); | ||
+ bytes += sizeof(size_t); | ||
+ size -= sizeof(size_t); | ||
+ } | ||
+ if (size != 0) { | ||
+ value = 0; | ||
+ std::memcpy(&value, bytes, size); | ||
+ hash = update(hash, value); | ||
+ } | ||
+ return hash; | ||
+} | ||
\ No newline at end of file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters