diff options
author | Makarand Dharmapurikar <makarandd@google.com> | 2017-05-30 14:03:01 -0700 |
---|---|---|
committer | Makarand Dharmapurikar <makarandd@google.com> | 2017-05-30 14:03:01 -0700 |
commit | 93fdf611a571450964ad4512ff2ed33d7c39c47c (patch) | |
tree | 3cffd3ac775c001b11006d0608bac9f568306dce /src | |
parent | 4ff23545807802f177b2e90c4c4517d8c2cb224e (diff) |
s/inline/__inline/. Visual studio incompatiblity.
MS Visual studio '13 and before don't understand inline
and throw Error C2054.
Reference: https://msdn.microsoft.com/en-us/library/bw1hbe6y.aspx
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ext/census/intrusive_hash_map.c | 10 | ||||
-rw-r--r-- | src/core/ext/census/intrusive_hash_map.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/core/ext/census/intrusive_hash_map.c b/src/core/ext/census/intrusive_hash_map.c index 77512a3aac..d147f23364 100644 --- a/src/core/ext/census/intrusive_hash_map.c +++ b/src/core/ext/census/intrusive_hash_map.c @@ -37,7 +37,7 @@ extern bool hm_index_compare(const hm_index *A, const hm_index *B); /* Simple hashing function that takes lower 32 bits. */ -static inline uint32_t chunked_vector_hasher(uint64_t key) { +static __inline uint32_t chunked_vector_hasher(uint64_t key) { return (uint32_t)key; } @@ -45,7 +45,7 @@ static inline uint32_t chunked_vector_hasher(uint64_t key) { static const size_t VECTOR_CHUNK_SIZE = (1 << 20) / sizeof(void *); /* Helper functions which return buckets from the chunked vector. */ -static inline void **get_mutable_bucket(const chunked_vector *buckets, +static __inline void **get_mutable_bucket(const chunked_vector *buckets, uint32_t index) { if (index < VECTOR_CHUNK_SIZE) { return &buckets->first_[index]; @@ -54,7 +54,7 @@ static inline void **get_mutable_bucket(const chunked_vector *buckets, return &buckets->rest_[rest_index][index % VECTOR_CHUNK_SIZE]; } -static inline void *get_bucket(const chunked_vector *buckets, uint32_t index) { +static __inline void *get_bucket(const chunked_vector *buckets, uint32_t index) { if (index < VECTOR_CHUNK_SIZE) { return buckets->first_[index]; } @@ -63,7 +63,7 @@ static inline void *get_bucket(const chunked_vector *buckets, uint32_t index) { } /* Helper function. */ -static inline size_t RestSize(const chunked_vector *vec) { +static __inline size_t RestSize(const chunked_vector *vec) { return (vec->size_ <= VECTOR_CHUNK_SIZE) ? 0 : (vec->size_ - VECTOR_CHUNK_SIZE - 1) / VECTOR_CHUNK_SIZE + 1; @@ -222,7 +222,7 @@ hm_item *intrusive_hash_map_erase(intrusive_hash_map *hash_map, uint64_t key) { * array_size-1. Returns true if it is a new hm_item and false if the hm_item * already existed. */ -static inline bool intrusive_hash_map_internal_insert(chunked_vector *buckets, +static __inline bool intrusive_hash_map_internal_insert(chunked_vector *buckets, uint32_t hash_mask, hm_item *item) { const uint64_t key = item->key; diff --git a/src/core/ext/census/intrusive_hash_map.h b/src/core/ext/census/intrusive_hash_map.h index a8405517b8..e316bf4b16 100644 --- a/src/core/ext/census/intrusive_hash_map.h +++ b/src/core/ext/census/intrusive_hash_map.h @@ -101,7 +101,7 @@ typedef struct hm_index { /* Returns true if two hm_indices point to the same object within the hash map * and false otherwise. */ -inline bool hm_index_compare(const hm_index *A, const hm_index *B) { +__inline bool hm_index_compare(const hm_index *A, const hm_index *B) { return (A->item == B->item && A->bucket_index == B->bucket_index); } |