Skip to content
Snippets Groups Projects
Commit c75c84fa authored by deuce's avatar deuce
Browse files

Switch to stdint.h types from magical FreeBSD (or maybe GCC?) types.

parent 205d8ecf
Branches
Tags
No related merge requests found
......@@ -90,7 +90,7 @@ xp_sem_init(xp_sem_t *sem, int pshared, unsigned int value)
goto RETURN;
}
(*sem)->count = (u_int32_t)value;
(*sem)->count = (uint32_t)value;
(*sem)->nwaiters = 0;
(*sem)->magic = XP_SEM_MAGIC;
......@@ -248,7 +248,7 @@ xp_sem_setvalue(xp_sem_t *sem, int sval)
_SEM_CHECK_VALIDITY(sem);
pthread_mutex_lock(&(*sem)->lock);
(*sem)->count=(u_int32_t)sval;
(*sem)->count=(uint32_t)sval;
if (((*sem)->nwaiters > 0) && sval) {
/*
* We must use pthread_cond_broadcast() rather than
......
......@@ -46,6 +46,7 @@
#include <sys/types.h>
#include <fcntl.h>
#include <pthread.h>
#include <inttypes.h>
/* Opaque type definition. */
struct xp_sem;
......@@ -55,7 +56,7 @@ typedef struct xp_sem *xp_sem_t;
#define XP_SEM_VALUE_MAX UINT_MAX
#if defined(__solaris__)
typedef unsigned int u_int32_t;
typedef unsigned int uint32_t;
#endif
#if defined(__cplusplus)
......@@ -88,12 +89,12 @@ int xp_sem_timedwait (xp_sem_t *sem, const struct timespec *abs_timeout);
*/
struct xp_sem {
#define XP_SEM_MAGIC ((u_int32_t) 0x09fa4012)
u_int32_t magic;
#define XP_SEM_MAGIC ((uint32_t) 0x09fa4012)
uint32_t magic;
pthread_mutex_t lock;
pthread_cond_t gtzero;
u_int32_t count;
u_int32_t nwaiters;
uint32_t count;
uint32_t nwaiters;
};
extern pthread_once_t _thread_init_once;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment