From ab395f8756622fc285414c4200194be6029d28ab Mon Sep 17 00:00:00 2001 From: Xorg Date: Thu, 15 Sep 2022 22:15:48 +0200 Subject: [PATCH] Do not inline util functions It creates warning with GCC. --- libcpuid/libcpuid_util.c | 10 +++++----- libcpuid/libcpuid_util.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libcpuid/libcpuid_util.c b/libcpuid/libcpuid_util.c index 42731bd..6ae2c93 100644 --- a/libcpuid/libcpuid_util.c +++ b/libcpuid/libcpuid_util.c @@ -241,27 +241,27 @@ void debug_print_lbits(int debuglevel, uint64_t mask) /* Functions to manage cpu_affinity_mask_t type * Adapted from https://electronics.stackexchange.com/a/200070 */ -void inline init_affinity_mask(cpu_affinity_mask_t *affinity_mask) +void init_affinity_mask(cpu_affinity_mask_t *affinity_mask) { memset(affinity_mask->__bits, 0x00, __MASK_SETSIZE); } -void inline copy_affinity_mask(cpu_affinity_mask_t *dest_affinity_mask, cpu_affinity_mask_t *src_affinity_mask) +void copy_affinity_mask(cpu_affinity_mask_t *dest_affinity_mask, cpu_affinity_mask_t *src_affinity_mask) { memcpy(dest_affinity_mask->__bits, src_affinity_mask->__bits, __MASK_SETSIZE); } -void inline set_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask) +void set_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask) { affinity_mask->__bits[logical_cpu / __MASK_NCPUBITS] |= 0x1 << (logical_cpu % __MASK_NCPUBITS); } -bool inline get_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask) +bool get_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask) { return (affinity_mask->__bits[logical_cpu / __MASK_NCPUBITS] & (0x1 << (logical_cpu % __MASK_NCPUBITS))) != 0x00; } -void inline clear_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask) +void clear_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask) { affinity_mask->__bits[logical_cpu / __MASK_NCPUBITS] &= ~(0x1 << (logical_cpu % __MASK_NCPUBITS)); } diff --git a/libcpuid/libcpuid_util.h b/libcpuid/libcpuid_util.h index 28d2b53..a4a701b 100644 --- a/libcpuid/libcpuid_util.h +++ b/libcpuid/libcpuid_util.h @@ -100,16 +100,16 @@ extern int _current_verboselevel; */ /* initialize affinity_mask */ -extern inline void init_affinity_mask(cpu_affinity_mask_t *affinity_mask); +void init_affinity_mask(cpu_affinity_mask_t *affinity_mask); /* copy one affinity_mask to another one */ -extern inline void copy_affinity_mask(cpu_affinity_mask_t *dest_affinity_mask, cpu_affinity_mask_t *src_affinity_mask); +void copy_affinity_mask(cpu_affinity_mask_t *dest_affinity_mask, cpu_affinity_mask_t *src_affinity_mask); /* set bit corresponding to 'logical_cpu' to '1' */ -extern inline void set_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask); +void set_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask); /* get bit corresponding to 'logical_cpu' */ -extern inline bool get_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask); +bool get_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask); /* set bit corresponding to 'logical_cpu' to '0' */ void clear_affinity_mask_bit(logical_cpu_t logical_cpu, cpu_affinity_mask_t *affinity_mask);