diff options
| author | Tyge Lovset <[email protected]> | 2023-02-01 08:38:45 +0100 |
|---|---|---|
| committer | Tyge Lovset <[email protected]> | 2023-02-01 08:38:45 +0100 |
| commit | 6ce6ef3307e52db5813d3c8d6a2cba52df06daf8 (patch) | |
| tree | 25af4be9fcd5e72778715b83ff312e157ca63b59 /docs/cmap_api.md | |
| parent | b677a0c3950b8294ba6458e682a885351273ac08 (diff) | |
| download | STC-modified-6ce6ef3307e52db5813d3c8d6a2cba52df06daf8.tar.gz STC-modified-6ce6ef3307e52db5813d3c8d6a2cba52df06daf8.zip | |
Massive update from unsigned sizes and indices to signed.
Diffstat (limited to 'docs/cmap_api.md')
| -rw-r--r-- | docs/cmap_api.md | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/docs/cmap_api.md b/docs/cmap_api.md index 3848e67e..7b8fbb8f 100644 --- a/docs/cmap_api.md +++ b/docs/cmap_api.md @@ -48,20 +48,20 @@ See the c++ class [std::unordered_map](https://en.cppreference.com/w/cpp/contain ```c cmap_X cmap_X_init(void); -cmap_X cmap_X_with_capacity(size_t cap); +cmap_X cmap_X_with_capacity(intptr_t cap); cmap_X cmap_X_clone(cmap_x map); void cmap_X_clear(cmap_X* self); void cmap_X_copy(cmap_X* self, const cmap_X* other); -float cmap_X_max_load_factor(const cmap_X* self); // default: 0.85f -bool cmap_X_reserve(cmap_X* self, size_t size); +float cmap_X_max_load_factor(const cmap_X* self); // default: 0.85f +bool cmap_X_reserve(cmap_X* self, intptr_t size); void cmap_X_shrink_to_fit(cmap_X* self); void cmap_X_drop(cmap_X* self); // destructor -size_t cmap_X_size(const cmap_X* self); -size_t cmap_X_capacity(const cmap_X* self); // buckets * max_load_factor +intptr_t cmap_X_size(const cmap_X* self); +intptr_t cmap_X_capacity(const cmap_X* self); // buckets * max_load_factor bool cmap_X_empty(const cmap_X* self ); -size_t cmap_X_bucket_count(const cmap_X* self); // num. of allocated buckets +intptr_t cmap_X_bucket_count(const cmap_X* self); // num. of allocated buckets const cmap_X_mapped* cmap_X_at(const cmap_X* self, i_keyraw rkey); // rkey must be in map cmap_X_mapped* cmap_X_at_mut(cmap_X* self, i_keyraw rkey); // mutable at @@ -77,7 +77,7 @@ cmap_X_result cmap_X_push(cmap_X* self, cmap_X_value entry); cmap_X_result cmap_X_emplace(cmap_X* self, i_keyraw rkey, i_valraw rmapped); // no change if rkey in map cmap_X_result cmap_X_emplace_or_assign(cmap_X* self, i_keyraw rkey, i_valraw rmapped); // always update rmapped -size_t cmap_X_erase(cmap_X* self, i_keyraw rkey); // return 0 or 1 +intptr_t cmap_X_erase(cmap_X* self, i_keyraw rkey); // return 0 or 1 cmap_X_iter cmap_X_erase_at(cmap_X* self, cmap_X_iter it); // return iter after it void cmap_X_erase_entry(cmap_X* self, cmap_X_value* entry); @@ -93,7 +93,7 @@ Helpers: ```c uint64_t c_default_hash(const X *obj); // macro, calls cfasthash(obj, sizeof *obj) uint64_t cstrhash(const char *str); // string hash funcion, uses strlen() -uint64_t cfasthash(const void *data, size_t len); // base hash function +uint64_t cfasthash(const void *data, intptr_t len); // base hash function // equalto template parameter functions: bool c_default_eq(const i_keyraw* a, const i_keyraw* b); // *a == *b |
