2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Remove use of the inline keyword used as suggestion to compiler

Historically, the inline keyword was a strong suggestion to the compiler
that it should inline the function marked inline.  As compilers became
better at optimising, this functionality has receded, and using inline
as a suggestion to inline a function is obsolete.  The compiler will
happily ignore it and inline something else entirely if it finds that's
a better optimisation.

Therefore, remove all the occurences of the inline keyword with static
functions inside single compilation unit and leave the decision whether
to inline a function or not entirely on the compiler

NOTE: We keep the usage the inline keyword when the purpose is to change
the linkage behaviour.
This commit is contained in:
Ondřej Surý
2021-10-11 13:43:12 +02:00
committed by Ondřej Surý
parent 04d0b70ba2
commit 20f0936cf2
151 changed files with 1485 additions and 1488 deletions

View File

@@ -170,19 +170,19 @@ struct dns_msgblock {
ISC_LINK(dns_msgblock_t) link;
}; /* dynamically sized */
static inline dns_msgblock_t *
static dns_msgblock_t *
msgblock_allocate(isc_mem_t *, unsigned int, unsigned int);
#define msgblock_get(block, type) \
((type *)msgblock_internalget(block, sizeof(type)))
static inline void *
static void *
msgblock_internalget(dns_msgblock_t *, unsigned int);
static inline void
static void
msgblock_reset(dns_msgblock_t *);
static inline void
static void
msgblock_free(isc_mem_t *, dns_msgblock_t *, unsigned int);
static void
@@ -195,7 +195,7 @@ logfmtpacket(dns_message_t *message, const char *description,
* Allocate a new dns_msgblock_t, and return a pointer to it. If no memory
* is free, return NULL.
*/
static inline dns_msgblock_t *
static dns_msgblock_t *
msgblock_allocate(isc_mem_t *mctx, unsigned int sizeof_type,
unsigned int count) {
dns_msgblock_t *block;
@@ -217,7 +217,7 @@ msgblock_allocate(isc_mem_t *mctx, unsigned int sizeof_type,
* Return an element from the msgblock. If no more are available, return
* NULL.
*/
static inline void *
static void *
msgblock_internalget(dns_msgblock_t *block, unsigned int sizeof_type) {
void *ptr;
@@ -233,7 +233,7 @@ msgblock_internalget(dns_msgblock_t *block, unsigned int sizeof_type) {
return (ptr);
}
static inline void
static void
msgblock_reset(dns_msgblock_t *block) {
block->remaining = block->count;
}
@@ -241,7 +241,7 @@ msgblock_reset(dns_msgblock_t *block) {
/*
* Release memory associated with a message block.
*/
static inline void
static void
msgblock_free(isc_mem_t *mctx, dns_msgblock_t *block,
unsigned int sizeof_type) {
unsigned int length;
@@ -256,7 +256,7 @@ msgblock_free(isc_mem_t *mctx, dns_msgblock_t *block,
* "current" buffer. (which is always the last on the list, for our
* uses)
*/
static inline isc_result_t
static isc_result_t
newbuffer(dns_message_t *msg, unsigned int size) {
isc_buffer_t *dynbuf;
@@ -267,7 +267,7 @@ newbuffer(dns_message_t *msg, unsigned int size) {
return (ISC_R_SUCCESS);
}
static inline isc_buffer_t *
static isc_buffer_t *
currentbuffer(dns_message_t *msg) {
isc_buffer_t *dynbuf;
@@ -277,12 +277,12 @@ currentbuffer(dns_message_t *msg) {
return (dynbuf);
}
static inline void
static void
releaserdata(dns_message_t *msg, dns_rdata_t *rdata) {
ISC_LIST_PREPEND(msg->freerdata, rdata, link);
}
static inline dns_rdata_t *
static dns_rdata_t *
newrdata(dns_message_t *msg) {
dns_msgblock_t *msgblock;
dns_rdata_t *rdata;
@@ -307,12 +307,12 @@ newrdata(dns_message_t *msg) {
return (rdata);
}
static inline void
static void
releaserdatalist(dns_message_t *msg, dns_rdatalist_t *rdatalist) {
ISC_LIST_PREPEND(msg->freerdatalist, rdatalist, link);
}
static inline dns_rdatalist_t *
static dns_rdatalist_t *
newrdatalist(dns_message_t *msg) {
dns_msgblock_t *msgblock;
dns_rdatalist_t *rdatalist;
@@ -337,7 +337,7 @@ out:
return (rdatalist);
}
static inline dns_offsets_t *
static dns_offsets_t *
newoffsets(dns_message_t *msg) {
dns_msgblock_t *msgblock;
dns_offsets_t *offsets;
@@ -355,7 +355,7 @@ newoffsets(dns_message_t *msg) {
return (offsets);
}
static inline void
static void
msginitheader(dns_message_t *m) {
m->id = 0;
m->flags = 0;
@@ -364,7 +364,7 @@ msginitheader(dns_message_t *m) {
m->rdclass = 0;
}
static inline void
static void
msginitprivate(dns_message_t *m) {
unsigned int i;
@@ -386,7 +386,7 @@ msginitprivate(dns_message_t *m) {
m->buffer = NULL;
}
static inline void
static void
msginittsig(dns_message_t *m) {
m->tsigstatus = dns_rcode_noerror;
m->querytsigstatus = dns_rcode_noerror;
@@ -402,7 +402,7 @@ msginittsig(dns_message_t *m) {
* Init elements to default state. Used both when allocating a new element
* and when resetting one.
*/
static inline void
static void
msginit(dns_message_t *m) {
msginitheader(m);
msginitprivate(m);
@@ -431,7 +431,7 @@ msginit(dns_message_t *m) {
m->indent.count = 0;
}
static inline void
static void
msgresetnames(dns_message_t *msg, unsigned int first_section) {
unsigned int i;
dns_name_t *name, *next_name;
@@ -1848,7 +1848,7 @@ dns_message_renderreserve(dns_message_t *msg, unsigned int space) {
return (ISC_R_SUCCESS);
}
static inline bool
static bool
wrong_priority(dns_rdataset_t *rds, int pass, dns_rdatatype_t preferred_glue) {
int pass_needed;