From fa2e9ec311b99dee2fbff5ee5fa2c743298dacad Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 1 Jun 2004 08:12:45 +0000 Subject: r960: convert 'unsigned int' to uint_t in the most places metze (This used to be commit 18062d2ed9fc9224c43143c10efbf2f6f1f5bbe0) --- source4/lib/bitmap.c | 2 +- source4/lib/crypto/md5.c | 2 +- source4/lib/messages.c | 12 +++++----- source4/lib/pidfile.c | 2 +- .../lib/registry/reg_backend_nt4/reg_backend_nt4.c | 28 +++++++++++----------- .../lib/registry/reg_backend_w95/reg_backend_w95.c | 2 +- source4/lib/system.c | 2 +- source4/lib/tdb/common/spinlock.c | 22 ++++++++--------- source4/lib/tdb/common/tdbutil.c | 8 +++---- source4/lib/tdb/include/spinlock.h | 4 ++-- source4/lib/util.c | 2 +- source4/lib/util_str.c | 2 +- 12 files changed, 44 insertions(+), 44 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/bitmap.c b/source4/lib/bitmap.c index 63b093617b..2e67fb5439 100644 --- a/source4/lib/bitmap.c +++ b/source4/lib/bitmap.c @@ -129,7 +129,7 @@ wraparound ****************************************************************************/ int bitmap_find(struct bitmap *bm, unsigned ofs) { - unsigned int i, j; + uint_t i, j; if (ofs > bm->n) ofs = 0; diff --git a/source4/lib/crypto/md5.c b/source4/lib/crypto/md5.c index a393fc2532..1c53a0a152 100644 --- a/source4/lib/crypto/md5.c +++ b/source4/lib/crypto/md5.c @@ -107,7 +107,7 @@ void MD5Update(struct MD5Context *ctx, uint8_t const *buf, unsigned len) */ void MD5Final(uint8_t digest[16], struct MD5Context *ctx) { - unsigned int count; + uint_t count; uint8_t *p; /* Compute number of bytes mod 64 */ diff --git a/source4/lib/messages.c b/source4/lib/messages.c index 9357b12f1f..b4de7c0145 100644 --- a/source4/lib/messages.c +++ b/source4/lib/messages.c @@ -86,7 +86,7 @@ static void sig_usr1(void) static void ping_message(int msg_type, pid_t src, void *buf, size_t len) { const char *msg = buf ? buf : "none"; - DEBUG(1,("INFO: Received PING message from PID %u [%s]\n",(unsigned int)src, msg)); + DEBUG(1,("INFO: Received PING message from PID %u [%s]\n",(uint_t)src, msg)); message_send_pid(src, MSG_PONG, buf, len, True); } @@ -169,7 +169,7 @@ static BOOL message_notify(pid_t pid) ****************************************************************************/ static BOOL message_send_pid_internal(pid_t pid, int msg_type, const void *buf, size_t len, - BOOL duplicates_allowed, unsigned int timeout) + BOOL duplicates_allowed, uint_t timeout) { TDB_DATA kbuf; TDB_DATA dbuf; @@ -301,7 +301,7 @@ BOOL message_send_pid(pid_t pid, int msg_type, const void *buf, size_t len, BOOL ****************************************************************************/ BOOL message_send_pid_with_timeout(pid_t pid, int msg_type, const void *buf, size_t len, - BOOL duplicates_allowed, unsigned int timeout) + BOOL duplicates_allowed, uint_t timeout) { return message_send_pid_internal(pid, msg_type, buf, len, duplicates_allowed, timeout); } @@ -409,7 +409,7 @@ void message_dispatch(void) for (buf = msgs_buf; message_recv(msgs_buf, total_len, &msg_type, &src, &buf, &len); buf += len) { DEBUG(10,("message_dispatch: received msg_type=%d src_pid=%u\n", - msg_type, (unsigned int) src)); + msg_type, (uint_t) src)); n_handled = 0; for (dfn = dispatch_fns; dfn; dfn = dfn->next) { if (dfn->msg_type == msg_type) { @@ -421,7 +421,7 @@ void message_dispatch(void) if (!n_handled) { DEBUG(5,("message_dispatch: warning: no handlers registed for " "msg_type %d in pid %u\n", - msg_type, (unsigned int)getpid())); + msg_type, (uint_t)getpid())); } } SAFE_FREE(msgs_buf); @@ -514,7 +514,7 @@ static int traverse_fn(TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_DATA dbuf, void if (errno == ESRCH) { DEBUG(2,("pid %u doesn't exist - deleting connections %d [%s]\n", - (unsigned int)crec.pid, crec.cnum, crec.name)); + (uint_t)crec.pid, crec.cnum, crec.name)); tdb_delete(the_tdb, kbuf); } } diff --git a/source4/lib/pidfile.c b/source4/lib/pidfile.c index 3471f27b8e..7126482256 100644 --- a/source4/lib/pidfile.c +++ b/source4/lib/pidfile.c @@ -99,7 +99,7 @@ void pidfile_create(const char *name) } memset(buf, 0, sizeof(buf)); - slprintf(buf, sizeof(buf) - 1, "%u\n", (unsigned int) getpid()); + slprintf(buf, sizeof(buf) - 1, "%u\n", (uint_t) getpid()); if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) { DEBUG(0,("ERROR: can't write to file %s: %s\n", pidFile, strerror(errno))); diff --git a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c index fa4b3e4d18..36feaff907 100644 --- a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c +++ b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c @@ -338,7 +338,7 @@ const char *def_owner_sid_str = NULL; #define BLK_SIZE(b) ((int)*(int *)(((int *)b)-1)) -typedef unsigned int DWORD; +typedef uint_t DWORD; typedef unsigned short WORD; typedef struct sk_struct SK_HDR; @@ -358,7 +358,7 @@ typedef struct regf_block { DWORD uk5; /* 0 */ DWORD uk6; /* 1 */ DWORD first_key; /* offset */ - unsigned int dblk_size; + uint_t dblk_size; DWORD uk7[116]; /* 1 */ DWORD chksum; } REGF_HDR; @@ -462,9 +462,9 @@ typedef struct hbin_blk_s { int type, size; struct hbin_blk_s *next; char *data; /* The data block */ - unsigned int file_offset; /* Offset in file */ - unsigned int free_space; /* Amount of free space in block */ - unsigned int fsp_off; /* Start of free space in block */ + uint_t file_offset; /* Offset in file */ + uint_t free_space; /* Amount of free space in block */ + uint_t fsp_off; /* Start of free space in block */ int complete, stored; } HBIN_BLK; @@ -1023,7 +1023,7 @@ static WERROR nk_to_key(REG_HANDLE *h, NK_HDR *nk_hdr, int size, REG_KEY *parent REGF *regf = h->backend_data; REG_KEY *tmp = NULL, *own; int namlen, clsname_len, sk_off, own_off; - unsigned int nk_id; + uint_t nk_id; SK_HDR *sk_hdr; int type; char key_name[1024], cls_name[1024]; @@ -1104,7 +1104,7 @@ static WERROR nk_to_key(REG_HANDLE *h, NK_HDR *nk_hdr, int size, REG_KEY *parent DEBUG(2, ("Owner Offset: %0X\n", own_off)); DEBUGADD(2, (" Owner locn: %0X, Our locn: %0X\n", - (unsigned int)own, (unsigned int)nk_hdr)); + (uint_t)own, (uint_t)nk_hdr)); /* * We should verify that the owner field is correct ... @@ -1185,7 +1185,7 @@ static HBIN_BLK *nt_create_hbin_blk(REG_HANDLE *h, int size) * Allocate a unit of space ... and return a pointer as function param * and the block's offset as a side effect */ -static void *nt_alloc_regf_space(REG_HANDLE *h, int size, unsigned int *off) +static void *nt_alloc_regf_space(REG_HANDLE *h, int size, uint_t *off) { REGF *regf = h->backend_data; int tmp = 0; @@ -1357,10 +1357,10 @@ static int nt_store_acl(REG_HANDLE *regf, SEC_ACL *acl, uint8_t *locn) { * that first, then the owner, then the group SID. So, we do it that way * too. */ -static unsigned int nt_store_sec_desc(REG_HANDLE *regf, SEC_DESC *sd, char *locn) +static uint_t nt_store_sec_desc(REG_HANDLE *regf, SEC_DESC *sd, char *locn) { SEC_DESC *rsd = (SEC_DESC *)locn; - unsigned int size = 0, off = 0; + uint_t size = 0, off = 0; if (!regf || !sd || !locn) return 0; @@ -1424,10 +1424,10 @@ static unsigned int nt_store_sec_desc(REG_HANDLE *regf, SEC_DESC *sd, char *locn * If it has already been stored, just get its offset from record * otherwise, store it and record its offset */ -static unsigned int nt_store_security(REG_HANDLE *regf, KEY_SEC_DESC *sec) +static uint_t nt_store_security(REG_HANDLE *regf, KEY_SEC_DESC *sec) { int size = 0; - unsigned int sk_off; + uint_t sk_off; SK_HDR *sk_hdr; if (sec->offset) return sec->offset; @@ -1483,7 +1483,7 @@ static unsigned int nt_store_security(REG_HANDLE *regf, KEY_SEC_DESC *sec) static int nt_store_reg_key(REG_HANDLE *regf, REG_KEY *key) { NK_HDR *nk_hdr; - unsigned int nk_off, sk_off, size; + uint_t nk_off, sk_off, size; if (!regf || !key) return 0; @@ -1581,7 +1581,7 @@ static WERROR nt_open_registry (REG_HANDLE *h, const char *location, const char { REGF *regf; REGF_HDR *regf_hdr; - unsigned int regf_id, hbin_id; + uint_t regf_id, hbin_id; HBIN_HDR *hbin_hdr; regf = (REGF *)talloc_p(h->mem_ctx, REGF); diff --git a/source4/lib/registry/reg_backend_w95/reg_backend_w95.c b/source4/lib/registry/reg_backend_w95/reg_backend_w95.c index b014f4da66..f392759b8d 100644 --- a/source4/lib/registry/reg_backend_w95/reg_backend_w95.c +++ b/source4/lib/registry/reg_backend_w95/reg_backend_w95.c @@ -40,7 +40,7 @@ * the keys and the RGDB contains the actual data. */ -typedef unsigned int DWORD; +typedef uint_t DWORD; typedef unsigned short WORD; typedef struct creg_block { diff --git a/source4/lib/system.c b/source4/lib/system.c index 2641a180ef..8d307caea3 100644 --- a/source4/lib/system.c +++ b/source4/lib/system.c @@ -507,7 +507,7 @@ long sys_random(void) Wrapper for srandom(). ****************************************************************************/ -void sys_srandom(unsigned int seed) +void sys_srandom(uint_t seed) { #if defined(HAVE_SRANDOM) srandom(seed); diff --git a/source4/lib/tdb/common/spinlock.c b/source4/lib/tdb/common/spinlock.c index 1b789d4daa..0c8991c1e0 100644 --- a/source4/lib/tdb/common/spinlock.c +++ b/source4/lib/tdb/common/spinlock.c @@ -55,7 +55,7 @@ static inline int __spin_trylock(spinlock_t *lock) { - unsigned int result; + uint_t result; asm volatile("ldstub [%1], %0" : "=r" (result) @@ -85,7 +85,7 @@ static inline int __spin_is_locked(spinlock_t *lock) static inline int __spin_trylock(spinlock_t *lock) { - unsigned int result; + uint_t result; __asm__ __volatile__( "1: lwarx %0,0,%1\n\ @@ -167,7 +167,7 @@ static inline int __spin_is_locked(spinlock_t *lock) /* Returns 0 if the lock is acquired, EBUSY otherwise. */ static inline int __spin_trylock(spinlock_t *lock) { - unsigned int val; + uint_t val; val = __lock_test_and_set(lock, 1); return val == 0 ? 0 : EBUSY; } @@ -185,16 +185,16 @@ static inline void __spin_lock_init(spinlock_t *lock) /* Returns 1 if the lock is held, 0 otherwise. */ static inline int __spin_is_locked(spinlock_t *lock) { - unsigned int val; + uint_t val; val = __add_and_fetch(lock, 0); return val; } #elif defined(MIPS_SPINLOCKS) -static inline unsigned int load_linked(unsigned long addr) +static inline uint_t load_linked(unsigned long addr) { - unsigned int res; + uint_t res; __asm__ __volatile__("ll\t%0,(%1)" : "=r" (res) @@ -203,9 +203,9 @@ static inline unsigned int load_linked(unsigned long addr) return res; } -static inline unsigned int store_conditional(unsigned long addr, unsigned int value) +static inline uint_t store_conditional(unsigned long addr, uint_t value) { - unsigned int res; + uint_t res; __asm__ __volatile__("sc\t%0,(%2)" : "=r" (res) @@ -215,7 +215,7 @@ static inline unsigned int store_conditional(unsigned long addr, unsigned int va static inline int __spin_trylock(spinlock_t *lock) { - unsigned int mw; + uint_t mw; do { mw = load_linked(lock); @@ -418,7 +418,7 @@ int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type) return 0; } -int tdb_create_rwlocks(int fd, unsigned int hash_size) +int tdb_create_rwlocks(int fd, uint_t hash_size) { unsigned size, i; tdb_rwlock_t *rwlocks; @@ -460,7 +460,7 @@ int tdb_clear_spinlocks(TDB_CONTEXT *tdb) return 0; } #else -int tdb_create_rwlocks(int fd, unsigned int hash_size) { return 0; } +int tdb_create_rwlocks(int fd, uint_t hash_size) { return 0; } int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type) { return -1; } int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type) { return -1; } diff --git a/source4/lib/tdb/common/tdbutil.c b/source4/lib/tdb/common/tdbutil.c index 05f4713c82..6b9ad414c5 100644 --- a/source4/lib/tdb/common/tdbutil.c +++ b/source4/lib/tdb/common/tdbutil.c @@ -91,7 +91,7 @@ static TDB_DATA make_tdb_data(const char *dptr, size_t dsize) Lock a chain with timeout (in seconds). ****************************************************************************/ -static int tdb_chainlock_with_timeout_internal(TDB_CONTEXT *tdb, TDB_DATA key, unsigned int timeout, int rw_type) +static int tdb_chainlock_with_timeout_internal(TDB_CONTEXT *tdb, TDB_DATA key, uint_t timeout, int rw_type) { /* Allow tdb_chainlock to be interrupted by an alarm. */ int ret; @@ -129,7 +129,7 @@ static int tdb_chainlock_with_timeout_internal(TDB_CONTEXT *tdb, TDB_DATA key, u Write lock a chain. Return -1 if timeout or lock failed. ****************************************************************************/ -int tdb_chainlock_with_timeout(TDB_CONTEXT *tdb, TDB_DATA key, unsigned int timeout) +int tdb_chainlock_with_timeout(TDB_CONTEXT *tdb, TDB_DATA key, uint_t timeout) { return tdb_chainlock_with_timeout_internal(tdb, key, timeout, F_WRLCK); } @@ -138,7 +138,7 @@ int tdb_chainlock_with_timeout(TDB_CONTEXT *tdb, TDB_DATA key, unsigned int time Lock a chain by string. Return -1 if timeout or lock failed. ****************************************************************************/ -int tdb_lock_bystring(TDB_CONTEXT *tdb, const char *keyval, unsigned int timeout) +int tdb_lock_bystring(TDB_CONTEXT *tdb, const char *keyval, uint_t timeout) { TDB_DATA key = make_tdb_data(keyval, strlen(keyval)+1); @@ -160,7 +160,7 @@ void tdb_unlock_bystring(TDB_CONTEXT *tdb, const char *keyval) Read lock a chain by string. Return -1 if timeout or lock failed. ****************************************************************************/ -int tdb_read_lock_bystring(TDB_CONTEXT *tdb, const char *keyval, unsigned int timeout) +int tdb_read_lock_bystring(TDB_CONTEXT *tdb, const char *keyval, uint_t timeout) { TDB_DATA key = make_tdb_data(keyval, strlen(keyval)+1); diff --git a/source4/lib/tdb/include/spinlock.h b/source4/lib/tdb/include/spinlock.h index 967fe37457..1255d455de 100644 --- a/source4/lib/tdb/include/spinlock.h +++ b/source4/lib/tdb/include/spinlock.h @@ -36,7 +36,7 @@ typedef struct { int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type); int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type); -int tdb_create_rwlocks(int fd, unsigned int hash_size); +int tdb_create_rwlocks(int fd, uint_t hash_size); int tdb_clear_spinlocks(TDB_CONTEXT *tdb); #define TDB_SPINLOCK_SIZE(hash_size) (((hash_size) + 1) * sizeof(tdb_rwlock_t)) @@ -49,7 +49,7 @@ int tdb_clear_spinlocks(TDB_CONTEXT *tdb); #else int tdb_spinlock(TDB_CONTEXT *tdb, int list, int rw_type); int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type); -int tdb_create_rwlocks(int fd, unsigned int hash_size); +int tdb_create_rwlocks(int fd, uint_t hash_size); #endif int tdb_clear_spinlocks(TDB_CONTEXT *tdb); #define TDB_SPINLOCK_SIZE(hash_size) 0 diff --git a/source4/lib/util.c b/source4/lib/util.c index dd53d2b174..2fc87241de 100644 --- a/source4/lib/util.c +++ b/source4/lib/util.c @@ -189,7 +189,7 @@ int set_blocking(int fd, BOOL set) Sleep for a specified number of milliseconds. ********************************************************************/ -void msleep(unsigned int t) +void msleep(uint_t t) { struct timeval tval; diff --git a/source4/lib/util_str.c b/source4/lib/util_str.c index 0113b1ae48..7b1a81bdfd 100644 --- a/source4/lib/util_str.c +++ b/source4/lib/util_str.c @@ -402,7 +402,7 @@ char *safe_strcpy(char *dest,const char *src, size_t maxlength) if (len > maxlength) { DEBUG(0,("ERROR: string overflow by %u (%u - %u) in safe_strcpy [%.50s]\n", - (unsigned int)(len-maxlength), len, maxlength, src)); + (uint_t)(len-maxlength), len, maxlength, src)); len = maxlength; } -- cgit