mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 06:51:54 +00:00
Remove GLIB macros for int <=> pointer conversion (#572)
The synthesizer is using stdint types for a long time, perhaps for consistency, it would be worth to get rid of the GLIB macros for integer to pointer conversion and viceversa, and use just a type cast for that purpose.
This commit is contained in:
parent
aafc59bde6
commit
6895731df2
1 changed files with 15 additions and 4 deletions
|
@ -124,6 +124,8 @@ typedef gint32 int32_t;
|
|||
typedef guint32 uint32_t;
|
||||
typedef gint64 int64_t;
|
||||
typedef guint64 uint64_t;
|
||||
typedef guintptr uintptr_t;
|
||||
typedef gintptr intptr_t;
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -167,10 +169,14 @@ typedef guint64 uint64_t;
|
|||
|
||||
|
||||
#define FLUID_INLINE inline
|
||||
#define FLUID_POINTER_TO_UINT GPOINTER_TO_UINT
|
||||
#define FLUID_UINT_TO_POINTER GUINT_TO_POINTER
|
||||
#define FLUID_POINTER_TO_INT GPOINTER_TO_INT
|
||||
#define FLUID_INT_TO_POINTER GINT_TO_POINTER
|
||||
|
||||
/* Integer<->pointer conversion */
|
||||
#define FLUID_POINTER_TO_UINT(x) ((unsigned int)(uintptr_t)(x))
|
||||
#define FLUID_UINT_TO_POINTER(x) ((void *)(uintptr_t)(x))
|
||||
#define FLUID_POINTER_TO_INT(x) ((signed int)(intptr_t)(x))
|
||||
#define FLUID_INT_TO_POINTER(x) ((void *)(intptr_t)(x))
|
||||
|
||||
/* Endian detection */
|
||||
#define FLUID_IS_BIG_ENDIAN (G_BYTE_ORDER == G_BIG_ENDIAN)
|
||||
|
||||
#define FLUID_LE32TOH(x) GINT32_FROM_LE(x)
|
||||
|
@ -197,6 +203,11 @@ char *fluid_strtok(char **str, char *delim);
|
|||
typedef int socklen_t;
|
||||
#endif
|
||||
|
||||
/**
|
||||
Time functions
|
||||
|
||||
*/
|
||||
|
||||
unsigned int fluid_curtime(void);
|
||||
double fluid_utime(void);
|
||||
|
||||
|
|
Loading…
Reference in a new issue