diff options
| author | Tylo <[email protected]> | 2020-06-22 18:50:17 +0200 |
|---|---|---|
| committer | Tylo <[email protected]> | 2020-06-22 18:50:17 +0200 |
| commit | 664b5a6b227b2e8814a318b4de39820236e5efea (patch) | |
| tree | bd9a8946cd892c9453e0e627766edf113cc58498 /examples | |
| parent | cae23dfe2ebf4c75efeacf0e908dc55cb113aa5b (diff) | |
| download | STC-modified-664b5a6b227b2e8814a318b4de39820236e5efea.tar.gz STC-modified-664b5a6b227b2e8814a318b4de39820236e5efea.zip | |
Restructure declare_CHash arguments (again)
Removed forced inlining. (-> regular inline)
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/README.md | 6 | ||||
| -rw-r--r-- | examples/advanced.c | 2 | ||||
| -rw-r--r-- | examples/benchmark.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/examples/README.md b/examples/README.md index c9952317..938bcb24 100644 --- a/examples/README.md +++ b/examples/README.md @@ -73,8 +73,8 @@ size_t personview_hash(const struct PersonView* pv, size_t ignore) { ```
With this in place, we can declare the map Person -> int:
```
-declare_CHash(ex, map, struct Person, int, c_emptyDestroy, personview_hash, personview_compare,
- struct PersonView, person_destroy, person_getView, person_fromView);
+declare_CHash(ex, MAP, struct Person, int, c_emptyDestroy, personview_hash, personview_compare,
+ person_destroy, struct PersonView, person_getView, person_fromView);
```
Note we use struct PersonView to put keys in the map, but keys are stored as struct Person with proper dynamically allocated CStrings to store name and surname.
```
@@ -94,5 +94,5 @@ int main() chash_ex_destroy(&m6);
}
```
-CHash map uses personview_hash() for hash value calculations, and the personview_compare() for equality checks. The chash_ex_destroy() function will free CStrings name, surname and the value for each item in the map, in addition to the CMap hash table itself.
+CHash map uses personview_hash() for hash value calculations, and the personview_compare() for equality checks. The chash_ex_destroy() function will free CStrings name, surname and the value for each item in the map, in addition to the CHash map table itself.
diff --git a/examples/advanced.c b/examples/advanced.c index 37b67531..68d5b66a 100644 --- a/examples/advanced.c +++ b/examples/advanced.c @@ -65,7 +65,7 @@ size_t personview_hash(const struct PersonView* pv, size_t ignore) { With this in place, we can declare the map Person -> int: ```*/ declare_CHash(ex, MAP, struct Person, int, c_emptyDestroy, personview_hash, personview_compare, - struct PersonView, person_destroy, person_getView, person_fromView); + person_destroy, struct PersonView, person_getView, person_fromView); /*``` Note we use struct PersonView to put keys in the map, but keys are stored as struct Person with proper dynamically allocated CStrings to store name and surname. ```*/ diff --git a/examples/benchmark.c b/examples/benchmark.c index dd070ff4..b6e31a22 100644 --- a/examples/benchmark.c +++ b/examples/benchmark.c @@ -8,8 +8,8 @@ #ifdef __cplusplus
#include <unordered_map>
-#include "../others/bytell_hash_map.hpp"
-#include "../others/robin_hood.hpp"
+#include "others/bytell_hash_map.hpp"
+#include "others/robin_hood.hpp"
#endif
// Visual Studio: compile with -TP to force C++: cl -TP -EHsc -O2 benchmark.c
|
