mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-24 07:02:30 +01:00
Unified usage of the 'inline' attribute for functions
Autoconf provides the necessary stuff to detect if inline keyword is supported, and to detect special syntaxes, so let's use this and remove the multiple local definitions, this makes code simpler.
This commit is contained in:
committed by
Carlos R. Mafra
parent
7f6699ffca
commit
90d24a1648
@@ -1,3 +1,4 @@
|
||||
#include <config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
@@ -8,11 +9,6 @@
|
||||
|
||||
#define INITIAL_CAPACITY 23
|
||||
|
||||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
||||
# define INLINE inline
|
||||
#else
|
||||
# define INLINE
|
||||
#endif
|
||||
|
||||
typedef struct HashItem {
|
||||
const void *key;
|
||||
@@ -39,7 +35,7 @@ typedef struct W_HashTable {
|
||||
#define RELKEY(table, key) if ((table)->callbacks.releaseKey) \
|
||||
(*(table)->callbacks.releaseKey)(key)
|
||||
|
||||
static INLINE unsigned hashString(const char *key)
|
||||
static inline unsigned hashString(const char *key)
|
||||
{
|
||||
unsigned ret = 0;
|
||||
unsigned ctr = 0;
|
||||
@@ -52,7 +48,7 @@ static INLINE unsigned hashString(const char *key)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static INLINE unsigned hashPtr(const void *key)
|
||||
static inline unsigned hashPtr(const void *key)
|
||||
{
|
||||
return ((size_t) key / sizeof(char *));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user