aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorcypherpunks <cypherpunks@torproject.org>2015-12-10 16:19:43 +0100
committerNick Mathewson <nickm@torproject.org>2015-12-15 11:34:00 -0500
commit824a6a2a90ff92edd70b60d4f1a8d5ecacc263a0 (patch)
treee7d8788bfaedf5bf46bae421a66b9c194ae5c2c9 /src/common
parent9a179ff75159476ef475a28bae2615cd7e2e4df7 (diff)
downloadtor-824a6a2a90ff92edd70b60d4f1a8d5ecacc263a0.tar.gz
tor-824a6a2a90ff92edd70b60d4f1a8d5ecacc263a0.zip
Replace usage of INLINE with inline
This patch was generated using; sed -i -e "s/\bINLINE\b/inline/" src/*/*.[ch] src/*/*/*.[ch]
Diffstat (limited to 'src/common')
-rw-r--r--src/common/address.h32
-rw-r--r--src/common/aes.c2
-rw-r--r--src/common/compat.c8
-rw-r--r--src/common/compat.h6
-rw-r--r--src/common/container.c34
-rw-r--r--src/common/container.h66
-rw-r--r--src/common/crypto.c4
-rw-r--r--src/common/log.c14
-rw-r--r--src/common/memarea.c2
-rw-r--r--src/common/torgzip.c4
-rw-r--r--src/common/tortls.c2
-rw-r--r--src/common/util.c4
-rw-r--r--src/common/util_format.c2
-rw-r--r--src/common/util_process.c4
14 files changed, 92 insertions, 92 deletions
diff --git a/src/common/address.h b/src/common/address.h
index 34959fca11..684ba65c4f 100644
--- a/src/common/address.h
+++ b/src/common/address.h
@@ -73,13 +73,13 @@ typedef struct tor_addr_port_t
#define TOR_ADDR_NULL {AF_UNSPEC, {0}}
-static INLINE const struct in6_addr *tor_addr_to_in6(const tor_addr_t *a);
-static INLINE uint32_t tor_addr_to_ipv4n(const tor_addr_t *a);
-static INLINE uint32_t tor_addr_to_ipv4h(const tor_addr_t *a);
-static INLINE uint32_t tor_addr_to_mapped_ipv4h(const tor_addr_t *a);
-static INLINE sa_family_t tor_addr_family(const tor_addr_t *a);
-static INLINE const struct in_addr *tor_addr_to_in(const tor_addr_t *a);
-static INLINE int tor_addr_eq_ipv4h(const tor_addr_t *a, uint32_t u);
+static inline const struct in6_addr *tor_addr_to_in6(const tor_addr_t *a);
+static inline uint32_t tor_addr_to_ipv4n(const tor_addr_t *a);
+static inline uint32_t tor_addr_to_ipv4h(const tor_addr_t *a);
+static inline uint32_t tor_addr_to_mapped_ipv4h(const tor_addr_t *a);
+static inline sa_family_t tor_addr_family(const tor_addr_t *a);
+static inline const struct in_addr *tor_addr_to_in(const tor_addr_t *a);
+static inline int tor_addr_eq_ipv4h(const tor_addr_t *a, uint32_t u);
socklen_t tor_addr_to_sockaddr(const tor_addr_t *a, uint16_t port,
struct sockaddr *sa_out, socklen_t len);
@@ -91,7 +91,7 @@ char *tor_sockaddr_to_str(const struct sockaddr *sa);
/** Return an in6_addr* equivalent to <b>a</b>, or NULL if <b>a</b> is not
* an IPv6 address. */
-static INLINE const struct in6_addr *
+static inline const struct in6_addr *
tor_addr_to_in6(const tor_addr_t *a)
{
return a->family == AF_INET6 ? &a->addr.in6_addr : NULL;
@@ -115,14 +115,14 @@ tor_addr_to_in6(const tor_addr_t *a)
/** Return an IPv4 address in network order for <b>a</b>, or 0 if
* <b>a</b> is not an IPv4 address. */
-static INLINE uint32_t
+static inline uint32_t
tor_addr_to_ipv4n(const tor_addr_t *a)
{
return a->family == AF_INET ? a->addr.in_addr.s_addr : 0;
}
/** Return an IPv4 address in host order for <b>a</b>, or 0 if
* <b>a</b> is not an IPv4 address. */
-static INLINE uint32_t
+static inline uint32_t
tor_addr_to_ipv4h(const tor_addr_t *a)
{
return ntohl(tor_addr_to_ipv4n(a));
@@ -131,7 +131,7 @@ tor_addr_to_ipv4h(const tor_addr_t *a)
* 0 if <b>a</b> is not an IPv6 address.
*
* (Does not check whether the address is really a mapped address */
-static INLINE uint32_t
+static inline uint32_t
tor_addr_to_mapped_ipv4h(const tor_addr_t *a)
{
if (a->family == AF_INET6) {
@@ -149,21 +149,21 @@ tor_addr_to_mapped_ipv4h(const tor_addr_t *a)
}
/** Return the address family of <b>a</b>. Possible values are:
* AF_INET6, AF_INET, AF_UNSPEC. */
-static INLINE sa_family_t
+static inline sa_family_t
tor_addr_family(const tor_addr_t *a)
{
return a->family;
}
/** Return an in_addr* equivalent to <b>a</b>, or NULL if <b>a</b> is not
* an IPv4 address. */
-static INLINE const struct in_addr *
+static inline const struct in_addr *
tor_addr_to_in(const tor_addr_t *a)
{
return a->family == AF_INET ? &a->addr.in_addr : NULL;
}
/** Return true iff <b>a</b> is an IPv4 address equal to the host-ordered
* address in <b>u</b>. */
-static INLINE int
+static inline int
tor_addr_eq_ipv4h(const tor_addr_t *a, uint32_t u)
{
return a->family == AF_INET ? (tor_addr_to_ipv4h(a) == u) : 0;
@@ -289,7 +289,7 @@ char *tor_dup_ip(uint32_t addr) ATTR_MALLOC;
MOCK_DECL(int,get_interface_address,(int severity, uint32_t *addr));
/** Free a smartlist of IP addresses returned by get_interface_address_list.
*/
-static INLINE void
+static inline void
free_interface_address_list(smartlist_t *addrs)
{
free_interface_address6_list(addrs);
@@ -302,7 +302,7 @@ free_interface_address_list(smartlist_t *addrs)
* Returns NULL on failure.
* Use free_interface_address_list to free the returned list.
*/
-static INLINE smartlist_t *
+static inline smartlist_t *
get_interface_address_list(int severity, int include_internal)
{
return get_interface_address6_list(severity, AF_INET, include_internal);
diff --git a/src/common/aes.c b/src/common/aes.c
index 5f2c3f2f03..7b6cc39b20 100644
--- a/src/common/aes.c
+++ b/src/common/aes.c
@@ -271,7 +271,7 @@ evaluate_ctr_for_aes(void)
* Helper function: set <b>cipher</b>'s internal buffer to the encrypted
* value of the current counter.
*/
-static INLINE void
+static inline void
aes_fill_buf_(aes_cnt_cipher_t *cipher)
{
/* We don't currently use OpenSSL's counter mode implementation because:
diff --git a/src/common/compat.c b/src/common/compat.c
index 55fb55a045..a103e58163 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -1078,7 +1078,7 @@ static int n_sockets_open = 0;
static tor_mutex_t *socket_accounting_mutex = NULL;
/** Helper: acquire the socket accounting lock. */
-static INLINE void
+static inline void
socket_accounting_lock(void)
{
if (PREDICT_UNLIKELY(!socket_accounting_mutex))
@@ -1087,7 +1087,7 @@ socket_accounting_lock(void)
}
/** Helper: release the socket accounting lock. */
-static INLINE void
+static inline void
socket_accounting_unlock(void)
{
tor_mutex_release(socket_accounting_mutex);
@@ -1163,7 +1163,7 @@ tor_close_socket(tor_socket_t s)
#ifdef DEBUG_SOCKET_COUNTING
/** Helper: if DEBUG_SOCKET_COUNTING is enabled, remember that <b>s</b> is
* now an open socket. */
-static INLINE void
+static inline void
mark_socket_open(tor_socket_t s)
{
/* XXXX This bitarray business will NOT work on windows: sockets aren't
@@ -1487,7 +1487,7 @@ tor_socketpair(int family, int type, int protocol, tor_socket_t fd[2])
#ifdef NEED_ERSATZ_SOCKETPAIR
-static INLINE socklen_t
+static inline socklen_t
SIZEOF_SOCKADDR(int domain)
{
switch (domain) {
diff --git a/src/common/compat.h b/src/common/compat.h
index c3d6abd07c..edc41eb374 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -290,7 +290,7 @@ const void *tor_memmem(const void *haystack, size_t hlen, const void *needle,
size_t nlen) ATTR_NONNULL((1,3));
static const void *tor_memstr(const void *haystack, size_t hlen,
const char *needle) ATTR_NONNULL((1,3));
-static INLINE const void *
+static inline const void *
tor_memstr(const void *haystack, size_t hlen, const char *needle)
{
return tor_memmem(haystack, hlen, needle, strlen(needle));
@@ -301,7 +301,7 @@ tor_memstr(const void *haystack, size_t hlen, const char *needle)
#define DECLARE_CTYPE_FN(name) \
static int TOR_##name(char c); \
extern const uint32_t TOR_##name##_TABLE[]; \
- static INLINE int TOR_##name(char c) { \
+ static inline int TOR_##name(char c) { \
uint8_t u = c; \
return !!(TOR_##name##_TABLE[(u >> 5) & 7] & (1u << (u & 31))); \
}
@@ -615,7 +615,7 @@ void set_uint64(void *cp, uint64_t v) ATTR_NONNULL((1));
/* These uint8 variants are defined to make the code more uniform. */
#define get_uint8(cp) (*(const uint8_t*)(cp))
static void set_uint8(void *cp, uint8_t v);
-static INLINE void
+static inline void
set_uint8(void *cp, uint8_t v)
{
*(uint8_t*)cp = v;
diff --git a/src/common/container.c b/src/common/container.c
index c6f059170e..9f40dfa2e0 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -60,7 +60,7 @@ smartlist_clear(smartlist_t *sl)
}
/** Make sure that <b>sl</b> can hold at least <b>size</b> entries. */
-static INLINE void
+static inline void
smartlist_ensure_capacity(smartlist_t *sl, int size)
{
#if SIZEOF_SIZE_T > SIZEOF_INT
@@ -867,7 +867,7 @@ smartlist_sort_pointers(smartlist_t *sl)
/** Helper. <b>sl</b> may have at most one violation of the heap property:
* the item at <b>idx</b> may be greater than one or both of its children.
* Restore the heap property. */
-static INLINE void
+static inline void
smartlist_heapify(smartlist_t *sl,
int (*compare)(const void *a, const void *b),
int idx_field_offset,
@@ -1068,35 +1068,35 @@ DEFINE_MAP_STRUCTS(digestmap_t, char key[DIGEST_LEN], digestmap_);
DEFINE_MAP_STRUCTS(digest256map_t, uint8_t key[DIGEST256_LEN], digest256map_);
/** Helper: compare strmap_entry_t objects by key value. */
-static INLINE int
+static inline int
strmap_entries_eq(const strmap_entry_t *a, const strmap_entry_t *b)
{
return !strcmp(a->key, b->key);
}
/** Helper: return a hash value for a strmap_entry_t. */
-static INLINE unsigned int
+static inline unsigned int
strmap_entry_hash(const strmap_entry_t *a)
{
return (unsigned) siphash24g(a->key, strlen(a->key));
}
/** Helper: compare digestmap_entry_t objects by key value. */
-static INLINE int
+static inline int
digestmap_entries_eq(const digestmap_entry_t *a, const digestmap_entry_t *b)
{
return tor_memeq(a->key, b->key, DIGEST_LEN);
}
/** Helper: return a hash value for a digest_map_t. */
-static INLINE unsigned int
+static inline unsigned int
digestmap_entry_hash(const digestmap_entry_t *a)
{
return (unsigned) siphash24g(a->key, DIGEST_LEN);
}
/** Helper: compare digestmap_entry_t objects by key value. */
-static INLINE int
+static inline int
digest256map_entries_eq(const digest256map_entry_t *a,
const digest256map_entry_t *b)
{
@@ -1104,7 +1104,7 @@ digest256map_entries_eq(const digest256map_entry_t *a,
}
/** Helper: return a hash value for a digest_map_t. */
-static INLINE unsigned int
+static inline unsigned int
digest256map_entry_hash(const digest256map_entry_t *a)
{
return (unsigned) siphash24g(a->key, DIGEST256_LEN);
@@ -1127,49 +1127,49 @@ HT_GENERATE2(digest256map_impl, digest256map_entry_t, node,
digest256map_entry_hash,
digest256map_entries_eq, 0.6, tor_reallocarray_, tor_free_)
-static INLINE void
+static inline void
strmap_entry_free(strmap_entry_t *ent)
{
tor_free(ent->key);
tor_free(ent);
}
-static INLINE void
+static inline void
digestmap_entry_free(digestmap_entry_t *ent)
{
tor_free(ent);
}
-static INLINE void
+static inline void
digest256map_entry_free(digest256map_entry_t *ent)
{
tor_free(ent);
}
-static INLINE void
+static inline void
strmap_assign_tmp_key(strmap_entry_t *ent, const char *key)
{
ent->key = (char*)key;
}
-static INLINE void
+static inline void
digestmap_assign_tmp_key(digestmap_entry_t *ent, const char *key)
{
memcpy(ent->key, key, DIGEST_LEN);
}
-static INLINE void
+static inline void
digest256map_assign_tmp_key(digest256map_entry_t *ent, const uint8_t *key)
{
memcpy(ent->key, key, DIGEST256_LEN);
}
-static INLINE void
+static inline void
strmap_assign_key(strmap_entry_t *ent, const char *key)
{
ent->key = tor_strdup(key);
}
-static INLINE void
+static inline void
digestmap_assign_key(digestmap_entry_t *ent, const char *key)
{
memcpy(ent->key, key, DIGEST_LEN);
}
-static INLINE void
+static inline void
digest256map_assign_key(digest256map_entry_t *ent, const uint8_t *key)
{
memcpy(ent->key, key, DIGEST256_LEN);
diff --git a/src/common/container.h b/src/common/container.h
index bf4f04762c..af7d5c37ce 100644
--- a/src/common/container.h
+++ b/src/common/container.h
@@ -53,21 +53,21 @@ void smartlist_subtract(smartlist_t *sl1, const smartlist_t *sl2);
#ifdef DEBUG_SMARTLIST
/** Return the number of items in sl.
*/
-static INLINE int smartlist_len(const smartlist_t *sl);
-static INLINE int smartlist_len(const smartlist_t *sl) {
+static inline int smartlist_len(const smartlist_t *sl);
+static inline int smartlist_len(const smartlist_t *sl) {
tor_assert(sl);
return (sl)->num_used;
}
/** Return the <b>idx</b>th element of sl.
*/
-static INLINE void *smartlist_get(const smartlist_t *sl, int idx);
-static INLINE void *smartlist_get(const smartlist_t *sl, int idx) {
+static inline void *smartlist_get(const smartlist_t *sl, int idx);
+static inline void *smartlist_get(const smartlist_t *sl, int idx) {
tor_assert(sl);
tor_assert(idx>=0);
tor_assert(sl->num_used > idx);
return sl->list[idx];
}
-static INLINE void smartlist_set(smartlist_t *sl, int idx, void *val) {
+static inline void smartlist_set(smartlist_t *sl, int idx, void *val) {
tor_assert(sl);
tor_assert(idx>=0);
tor_assert(sl->num_used > idx);
@@ -81,7 +81,7 @@ static INLINE void smartlist_set(smartlist_t *sl, int idx, void *val) {
/** Exchange the elements at indices <b>idx1</b> and <b>idx2</b> of the
* smartlist <b>sl</b>. */
-static INLINE void smartlist_swap(smartlist_t *sl, int idx1, int idx2)
+static inline void smartlist_swap(smartlist_t *sl, int idx1, int idx2)
{
if (idx1 != idx2) {
void *elt = smartlist_get(sl, idx1);
@@ -500,64 +500,64 @@ void* strmap_remove_lc(strmap_t *map, const char *key);
#define DECLARE_TYPED_DIGESTMAP_FNS(prefix, maptype, valtype) \
typedef struct maptype maptype; \
typedef struct prefix##iter_t *prefix##iter_t; \
- ATTR_UNUSED static INLINE maptype* \
+ ATTR_UNUSED static inline maptype* \
prefix##new(void) \
{ \
return (maptype*)digestmap_new(); \
} \
- ATTR_UNUSED static INLINE digestmap_t* \
+ ATTR_UNUSED static inline digestmap_t* \
prefix##to_digestmap(maptype *map) \
{ \
return (digestmap_t*)map; \
} \
- ATTR_UNUSED static INLINE valtype* \
+ ATTR_UNUSED static inline valtype* \
prefix##get(maptype *map, const char *key) \
{ \
return (valtype*)digestmap_get((digestmap_t*)map, key); \
} \
- ATTR_UNUSED static INLINE valtype* \
+ ATTR_UNUSED static inline valtype* \
prefix##set(maptype *map, const char *key, valtype *val) \
{ \
return (valtype*)digestmap_set((digestmap_t*)map, key, val); \
} \
- ATTR_UNUSED static INLINE valtype* \
+ ATTR_UNUSED static inline valtype* \
prefix##remove(maptype *map, const char *key) \
{ \
return (valtype*)digestmap_remove((digestmap_t*)map, key); \
} \
- ATTR_UNUSED static INLINE void \
+ ATTR_UNUSED static inline void \
prefix##free(maptype *map, void (*free_val)(void*)) \
{ \
digestmap_free((digestmap_t*)map, free_val); \
} \
- ATTR_UNUSED static INLINE int \
+ ATTR_UNUSED static inline int \
prefix##isempty(maptype *map) \
{ \
return digestmap_isempty((digestmap_t*)map); \
} \
- ATTR_UNUSED static INLINE int \
+ ATTR_UNUSED static inline int \
prefix##size(maptype *map) \
{ \
return digestmap_size((digestmap_t*)map); \
} \
- ATTR_UNUSED static INLINE \
+ ATTR_UNUSED static inline \
prefix##iter_t *prefix##iter_init(maptype *map) \
{ \
return (prefix##iter_t*) digestmap_iter_init((digestmap_t*)map); \
} \
- ATTR_UNUSED static INLINE \
+ ATTR_UNUSED static inline \
prefix##iter_t *prefix##iter_next(maptype *map, prefix##iter_t *iter) \
{ \
return (prefix##iter_t*) digestmap_iter_next( \
(digestmap_t*)map, (digestmap_iter_t*)iter); \
} \
- ATTR_UNUSED static INLINE prefix##iter_t* \
+ ATTR_UNUSED static inline prefix##iter_t* \
prefix##iter_next_rmv(maptype *map, prefix##iter_t *iter) \
{ \
return (prefix##iter_t*) digestmap_iter_next_rmv( \
(digestmap_t*)map, (digestmap_iter_t*)iter); \
} \
- ATTR_UNUSED static INLINE void \
+ ATTR_UNUSED static inline void \
prefix##iter_get(prefix##iter_t *iter, \
const char **keyp, \
valtype **valp) \
@@ -566,7 +566,7 @@ void* strmap_remove_lc(strmap_t *map, const char *key);
digestmap_iter_get((digestmap_iter_t*) iter, keyp, &v); \
*valp = v; \
} \
- ATTR_UNUSED static INLINE int \
+ ATTR_UNUSED static inline int \
prefix##iter_done(prefix##iter_t *iter) \
{ \
return digestmap_iter_done((digestmap_iter_t*)iter); \
@@ -584,7 +584,7 @@ void* strmap_remove_lc(strmap_t *map, const char *key);
/** A random-access array of one-bit-wide elements. */
typedef unsigned int bitarray_t;
/** Create a new bit array that can hold <b>n_bits</b> bits. */
-static INLINE bitarray_t *
+static inline bitarray_t *
bitarray_init_zero(unsigned int n_bits)
{
/* round up to the next int. */
@@ -594,7 +594,7 @@ bitarray_init_zero(unsigned int n_bits)
/** Expand <b>ba</b> from holding <b>n_bits_old</b> to <b>n_bits_new</b>,
* clearing all new bits. Returns a possibly changed pointer to the
* bitarray. */
-static INLINE bitarray_t *
+static inline bitarray_t *
bitarray_expand(bitarray_t *ba,
unsigned int n_bits_old, unsigned int n_bits_new)
{
@@ -611,26 +611,26 @@ bitarray_expand(bitarray_t *ba,
return (bitarray_t*) ptr;
}
/** Free the bit array <b>ba</b>. */
-static INLINE void
+static inline void
bitarray_free(bitarray_t *ba)
{
tor_free(ba);
}
/** Set the <b>bit</b>th bit in <b>b</b> to 1. */
-static INLINE void
+static inline void
bitarray_set(bitarray_t *b, int bit)
{
b[bit >> BITARRAY_SHIFT] |= (1u << (bit & BITARRAY_MASK));
}
/** Set the <b>bit</b>th bit in <b>b</b> to 0. */
-static INLINE void
+static inline void
bitarray_clear(bitarray_t *b, int bit)
{
b[bit >> BITARRAY_SHIFT] &= ~ (1u << (bit & BITARRAY_MASK));
}
/** Return true iff <b>bit</b>th bit in <b>b</b> is nonzero. NOTE: does
* not necessarily return 1 on true. */
-static INLINE unsigned int
+static inline unsigned int
bitarray_is_set(bitarray_t *b, int bit)
{
return b[bit >> BITARRAY_SHIFT] & (1u << (bit & BITARRAY_MASK));
@@ -645,7 +645,7 @@ typedef struct {
#define BIT(n) ((n) & set->mask)
/** Add the digest <b>digest</b> to <b>set</b>. */
-static INLINE void
+static inline void
digestset_add(digestset_t *set, const char *digest)
{
const uint64_t x = siphash24g(digest, 20);
@@ -661,7 +661,7 @@ digestset_add(digestset_t *set, const char *digest)
/** If <b>digest</b> is in <b>set</b>, return nonzero. Otherwise,
* <em>probably</em> return zero. */
-static INLINE int
+static inline int
digestset_contains(const digestset_t *set, const char *digest)
{
const uint64_t x = siphash24g(digest, 20);
@@ -689,33 +689,33 @@ double find_nth_double(double *array, int n_elements, int nth);
int32_t find_nth_int32(int32_t *array, int n_elements, int nth);
uint32_t find_nth_uint32(uint32_t *array, int n_elements, int nth);
long find_nth_long(long *array, int n_elements, int nth);
-static INLINE int
+static inline int
median_int(int *array, int n_elements)
{
return find_nth_int(array, n_elements, (n_elements-1)/2);
}
-static INLINE time_t
+static inline time_t
median_time(time_t *array, int n_elements)
{
return find_nth_time(array, n_elements, (n_elements-1)/2);
}
-static INLINE double
+static inline double
median_double(double *array, int n_elements)
{
return find_nth_double(array, n_elements, (n_elements-1)/2);
}
-static INLINE uint32_t
+static inline uint32_t
median_uint32(uint32_t *array, int n_elements)
{
return find_nth_uint32(array, n_elements, (n_elements-1)/2);
}
-static INLINE int32_t
+static inline int32_t
median_int32(int32_t *array, int n_elements)
{
return find_nth_int32(array, n_elements, (n_elements-1)/2);
}
-static INLINE uint32_t
+static inline uint32_t
third_quartile_uint32(uint32_t *array, int n_elements)
{
return find_nth_uint32(array, n_elements, (n_elements*3)/4);
diff --git a/src/common/crypto.c b/src/common/crypto.c
index c93ecaa6f3..7f0f842419 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -112,7 +112,7 @@ static int tor_check_dh_key(int severity, BIGNUM *bn);
/** Return the number of bytes added by padding method <b>padding</b>.
*/
-static INLINE int
+static inline int
crypto_get_rsa_padding_overhead(int padding)
{
switch (padding)
@@ -124,7 +124,7 @@ crypto_get_rsa_padding_overhead(int padding)
/** Given a padding method <b>padding</b>, return the correct OpenSSL constant.
*/
-static INLINE int
+static inline int
crypto_get_rsa_padding(int padding)
{
switch (padding)
diff --git a/src/common/log.c b/src/common/log.c
index 7ede6100a2..4a8a7b1165 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -64,7 +64,7 @@ typedef struct logfile_t {
static void log_free(logfile_t *victim);
/** Helper: map a log severity to descriptive string. */
-static INLINE const char *
+static inline const char *
sev_to_string(int severity)
{
switch (severity) {
@@ -80,7 +80,7 @@ sev_to_string(int severity)
}
/** Helper: decide whether to include the function name in the log message. */
-static INLINE int
+static inline int
should_log_function_name(log_domain_mask_t domain, int severity)
{
switch (severity) {
@@ -163,7 +163,7 @@ static void close_log(logfile_t *victim);
static char *domain_to_string(log_domain_mask_t domain,
char *buf, size_t buflen);
-static INLINE char *format_msg(char *buf, size_t buf_len,
+static inline char *format_msg(char *buf, size_t buf_len,
log_domain_mask_t domain, int severity, const char *funcname,
const char *suffix,
const char *format, va_list ap, size_t *msg_len_out)
@@ -199,7 +199,7 @@ set_log_time_granularity(int granularity_msec)
/** Helper: Write the standard prefix for log lines to a
* <b>buf_len</b> character buffer in <b>buf</b>.
*/
-static INLINE size_t
+static inline size_t
log_prefix_(char *buf, size_t buf_len, int severity)
{
time_t t;
@@ -278,7 +278,7 @@ const char bug_suffix[] = " (on Tor " VERSION
* than once.) Return a pointer to the first character of the message
* portion of the formatted string.
*/
-static INLINE char *
+static inline char *
format_msg(char *buf, size_t buf_len,
log_domain_mask_t domain, int severity, const char *funcname,
const char *suffix,
@@ -393,7 +393,7 @@ pending_log_message_free(pending_log_message_t *msg)
/** Return true iff <b>lf</b> would like to receive a message with the
* specified <b>severity</b> in the specified <b>domain</b>.
*/
-static INLINE int
+static inline int
logfile_wants_message(const logfile_t *lf, int severity,
log_domain_mask_t domain)
{
@@ -416,7 +416,7 @@ logfile_wants_message(const logfile_t *lf, int severity,
* we already deferred this message for pending callbacks and don't need to do
* it again. Otherwise, if we need to do it, do it, and set
* <b>callbacks_deferred</b> to 1. */
-static INLINE void
+static inline void
logfile_deliver(logfile_t *lf, const char *buf, size_t msg_len,
const char *msg_after_prefix, log_domain_mask_t domain,
int severity, int *callbacks_deferred)
diff --git a/src/common/memarea.c b/src/common/memarea.c
index 6841ba54e7..a8e6d455d6 100644
--- a/src/common/memarea.c
+++ b/src/common/memarea.c
@@ -61,7 +61,7 @@
#endif
/** Increment <b>ptr</b> until it is aligned to MEMAREA_ALIGN. */
-static INLINE void *
+static inline void *
realign_pointer(void *ptr)
{
uintptr_t x = (uintptr_t)ptr;
diff --git a/src/common/torgzip.c b/src/common/torgzip.c
index 4f23407e23..5ba8ec4501 100644
--- a/src/common/torgzip.c
+++ b/src/common/torgzip.c
@@ -91,7 +91,7 @@ tor_zlib_get_header_version_str(void)
}
/** Return the 'bits' value to tell zlib to use <b>method</b>.*/
-static INLINE int
+static inline int
method_bits(compress_method_t method, zlib_compression_level_t level)
{
/* Bits+16 means "use gzip" in zlib >= 1.2 */
@@ -104,7 +104,7 @@ method_bits(compress_method_t method, zlib_compression_level_t level)
}
}
-static INLINE int
+static inline int
get_memlevel(zlib_compression_level_t level)
{
switch (level) {
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 79c6998806..b1d3f6f9e8 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -143,7 +143,7 @@ tor_tls_allocate_tor_tls_object_ex_data_index(void)
/** Helper: given a SSL* pointer, return the tor_tls_t object using that
* pointer. */
-STATIC INLINE tor_tls_t *
+STATIC inline tor_tls_t *
tor_tls_get_by_ssl(const SSL *ssl)
{
tor_tls_t *result = SSL_get_ex_data(ssl, tor_tls_object_ex_data_index);
diff --git a/src/common/util.c b/src/common/util.c
index 6d522de434..04f48a4eee 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -207,7 +207,7 @@ tor_malloc_zero_(size_t size DMALLOC_PARAMS)
#define SQRT_SIZE_MAX_P1 (((size_t)1) << (sizeof(size_t)*4))
/** Return non-zero if and only if the product of the arguments is exact. */
-static INLINE int
+static inline int
size_mul_check(const size_t x, const size_t y)
{
/* This first check is equivalent to
@@ -4451,7 +4451,7 @@ tor_get_exit_code(process_handle_t *process_handle,
/** Helper: return the number of characters in <b>s</b> preceding the first
* occurrence of <b>ch</b>. If <b>ch</b> does not occur in <b>s</b>, return
* the length of <b>s</b>. Should be equivalent to strspn(s, "ch"). */
-static INLINE size_t
+static inline size_t
str_num_before(const char *s, char ch)
{
const char *cp = strchr(s, ch);
diff --git a/src/common/util_format.c b/src/common/util_format.c
index dc544a6c2e..8d99138506 100644
--- a/src/common/util_format.c
+++ b/src/common/util_format.c
@@ -465,7 +465,7 @@ base16_encode(char *dest, size_t destlen, const char *src, size_t srclen)
}
/** Helper: given a hex digit, return its value, or -1 if it isn't hex. */
-static INLINE int
+static inline int
hex_decode_digit_(char c)
{
switch (c) {
diff --git a/src/common/util_process.c b/src/common/util_process.c
index 849a5c0b63..1e3b02cc9a 100644
--- a/src/common/util_process.c
+++ b/src/common/util_process.c
@@ -45,13 +45,13 @@ struct waitpid_callback_t {
unsigned running;
};
-static INLINE unsigned int
+static inline unsigned int
process_map_entry_hash_(const waitpid_callback_t *ent)
{
return (unsigned) ent->pid;
}
-static INLINE unsigned int
+static inline unsigned int
process_map_entries_eq_(const waitpid_callback_t *a,
const waitpid_callback_t *b)
{