diff options
author | Stefan Metzmacher <metze@samba.org> | 2004-06-01 10:12:52 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:56:23 -0500 |
commit | 770e3307ce3da928762e15a136c562df86a9c799 (patch) | |
tree | 95930ce042b039faad683515a13e1d8413871b5d | |
parent | 98d291423ff581786a369ce373c861f94c654aa0 (diff) | |
download | samba-770e3307ce3da928762e15a136c562df86a9c799.tar.gz samba-770e3307ce3da928762e15a136c562df86a9c799.tar.bz2 samba-770e3307ce3da928762e15a136c562df86a9c799.zip |
r962: convert 'unsigned' and 'unsigned int' to uint_t
metze
(This used to be commit 57151e80eb1090281401930c8fe25b20a8cf3a38)
52 files changed, 164 insertions, 166 deletions
diff --git a/source4/client/smbmnt.c b/source4/client/smbmnt.c index 5c0d7ea1b3..0d619a88fe 100644 --- a/source4/client/smbmnt.c +++ b/source4/client/smbmnt.c @@ -28,8 +28,8 @@ static uid_t mount_uid; static gid_t mount_gid; static int mount_ro; -static unsigned mount_fmask; -static unsigned mount_dmask; +static uint_t mount_fmask; +static uint_t mount_dmask; static int user_mount; static char *options; diff --git a/source4/client/smbmount.c b/source4/client/smbmount.c index 6373e556b5..fe8f213639 100644 --- a/source4/client/smbmount.c +++ b/source4/client/smbmount.c @@ -43,8 +43,8 @@ static BOOL got_pass; static uid_t mount_uid; static gid_t mount_gid; static int mount_ro; -static unsigned mount_fmask; -static unsigned mount_dmask; +static uint_t mount_fmask; +static uint_t mount_dmask; static BOOL use_kerberos; /* TODO: Add code to detect smbfs version in kernel */ static BOOL status32_smbfs = False; diff --git a/source4/include/ads.h b/source4/include/ads.h index 410395a71b..36f898b2b0 100644 --- a/source4/include/ads.h +++ b/source4/include/ads.h @@ -44,7 +44,7 @@ typedef struct { char *password; char *user_name; char *kdc_server; - unsigned flags; + uint_t flags; int time_offset; } auth; diff --git a/source4/include/byteorder.h b/source4/include/byteorder.h index b3caa310a4..bf68ee7df7 100644 --- a/source4/include/byteorder.h +++ b/source4/include/byteorder.h @@ -55,7 +55,7 @@ that don't have any int types that are 2 bytes long) You do this: #define CVAL(buf,pos) (((uint8_t *)(buf))[pos]) -#define PVAL(buf,pos) ((unsigned)CVAL(buf,pos)) +#define PVAL(buf,pos) ((uint_t)CVAL(buf,pos)) #define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8) then to extract a uint16_t value at offset 25 in a buffer you do this: @@ -105,7 +105,7 @@ it also defines lots of intermediate macros, just ignore those :-) #define CAREFUL_ALIGNMENT 1 #endif -#define CVAL(buf,pos) ((unsigned)(((const uint8_t *)(buf))[pos])) +#define CVAL(buf,pos) ((uint_t)(((const uint8_t *)(buf))[pos])) #define CVAL_NC(buf,pos) (((uint8_t *)(buf))[pos]) /* Non-const version of CVAL */ #define PVAL(buf,pos) (CVAL(buf,pos)) #define SCVAL(buf,pos,val) (CVAL_NC(buf,pos) = (val)) diff --git a/source4/include/cli_context.h b/source4/include/cli_context.h index b0e178e1d0..24dcfe7235 100644 --- a/source4/include/cli_context.h +++ b/source4/include/cli_context.h @@ -43,7 +43,7 @@ struct cli_negotiate { /* * negotiated maximum transmit size - this is given to us by the server */ - unsigned max_xmit; + uint_t max_xmit; /* maximum number of requests that can be multiplexed */ uint16_t max_mux; @@ -85,7 +85,7 @@ struct cli_socket { /* a count of the number of packets we have received. We * actually only care about zero/non-zero at this stage */ - unsigned pkt_count; + uint_t pkt_count; /* the network address of the client */ char *client_addr; @@ -147,7 +147,7 @@ struct cli_transport { } dos; NTSTATUS nt_status; enum socket_error socket_error; - unsigned nbt_error; + uint_t nbt_error; } e; } error; @@ -232,7 +232,7 @@ struct cli_request { NTSTATUS status; /* the sequence number of this packet - used for signing */ - unsigned seq_num; + uint_t seq_num; /* set if this is a one-way request, meaning we are not expecting a reply from the server. */ @@ -246,12 +246,12 @@ struct cli_request { char *buffer; /* the size of the raw buffer, including 4 byte header */ - unsigned size; + uint_t size; /* how much has been allocated - on reply the buffer is over-allocated to prevent too many realloc() calls */ - unsigned allocated; + uint_t allocated; /* the start of the SMB header - this is always buffer+4 */ char *hdr; @@ -259,11 +259,11 @@ struct cli_request { /* the command words and command word count. vwv points into the raw buffer */ char *vwv; - unsigned wct; + uint_t wct; /* the data buffer and size. data points into the raw buffer */ char *data; - unsigned data_size; + uint_t data_size; /* ptr is used as a moving pointer into the data area * of the packet. The reason its here and not a local diff --git a/source4/include/md5.h b/source4/include/md5.h index 57c2f99caa..cd23979f8a 100644 --- a/source4/include/md5.h +++ b/source4/include/md5.h @@ -13,7 +13,7 @@ struct MD5Context { void MD5Init(struct MD5Context *context); void MD5Update(struct MD5Context *context, uint8_t const *buf, - unsigned len); + uint_t len); void MD5Final(uint8_t digest[16], struct MD5Context *context); /* diff --git a/source4/include/smb.h b/source4/include/smb.h index 55dd430d05..f0ddab65af 100644 --- a/source4/include/smb.h +++ b/source4/include/smb.h @@ -371,7 +371,7 @@ struct parm_struct void *ptr; BOOL (*special)(const char *, char **); const struct enum_list *enum_list; - unsigned flags; + uint_t flags; union { BOOL bvalue; int ivalue; diff --git a/source4/lib/bitmap.c b/source4/lib/bitmap.c index 2e67fb5439..5a8325d4ba 100644 --- a/source4/lib/bitmap.c +++ b/source4/lib/bitmap.c @@ -86,7 +86,7 @@ struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n) /**************************************************************************** set a bit in a bitmap ****************************************************************************/ -BOOL bitmap_set(struct bitmap *bm, unsigned i) +BOOL bitmap_set(struct bitmap *bm, uint_t i) { if (i >= bm->n) { DEBUG(0,("Setting invalid bitmap entry %d (of %d)\n", @@ -100,7 +100,7 @@ BOOL bitmap_set(struct bitmap *bm, unsigned i) /**************************************************************************** clear a bit in a bitmap ****************************************************************************/ -BOOL bitmap_clear(struct bitmap *bm, unsigned i) +BOOL bitmap_clear(struct bitmap *bm, uint_t i) { if (i >= bm->n) { DEBUG(0,("clearing invalid bitmap entry %d (of %d)\n", @@ -114,7 +114,7 @@ BOOL bitmap_clear(struct bitmap *bm, unsigned i) /**************************************************************************** query a bit in a bitmap ****************************************************************************/ -BOOL bitmap_query(struct bitmap *bm, unsigned i) +BOOL bitmap_query(struct bitmap *bm, uint_t i) { if (i >= bm->n) return False; if (bm->b[i/32] & (1<<(i%32))) { @@ -127,7 +127,7 @@ BOOL bitmap_query(struct bitmap *bm, unsigned i) find a zero bit in a bitmap starting at the specified offset, with wraparound ****************************************************************************/ -int bitmap_find(struct bitmap *bm, unsigned ofs) +int bitmap_find(struct bitmap *bm, uint_t ofs) { uint_t i, j; diff --git a/source4/lib/crypto/md5.c b/source4/lib/crypto/md5.c index 1c53a0a152..07028e9043 100644 --- a/source4/lib/crypto/md5.c +++ b/source4/lib/crypto/md5.c @@ -27,12 +27,12 @@ static void MD5Transform(uint32_t buf[4], uint32_t const in[16]); /* * Note: this code is harmless on little-endian machines. */ -static void byteReverse(uint8_t *buf, unsigned longs) +static void byteReverse(uint8_t *buf, uint_t longs) { uint32_t t; do { - t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 | - ((unsigned) buf[1] << 8 | buf[0]); + t = (uint32_t) ((uint_t) buf[3] << 8 | buf[2]) << 16 | + ((uint_t) buf[1] << 8 | buf[0]); *(uint32_t *) buf = t; buf += 4; } while (--longs); @@ -57,7 +57,7 @@ void MD5Init(struct MD5Context *ctx) * Update context to reflect the concatenation of another buffer full * of bytes. */ -void MD5Update(struct MD5Context *ctx, uint8_t const *buf, unsigned len) +void MD5Update(struct MD5Context *ctx, uint8_t const *buf, uint_t len) { register uint32_t t; diff --git a/source4/lib/iconv.c b/source4/lib/iconv.c index 65fa45248f..f75621af09 100644 --- a/source4/lib/iconv.c +++ b/source4/lib/iconv.c @@ -326,7 +326,7 @@ static size_t ucs2hex_pull(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) { while (*inbytesleft >= 1 && *outbytesleft >= 2) { - unsigned v; + uint_t v; if ((*inbuf)[0] != '@') { /* seven bit ascii case */ diff --git a/source4/lib/interfaces.c b/source4/lib/interfaces.c index 96f4b4cd94..89ed144eec 100644 --- a/source4/lib/interfaces.c +++ b/source4/lib/interfaces.c @@ -284,7 +284,7 @@ static int _get_interfaces(struct iface_struct *ifaces, int max_interfaces) i = ifc.ifc_len; while (i > 0 && total < max_interfaces) { - unsigned inc; + uint_t inc; inc = ifr->ifr_addr.sa_len; diff --git a/source4/lib/pidfile.c b/source4/lib/pidfile.c index 7126482256..989f19b323 100644 --- a/source4/lib/pidfile.c +++ b/source4/lib/pidfile.c @@ -32,7 +32,7 @@ pid_t pidfile_pid(const char *name) { int fd; char pidstr[20]; - unsigned ret; + uint_t ret; pstring pidFile; slprintf(pidFile, sizeof(pidFile)-1, "%s/%s.pid", lp_piddir(), name); diff --git a/source4/lib/talloc.c b/source4/lib/talloc.c index 92e0d52d2d..f3cdd75231 100644 --- a/source4/lib/talloc.c +++ b/source4/lib/talloc.c @@ -53,7 +53,7 @@ struct talloc_chunk { TALLOC_CTX *context; size_t size; void *ptr; - unsigned magic; + uint_t magic; }; @@ -492,7 +492,7 @@ char *talloc_describe_all(TALLOC_CTX *rt) if (!rt) return NULL; s = talloc_asprintf(rt, "global talloc allocations in pid: %u\n", - (unsigned) getpid()); + (uint_t) getpid()); s = talloc_asprintf_append(rt, s, "%-40s %8s %8s\n", "name", "chunks", "bytes"); s = talloc_asprintf_append(rt, s, "%-40s %8s %8s\n", @@ -517,8 +517,8 @@ char *talloc_describe_all(TALLOC_CTX *rt) s = talloc_asprintf_append(rt, s, "%-40s %8u %8u\n", what, - (unsigned) n_chunks, - (unsigned) bytes); + (uint_t) n_chunks, + (uint_t) bytes); total_bytes += bytes; total_chunks += n_chunks; } @@ -532,7 +532,7 @@ char *talloc_describe_all(TALLOC_CTX *rt) s = talloc_asprintf_append(rt, s, "%-40s %8u %8u\n", "TOTAL", - (unsigned) total_chunks, (unsigned) total_bytes); + (uint_t) total_chunks, (uint_t) total_bytes); return s; } @@ -563,7 +563,7 @@ void talloc_get_allocation(TALLOC_CTX *t, /* realloc an array, checking for integer overflow in the array size */ -void *talloc_realloc_array(TALLOC_CTX *ctx, void *ptr, size_t el_size, unsigned count) +void *talloc_realloc_array(TALLOC_CTX *ctx, void *ptr, size_t el_size, uint_t count) { if (count == 0 || count >= MAX_TALLOC_SIZE/el_size) { diff --git a/source4/lib/tdb/common/spinlock.c b/source4/lib/tdb/common/spinlock.c index 0c8991c1e0..ee3eff1b31 100644 --- a/source4/lib/tdb/common/spinlock.c +++ b/source4/lib/tdb/common/spinlock.c @@ -420,7 +420,7 @@ int tdb_spinunlock(TDB_CONTEXT *tdb, int list, int rw_type) int tdb_create_rwlocks(int fd, uint_t hash_size) { - unsigned size, i; + uint_t size, i; tdb_rwlock_t *rwlocks; size = TDB_SPINLOCK_SIZE(hash_size); @@ -446,7 +446,7 @@ int tdb_create_rwlocks(int fd, uint_t hash_size) int tdb_clear_spinlocks(TDB_CONTEXT *tdb) { tdb_rwlock_t *rwlocks; - unsigned i; + uint_t i; if (tdb->header.rwlocks == 0) return 0; if (!tdb->map_ptr) return -1; diff --git a/source4/lib/tdb/common/tdb.c b/source4/lib/tdb/common/tdb.c index b7b9631444..d4c0928217 100644 --- a/source4/lib/tdb/common/tdb.c +++ b/source4/lib/tdb/common/tdb.c @@ -541,7 +541,7 @@ static tdb_off tdb_dump_record(TDB_CONTEXT *tdb, tdb_off offset) if (tailer != rec.rec_len + sizeof(rec)) { printf("ERROR: tailer does not match record! tailer=%u totalsize=%u\n", - (unsigned)tailer, (unsigned)(rec.rec_len + sizeof(rec))); + (uint_t)tailer, (uint_t)(rec.rec_len + sizeof(rec))); } return rec.next; } diff --git a/source4/lib/time.c b/source4/lib/time.c index 5fd8aa3081..dbbfab24b5 100644 --- a/source4/lib/time.c +++ b/source4/lib/time.c @@ -150,7 +150,7 @@ BOOL null_mtime(time_t mtime) static uint16_t make_dos_date1(struct tm *t) { uint16_t ret=0; - ret = (((unsigned)(t->tm_mon+1)) >> 3) | ((t->tm_year-80) << 1); + ret = (((uint_t)(t->tm_mon+1)) >> 3) | ((t->tm_year-80) << 1); ret = ((ret&0xFF)<<8) | (t->tm_mday | (((t->tm_mon+1) & 0x7) << 5)); return ret; } @@ -161,7 +161,7 @@ static uint16_t make_dos_date1(struct tm *t) static uint16_t make_dos_time1(struct tm *t) { uint16_t ret=0; - ret = ((((unsigned)t->tm_min >> 3)&0x7) | (((unsigned)t->tm_hour) << 3)); + ret = ((((uint_t)t->tm_min >> 3)&0x7) | (((uint_t)t->tm_hour) << 3)); ret = ((ret&0xFF)<<8) | ((t->tm_sec/2) | ((t->tm_min & 0x7) << 5)); return ret; } diff --git a/source4/lib/util.c b/source4/lib/util.c index e8ad79af0c..16f5e7a888 100644 --- a/source4/lib/util.c +++ b/source4/lib/util.c @@ -982,7 +982,7 @@ void dump_data_pw(const char *msg, const uint8_t * data, size_t len) /* see if a range of memory is all zero. A NULL pointer is considered to be all zero */ -BOOL all_zero(const char *ptr, unsigned size) +BOOL all_zero(const char *ptr, uint_t size) { int i; if (!ptr) return True; diff --git a/source4/lib/wins_srv.c b/source4/lib/wins_srv.c index 30e81b08ab..71368658b0 100644 --- a/source4/lib/wins_srv.c +++ b/source4/lib/wins_srv.c @@ -139,7 +139,7 @@ void wins_srv_died(struct in_addr wins_ip, struct in_addr src_ip) /* return the total number of wins servers, dead or not */ -unsigned wins_srv_count(void) +uint_t wins_srv_count(void) { const char **list; int count = 0; @@ -327,7 +327,7 @@ exit: return a count of the number of IPs for a particular tag, including dead ones */ -unsigned wins_srv_count_tag(const char *tag) +uint_t wins_srv_count_tag(const char *tag) { const char **list; int i, count=0; diff --git a/source4/libads/disp_sec.c b/source4/libads/disp_sec.c index 0d8954a978..8cdef5e168 100644 --- a/source4/libads/disp_sec.c +++ b/source4/libads/disp_sec.c @@ -65,7 +65,7 @@ static void ads_disp_perms(uint32_t type) for (i = 0; i < 32; i++) { if (type & (1 << i)) { for (j = 1; perms[j].str; j ++) { - if (perms[j].mask == (((unsigned) 1) << i)) { + if (perms[j].mask == (((uint_t) 1) << i)) { printf("\n\t%s", perms[j].str); } } diff --git a/source4/libads/ldap.c b/source4/libads/ldap.c index 6a2dcbaa87..0abdb3f106 100644 --- a/source4/libads/ldap.c +++ b/source4/libads/ldap.c @@ -45,7 +45,7 @@ TODO : add a negative connection cache in here leveraged off of the one found in the rpc code. --jerry */ -static BOOL ads_try_connect(ADS_STRUCT *ads, const char *server, unsigned port) +static BOOL ads_try_connect(ADS_STRUCT *ads, const char *server, uint_t port) { char *srv; @@ -997,8 +997,8 @@ static ADS_STATUS ads_add_machine_acct(ADS_STRUCT *ads, const char *hostname, "user", "computer", NULL}; const char *servicePrincipalName[5] = {NULL, NULL, NULL, NULL, NULL}; char *psp, *psp2; - unsigned acct_control; - unsigned exists=0; + uint_t acct_control; + uint_t exists=0; LDAPMessage *res; status = ads_find_machine_acct(ads, (void **)&res, hostname); diff --git a/source4/libads/sasl.c b/source4/libads/sasl.c index 7604414365..ce787400f7 100644 --- a/source4/libads/sasl.c +++ b/source4/libads/sasl.c @@ -248,7 +248,7 @@ static ADS_STATUS ads_sasl_gssapi_bind(ADS_STRUCT *ads) uint8_t *p; uint32_t max_msg_size; char *sname; - unsigned sec_layer; + uint_t sec_layer; ADS_STATUS status; krb5_principal principal; krb5_context ctx; diff --git a/source4/libcli/auth/ntlmssp_parse.c b/source4/libcli/auth/ntlmssp_parse.c index aa4fc6b98f..251effd7e1 100644 --- a/source4/libcli/auth/ntlmssp_parse.c +++ b/source4/libcli/auth/ntlmssp_parse.c @@ -286,7 +286,7 @@ BOOL msrpc_parse(TALLOC_CTX *mem_ctx, const DATA_BLOB *blob, break; case 'b': b = (DATA_BLOB *)va_arg(ap, void *); - len1 = va_arg(ap, unsigned); + len1 = va_arg(ap, uint_t); /* make sure its in the right format - be strict */ NEED_DATA(len1); if (blob->data + head_ofs < (uint8_t *)head_ofs || blob->data + head_ofs < blob->data) diff --git a/source4/libcli/clifile.c b/source4/libcli/clifile.c index 7f4384a222..6f1c98555b 100644 --- a/source4/libcli/clifile.c +++ b/source4/libcli/clifile.c @@ -268,8 +268,8 @@ int cli_open(struct cli_tree *tree, const char *fname, int flags, int share_mode) { union smb_open open_parms; - unsigned openfn=0; - unsigned accessmode=0; + uint_t openfn=0; + uint_t accessmode=0; TALLOC_CTX *mem_ctx; NTSTATUS status; diff --git a/source4/libcli/namequery.c b/source4/libcli/namequery.c index 18d1ce3e93..0094cc26bb 100644 --- a/source4/libcli/namequery.c +++ b/source4/libcli/namequery.c @@ -37,7 +37,7 @@ static int generate_trn_id(void) trn_id = sys_random(); - return trn_id % (unsigned)0x7FFF; + return trn_id % (uint_t)0x7FFF; } diff --git a/source4/libcli/raw/clikrb5.c b/source4/libcli/raw/clikrb5.c index 1d9c02f7f4..ba3e9ccd17 100644 --- a/source4/libcli/raw/clikrb5.c +++ b/source4/libcli/raw/clikrb5.c @@ -278,9 +278,9 @@ static krb5_error_code ads_krb5_mk_req(krb5_context context, } /* cope with the ticket being in the future due to clock skew */ - if ((unsigned)credsp->times.starttime > time(NULL)) { + if ((uint_t)credsp->times.starttime > time(NULL)) { time_t t = time(NULL); - int time_offset = (unsigned)credsp->times.starttime - t; + int time_offset = (uint_t)credsp->times.starttime - t; DEBUG(4,("Advancing clock by %d seconds to cope with clock skew\n", time_offset)); krb5_set_real_time(context, t + time_offset + 1, 0); } diff --git a/source4/libcli/raw/rawrequest.c b/source4/libcli/raw/rawrequest.c index fd2d85cc65..c31f07505f 100644 --- a/source4/libcli/raw/rawrequest.c +++ b/source4/libcli/raw/rawrequest.c @@ -103,7 +103,7 @@ struct cli_request *cli_request_setup_nonsmb(struct cli_transport *transport, ui setup a SMB packet at transport level */ struct cli_request *cli_request_setup_transport(struct cli_transport *transport, - uint8_t command, unsigned wct, unsigned buflen) + uint8_t command, uint_t wct, uint_t buflen) { struct cli_request *req; @@ -149,7 +149,7 @@ struct cli_request *cli_request_setup_transport(struct cli_transport *transport, way. This interface is used before a session is setup. */ struct cli_request *cli_request_setup_session(struct cli_session *session, - uint8_t command, unsigned wct, unsigned buflen) + uint8_t command, uint_t wct, uint_t buflen) { struct cli_request *req; uint16_t flags2; @@ -190,7 +190,7 @@ struct cli_request *cli_request_setup_session(struct cli_session *session, */ struct cli_request *cli_request_setup(struct cli_tree *tree, uint8_t command, - unsigned wct, unsigned buflen) + uint_t wct, uint_t buflen) { struct cli_request *req; @@ -210,7 +210,7 @@ struct cli_request *cli_request_setup(struct cli_tree *tree, To cope with this req->out.ptr is supplied. This will be updated to point at the same offset into the packet as before this call */ -static void cli_req_grow_allocation(struct cli_request *req, unsigned new_size) +static void cli_req_grow_allocation(struct cli_request *req, uint_t new_size) { int delta; char *buf2; @@ -251,7 +251,7 @@ static void cli_req_grow_allocation(struct cli_request *req, unsigned new_size) To cope with this req->out.ptr is supplied. This will be updated to point at the same offset into the packet as before this call */ -static void cli_req_grow_data(struct cli_request *req, unsigned new_size) +static void cli_req_grow_data(struct cli_request *req, uint_t new_size) { int delta; @@ -524,7 +524,7 @@ BOOL cli_request_is_error(struct cli_request *req) return the number of bytes added to the packet */ -size_t cli_req_append_string(struct cli_request *req, const char *str, unsigned flags) +size_t cli_req_append_string(struct cli_request *req, const char *str, uint_t flags) { size_t len; @@ -555,7 +555,7 @@ size_t cli_req_append_string(struct cli_request *req, const char *str, unsigned this is used in places where the non-terminated string byte length is placed in the packet as a separate field */ -size_t cli_req_append_string_len(struct cli_request *req, const char *str, unsigned flags, int *len) +size_t cli_req_append_string_len(struct cli_request *req, const char *str, uint_t flags, int *len) { int diff = 0; size_t ret; @@ -596,7 +596,7 @@ size_t cli_req_append_string_len(struct cli_request *req, const char *str, unsig if dest_len is -1 then no limit applies */ -size_t cli_req_append_ascii4(struct cli_request *req, const char *str, unsigned flags) +size_t cli_req_append_ascii4(struct cli_request *req, const char *str, uint_t flags) { size_t size; cli_req_append_bytes(req, (const uint8_t *)"\4", 1); @@ -662,7 +662,7 @@ size_t cli_req_append_var_block(struct cli_request *req, const uint8_t *bytes, u of bytes consumed in the packet is returned */ static size_t cli_req_pull_ucs2(struct cli_request *req, TALLOC_CTX *mem_ctx, - char **dest, const char *src, int byte_len, unsigned flags) + char **dest, const char *src, int byte_len, uint_t flags) { int src_len, src_len2, alignment=0; ssize_t ret; @@ -719,7 +719,7 @@ static size_t cli_req_pull_ucs2(struct cli_request *req, TALLOC_CTX *mem_ctx, of bytes consumed in the packet is returned */ size_t cli_req_pull_ascii(struct cli_request *req, TALLOC_CTX *mem_ctx, - char **dest, const char *src, int byte_len, unsigned flags) + char **dest, const char *src, int byte_len, uint_t flags) { int src_len, src_len2; ssize_t ret; @@ -762,7 +762,7 @@ size_t cli_req_pull_ascii(struct cli_request *req, TALLOC_CTX *mem_ctx, of bytes consumed in the packet is returned */ size_t cli_req_pull_string(struct cli_request *req, TALLOC_CTX *mem_ctx, - char **dest, const char *src, int byte_len, unsigned flags) + char **dest, const char *src, int byte_len, uint_t flags) { if (!(flags & STR_ASCII) && (((flags & STR_UNICODE) || (req->flags2 & FLAGS2_UNICODE_STRINGS)))) { @@ -860,7 +860,7 @@ NTTIME cli_pull_nttime(void *base, uint16_t offset) */ static size_t cli_blob_pull_ucs2(TALLOC_CTX* mem_ctx, DATA_BLOB *blob, const char **dest, - const char *src, int byte_len, unsigned flags) + const char *src, int byte_len, uint_t flags) { int src_len, src_len2, alignment=0; ssize_t ret; @@ -919,7 +919,7 @@ static size_t cli_blob_pull_ucs2(TALLOC_CTX* mem_ctx, */ static size_t cli_blob_pull_ascii(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, const char **dest, - const char *src, int byte_len, unsigned flags) + const char *src, int byte_len, uint_t flags) { int src_len, src_len2; ssize_t ret; @@ -968,7 +968,7 @@ size_t cli_blob_pull_string(struct cli_session *session, DATA_BLOB *blob, WIRE_STRING *dest, uint16_t len_offset, uint16_t str_offset, - unsigned flags) + uint_t flags) { int extra; dest->s = NULL; @@ -1023,7 +1023,7 @@ size_t cli_blob_pull_unix_string(struct cli_session *session, DATA_BLOB *blob, const char **dest, uint16_t str_offset, - unsigned flags) + uint_t flags) { int extra = 0; *dest = NULL; @@ -1057,7 +1057,7 @@ size_t cli_blob_pull_unix_string(struct cli_session *session, */ size_t cli_blob_append_string(struct cli_session *session, TALLOC_CTX *mem_ctx, DATA_BLOB *blob, - const char *str, unsigned flags) + const char *str, uint_t flags) { size_t max_len; int len; diff --git a/source4/libcli/util/asn1.c b/source4/libcli/util/asn1.c index b44c62bc50..ddefe0baa6 100644 --- a/source4/libcli/util/asn1.c +++ b/source4/libcli/util/asn1.c @@ -122,7 +122,7 @@ BOOL asn1_write_Integer(ASN1_DATA *data, int i) /* write an object ID to a ASN1 buffer */ BOOL asn1_write_OID(ASN1_DATA *data, const char *OID) { - unsigned v, v2; + uint_t v, v2; const char *p = (const char *)OID; char *newp; @@ -328,7 +328,7 @@ BOOL asn1_read_OID(ASN1_DATA *data, char **OID) pstrcat(aoid, el); while (asn1_tag_remaining(data) > 0) { - unsigned v = 0; + uint_t v = 0; do { asn1_read_uint8(data, &b); v = (v<<7) | (b&0x7f); diff --git a/source4/libcli/util/smbdes.c b/source4/libcli/util/smbdes.c index 90724cb778..967d0ffb82 100644 --- a/source4/libcli/util/smbdes.c +++ b/source4/libcli/util/smbdes.c @@ -46,8 +46,6 @@ */ -#define uint8_t unsigned char - static const uint8_t perm1[56] = {57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, @@ -306,7 +304,7 @@ void smbhash(uint8_t *out, const uint8_t *in, const uint8_t *key, int forw) void E_P16(const uint8_t *p14,uint8_t *p16) { - unsigned const char sp8[8] = {0x4b, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25}; + const uint8_t sp8[8] = {0x4b, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25}; smbhash(p16, sp8, p14, 1); smbhash(p16+8, sp8, p14+7, 1); } diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index f0a9649a44..5d317794e1 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -434,7 +434,7 @@ NTSTATUS dcerpc_auth3(struct dcerpc_pipe *p, /* perform a dcerpc bind, using the uuid as the key */ NTSTATUS dcerpc_bind_byuuid(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, - const char *uuid, unsigned version) + const char *uuid, uint_t version) { struct dcerpc_syntax_id syntax; struct dcerpc_syntax_id transfer_syntax; diff --git a/source4/librpc/rpc/dcerpc.h b/source4/librpc/rpc/dcerpc.h index 9406b9e20a..74bdaf878e 100644 --- a/source4/librpc/rpc/dcerpc.h +++ b/source4/librpc/rpc/dcerpc.h @@ -50,7 +50,7 @@ struct dcerpc_pipe { uint32_t call_id; uint32_t srv_max_xmit_frag; uint32_t srv_max_recv_frag; - unsigned flags; + uint_t flags; struct dcerpc_security *security_state; struct dcerpc_auth *auth_info; const char *binding_string; diff --git a/source4/librpc/rpc/dcerpc_auth.c b/source4/librpc/rpc/dcerpc_auth.c index 2b01ad2d4e..3faf0603ce 100644 --- a/source4/librpc/rpc/dcerpc_auth.c +++ b/source4/librpc/rpc/dcerpc_auth.c @@ -26,7 +26,7 @@ do a non-athenticated dcerpc bind */ NTSTATUS dcerpc_bind_auth_none(struct dcerpc_pipe *p, - const char *uuid, unsigned version) + const char *uuid, uint_t version) { TALLOC_CTX *mem_ctx; NTSTATUS status; diff --git a/source4/librpc/rpc/dcerpc_ntlm.c b/source4/librpc/rpc/dcerpc_ntlm.c index e2bea2f18c..db707be1b5 100644 --- a/source4/librpc/rpc/dcerpc_ntlm.c +++ b/source4/librpc/rpc/dcerpc_ntlm.c @@ -83,7 +83,7 @@ static void ntlm_security_end(struct dcerpc_security *dcerpc_security) do ntlm style authentication on a dcerpc pipe */ NTSTATUS dcerpc_bind_auth_ntlm(struct dcerpc_pipe *p, - const char *uuid, unsigned version, + const char *uuid, uint_t version, const char *domain, const char *username, const char *password) diff --git a/source4/librpc/rpc/dcerpc_schannel.c b/source4/librpc/rpc/dcerpc_schannel.c index dd05343b41..1874de726b 100644 --- a/source4/librpc/rpc/dcerpc_schannel.c +++ b/source4/librpc/rpc/dcerpc_schannel.c @@ -163,7 +163,7 @@ NTSTATUS dcerpc_schannel_key(struct dcerpc_pipe *p, is the domain trust password */ NTSTATUS dcerpc_bind_auth_schannel_key(struct dcerpc_pipe *p, - const char *uuid, unsigned version, + const char *uuid, uint_t version, const char *domain, const char *username, const uint8_t session_key[8]) @@ -261,7 +261,7 @@ done: of the form HOSTNAME$ and the password is the domain trust password */ NTSTATUS dcerpc_bind_auth_schannel(struct dcerpc_pipe *p, - const char *uuid, unsigned version, + const char *uuid, uint_t version, const char *domain, const char *username, const char *password) diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c index 5022449182..d8da1327d5 100644 --- a/source4/librpc/rpc/dcerpc_util.c +++ b/source4/librpc/rpc/dcerpc_util.c @@ -52,7 +52,7 @@ size_t ndr_size_epm_towers(struct epm_towers *towers) work out what TCP port to use for a given interface on a given host */ NTSTATUS dcerpc_epm_map_tcp_port(const char *server, - const char *uuid, unsigned version, + const char *uuid, uint_t version, uint32_t *port) { struct dcerpc_pipe *p; diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c index 116b716474..0781558e8e 100644 --- a/source4/ntvfs/ntvfs_generic.c +++ b/source4/ntvfs/ntvfs_generic.c @@ -273,7 +273,7 @@ NTSTATUS ntvfs_map_fsinfo(struct request_context *req, union smb_fsinfo *fs) case RAW_QFS_DSKATTR: { /* map from generic to DSKATTR */ - unsigned bpunit = 64; + uint_t bpunit = 64; /* we need to scale the sizes to fit */ for (bpunit=64; bpunit<0x10000; bpunit *= 2) { diff --git a/source4/smb_server/conn.c b/source4/smb_server/conn.c index d0b60fe29d..490dde979c 100644 --- a/source4/smb_server/conn.c +++ b/source4/smb_server/conn.c @@ -53,7 +53,7 @@ BOOL conn_snum_used(struct server_context *smb, int snum) /**************************************************************************** find a conn given a cnum ****************************************************************************/ -struct tcon_context *conn_find(struct server_context *smb, unsigned cnum) +struct tcon_context *conn_find(struct server_context *smb, uint_t cnum) { int count=0; struct tcon_context *conn; diff --git a/source4/smb_server/request.c b/source4/smb_server/request.c index 5b1335a651..b1e3b5f66e 100644 --- a/source4/smb_server/request.c +++ b/source4/smb_server/request.c @@ -79,7 +79,7 @@ struct request_context *init_smb_request(struct server_context *smb) /* setup a chained reply in req->out with the given word count and initial data buffer size. */ -static void req_setup_chain_reply(struct request_context *req, unsigned wct, unsigned buflen) +static void req_setup_chain_reply(struct request_context *req, uint_t wct, uint_t buflen) { uint32_t chain_base_size = req->out.size; @@ -111,7 +111,7 @@ static void req_setup_chain_reply(struct request_context *req, unsigned wct, uns the caller will then fill in the command words and data before calling req_send_reply() to send the reply on its way */ -void req_setup_reply(struct request_context *req, unsigned wct, unsigned buflen) +void req_setup_reply(struct request_context *req, uint_t wct, uint_t buflen) { if (req->chain_count != 0) { req_setup_chain_reply(req, wct, buflen); @@ -190,7 +190,7 @@ int req_max_data(struct request_context *req) To cope with this req->out.ptr is supplied. This will be updated to point at the same offset into the packet as before this call */ -static void req_grow_allocation(struct request_context *req, unsigned new_size) +static void req_grow_allocation(struct request_context *req, uint_t new_size) { int delta; char *buf2; @@ -231,7 +231,7 @@ static void req_grow_allocation(struct request_context *req, unsigned new_size) To cope with this req->out.ptr is supplied. This will be updated to point at the same offset into the packet as before this call */ -void req_grow_data(struct request_context *req, unsigned new_size) +void req_grow_data(struct request_context *req, uint_t new_size) { int delta; @@ -345,10 +345,10 @@ void req_reply_error(struct request_context *req, NTSTATUS status) if dest_len is -1 then no limit applies */ -size_t req_push_str(struct request_context *req, char *dest, const char *str, int dest_len, unsigned flags) +size_t req_push_str(struct request_context *req, char *dest, const char *str, int dest_len, uint_t flags) { size_t len; - unsigned grow_size; + uint_t grow_size; char *buf0; const int max_bytes_per_char = 3; @@ -427,7 +427,7 @@ size_t req_append_var_block(struct request_context *req, on failure zero is returned and *dest is set to NULL, otherwise the number of bytes consumed in the packet is returned */ -static size_t req_pull_ucs2(struct request_context *req, const char **dest, const char *src, int byte_len, unsigned flags) +static size_t req_pull_ucs2(struct request_context *req, const char **dest, const char *src, int byte_len, uint_t flags) { int src_len, src_len2, alignment=0; ssize_t ret; @@ -484,7 +484,7 @@ static size_t req_pull_ucs2(struct request_context *req, const char **dest, cons on failure zero is returned and *dest is set to NULL, otherwise the number of bytes consumed in the packet is returned */ -static size_t req_pull_ascii(struct request_context *req, const char **dest, const char *src, int byte_len, unsigned flags) +static size_t req_pull_ascii(struct request_context *req, const char **dest, const char *src, int byte_len, uint_t flags) { int src_len, src_len2; ssize_t ret; @@ -531,7 +531,7 @@ static size_t req_pull_ascii(struct request_context *req, const char **dest, con on failure zero is returned and *dest is set to NULL, otherwise the number of bytes consumed in the packet is returned */ -size_t req_pull_string(struct request_context *req, const char **dest, const char *src, int byte_len, unsigned flags) +size_t req_pull_string(struct request_context *req, const char **dest, const char *src, int byte_len, uint_t flags) { if (!(flags & STR_ASCII) && (((flags & STR_UNICODE) || (req->flags2 & FLAGS2_UNICODE_STRINGS)))) { @@ -551,7 +551,7 @@ size_t req_pull_string(struct request_context *req, const char **dest, const cha on failure *dest is set to the zero length string. This seems to match win2000 behaviour */ -size_t req_pull_ascii4(struct request_context *req, const char **dest, const char *src, unsigned flags) +size_t req_pull_ascii4(struct request_context *req, const char **dest, const char *src, uint_t flags) { ssize_t ret; @@ -613,7 +613,7 @@ BOOL req_data_oob(struct request_context *req, const char *ptr, uint32_t count) /* pull an open file handle from a packet, taking account of the chained_fnum */ -uint16_t req_fnum(struct request_context *req, const char *base, unsigned offset) +uint16_t req_fnum(struct request_context *req, const char *base, uint_t offset) { if (req->chained_fnum != -1) { return req->chained_fnum; diff --git a/source4/smbd/server.c b/source4/smbd/server.c index 1dc8082b30..a753a2d6db 100644 --- a/source4/smbd/server.c +++ b/source4/smbd/server.c @@ -39,7 +39,7 @@ void exit_server(struct server_context *smb, const char *reason) static void setup_listen(struct event_context *events, const struct model_ops *model_ops, void (*accept_handler)(struct event_context *,struct fd_event *,time_t,uint16_t), - struct in_addr *ifip, unsigned port) + struct in_addr *ifip, uint_t port) { struct fd_event fde; fde.fd = open_socket_in(SOCK_STREAM, port, 0, ifip->s_addr, True); @@ -81,7 +81,7 @@ static void add_socket(struct event_context *events, for (tok=strtok_r(lp_smb_ports(), delim, &ptr); tok; tok=strtok_r(NULL, delim, &ptr)) { - unsigned port = atoi(tok); + uint_t port = atoi(tok); if (port == 0) continue; setup_listen(events, model_ops, model_ops->accept_connection, ifip, port); } diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c index 0e4f5251da..102b44fbd3 100644 --- a/source4/torture/basic/denytest.c +++ b/source4/torture/basic/denytest.c @@ -1393,7 +1393,7 @@ static struct { }; -static void progress_bar(unsigned i, unsigned total) +static void progress_bar(uint_t i, uint_t total) { if (i % 10 != 0) return; printf("%5d/%5d\r", i, total); diff --git a/source4/torture/basic/mangle_test.c b/source4/torture/basic/mangle_test.c index 94dac45b9d..4859ee7c4c 100644 --- a/source4/torture/basic/mangle_test.c +++ b/source4/torture/basic/mangle_test.c @@ -24,7 +24,7 @@ static TDB_CONTEXT *tdb; #define NAME_LENGTH 20 -static unsigned total, collisions, failures; +static uint_t total, collisions, failures; static BOOL test_one(struct cli_state *cli, const char *name) { @@ -108,8 +108,8 @@ static BOOL test_one(struct cli_state *cli, const char *name) static void gen_name(char *name) { const char *chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz._-$~..."; - unsigned max_idx = strlen(chars); - unsigned len; + uint_t max_idx = strlen(chars); + uint_t len; int i; char *p; diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c index 99dcf9fd47..10238c75a5 100644 --- a/source4/torture/locktest.c +++ b/source4/torture/locktest.c @@ -30,9 +30,9 @@ static BOOL showall; static BOOL analyze; static BOOL hide_unlock_fails; static BOOL use_oplocks; -static unsigned lock_range = 100; -static unsigned lock_base = 0; -static unsigned min_length = 0; +static uint_t lock_range = 100; +static uint_t lock_base = 0; +static uint_t min_length = 0; static BOOL exact_error_codes; static BOOL zero_zero; @@ -164,8 +164,8 @@ static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS], int fnum[NSERVERS][NCONNECTIONS][NFILES], struct record *rec) { - unsigned conn = rec->conn; - unsigned f = rec->f; + uint_t conn = rec->conn; + uint_t f = rec->f; uint64_t start = rec->start; uint64_t len = rec->len; enum brl_type op = rec->lock_type; @@ -322,7 +322,7 @@ static void test_locks(char *share[NSERVERS]) #endif recorded[n].conn = random() % NCONNECTIONS; recorded[n].f = random() % NFILES; - recorded[n].start = lock_base + ((unsigned)random() % (lock_range-1)); + recorded[n].start = lock_base + ((uint_t)random() % (lock_range-1)); recorded[n].len = min_length + random() % (lock_range-(recorded[n].start-lock_base)); recorded[n].start *= RANGE_MULTIPLE; diff --git a/source4/torture/locktest2.c b/source4/torture/locktest2.c index ac48da58b9..40227d2997 100644 --- a/source4/torture/locktest2.c +++ b/source4/torture/locktest2.c @@ -54,7 +54,7 @@ static BOOL use_oplocks; struct record { char r1, r2; char conn, f, fstype; - unsigned start, len; + uint_t start, len; char needed; }; @@ -91,7 +91,7 @@ static BOOL try_close(struct cli_state *c, int fstype, int fd) } static BOOL try_lock(struct cli_state *c, int fstype, - int fd, unsigned start, unsigned len, + int fd, uint_t start, uint_t len, enum brl_type op) { struct flock lock; @@ -113,7 +113,7 @@ static BOOL try_lock(struct cli_state *c, int fstype, } static BOOL try_unlock(struct cli_state *c, int fstype, - int fd, unsigned start, unsigned len) + int fd, uint_t start, uint_t len) { struct flock lock; @@ -224,13 +224,13 @@ static BOOL test_one(struct cli_state *cli[NSERVERS][NCONNECTIONS], int fnum[NSERVERS][NUMFSTYPES][NCONNECTIONS][NFILES], struct record *rec) { - unsigned conn = rec->conn; - unsigned f = rec->f; - unsigned fstype = rec->fstype; - unsigned start = rec->start; - unsigned len = rec->len; - unsigned r1 = rec->r1; - unsigned r2 = rec->r2; + uint_t conn = rec->conn; + uint_t f = rec->f; + uint_t fstype = rec->fstype; + uint_t start = rec->start; + uint_t len = rec->len; + uint_t r1 = rec->r1; + uint_t r2 = rec->r2; enum brl_type op; int server; BOOL ret[NSERVERS]; @@ -377,7 +377,7 @@ static void test_locks(char *share1, char *share2, char *nfspath1, char *nfspath recorded[n].conn = random() % NCONNECTIONS; recorded[n].fstype = random() % NUMFSTYPES; recorded[n].f = random() % NFILES; - recorded[n].start = LOCKBASE + ((unsigned)random() % (LOCKRANGE-1)); + recorded[n].start = LOCKBASE + ((uint_t)random() % (LOCKRANGE-1)); recorded[n].len = 1 + random() % (LOCKRANGE-(recorded[n].start-LOCKBASE)); recorded[n].start *= RANGE_MULTIPLE; diff --git a/source4/torture/nbench/nbio.c b/source4/torture/nbench/nbio.c index 9f8c6e6c73..a7a82027a3 100644 --- a/source4/torture/nbench/nbio.c +++ b/source4/torture/nbench/nbio.c @@ -207,14 +207,14 @@ void nb_unlink(const char *fname, int attr, NTSTATUS status) void nb_createx(const char *fname, - unsigned create_options, unsigned create_disposition, int handle, + uint_t create_options, uint_t create_disposition, int handle, NTSTATUS status) { union smb_open io; uint32_t desired_access; NTSTATUS ret; TALLOC_CTX *mem_ctx; - unsigned flags = 0; + uint_t flags = 0; struct ftable *f; mem_ctx = talloc_init("raw_open"); @@ -335,7 +335,7 @@ void nb_write(int handle, int offset, int size, int ret_size, NTSTATUS status) } -void nb_lockx(int handle, unsigned offset, int size, NTSTATUS status) +void nb_lockx(int handle, uint_t offset, int size, NTSTATUS status) { union smb_lock io; int i; @@ -361,7 +361,7 @@ void nb_lockx(int handle, unsigned offset, int size, NTSTATUS status) check_status("LockX", status, ret); } -void nb_unlockx(int handle, unsigned offset, int size, NTSTATUS status) +void nb_unlockx(int handle, uint_t offset, int size, NTSTATUS status) { union smb_lock io; int i; diff --git a/source4/torture/raw/qfileinfo.c b/source4/torture/raw/qfileinfo.c index 26c94b6a09..07fb81e6d9 100644 --- a/source4/torture/raw/qfileinfo.c +++ b/source4/torture/raw/qfileinfo.c @@ -23,8 +23,8 @@ static struct { const char *name; enum fileinfo_level level; - unsigned only_paths:1; - unsigned only_handles:1; + uint_t only_paths:1; + uint_t only_handles:1; uint32_t capability_mask; NTSTATUS fnum_status, fname_status; union smb_fileinfo fnum_finfo, fname_finfo; @@ -416,21 +416,21 @@ BOOL torture_raw_qfileinfo(int dummy) s1 = fnum_find(sname); \ if (s1 && s1->stype.out.tfield != correct_size) { \ printf("(%d) handle %s/%s incorrect - %u should be %u\n", __LINE__, #stype, #tfield, \ - (unsigned)s1->stype.out.tfield, \ - (unsigned)correct_size); \ + (uint_t)s1->stype.out.tfield, \ + (uint_t)correct_size); \ ret = False; \ } \ s1 = fname_find(sname); \ if (s1 && s1->stype.out.tfield != correct_size) { \ printf("(%d) path %s/%s incorrect - %u should be %u\n", __LINE__, #stype, #tfield, \ - (unsigned)s1->stype.out.tfield, \ - (unsigned)correct_size); \ + (uint_t)s1->stype.out.tfield, \ + (uint_t)correct_size); \ ret = False; \ }} while (0) s1 = fnum_find("STANDARD_INFO"); correct_size = s1->standard_info.out.size; - printf("size: %u\n", (unsigned)correct_size); + printf("size: %u\n", (uint_t)correct_size); SIZE_CHECK("GETATTR", getattr, size); SIZE_CHECK("GETATTRE", getattre, size); @@ -451,7 +451,7 @@ BOOL torture_raw_qfileinfo(int dummy) s1 = fnum_find("STANDARD_INFO"); correct_size = s1->standard_info.out.alloc_size; - printf("alloc_size: %u\n", (unsigned)correct_size); + printf("alloc_size: %u\n", (uint_t)correct_size); SIZE_CHECK("GETATTRE", getattre, alloc_size); SIZE_CHECK("STANDARD", standard, alloc_size); @@ -470,21 +470,21 @@ BOOL torture_raw_qfileinfo(int dummy) s1 = fnum_find(sname); \ if (s1 && s1->stype.out.tfield != correct_attrib) { \ printf("(%d) handle %s/%s incorrect - 0x%x should be 0x%x\n", __LINE__, #stype, #tfield, \ - (unsigned)s1->stype.out.tfield, \ - (unsigned)correct_attrib); \ + (uint_t)s1->stype.out.tfield, \ + (uint_t)correct_attrib); \ ret = False; \ } \ s1 = fname_find(sname); \ if (s1 && s1->stype.out.tfield != correct_attrib) { \ printf("(%d) path %s/%s incorrect - 0x%x should be 0x%x\n", __LINE__, #stype, #tfield, \ - (unsigned)s1->stype.out.tfield, \ - (unsigned)correct_attrib); \ + (uint_t)s1->stype.out.tfield, \ + (uint_t)correct_attrib); \ ret = False; \ }} while (0) s1 = fnum_find("BASIC_INFO"); correct_attrib = s1->basic_info.out.attrib; - printf("attrib: 0x%x\n", (unsigned)correct_attrib); + printf("attrib: 0x%x\n", (uint_t)correct_attrib); ATTRIB_CHECK("GETATTR", getattr, attrib); ATTRIB_CHECK("GETATTRE", getattre, attrib); @@ -688,13 +688,13 @@ BOOL torture_raw_qfileinfo(int dummy) if (s1 && s1->stype.out.tfield != 0) { \ printf("(%d) handle %s/%s unknown != 0 (0x%x)\n", __LINE__, \ #stype, #tfield, \ - (unsigned)s1->stype.out.tfield); \ + (uint_t)s1->stype.out.tfield); \ } \ s1 = fname_find(sname); \ if (s1 && s1->stype.out.tfield != 0) { \ printf("(%d) path %s/%s unknown != 0 (0x%x)\n", __LINE__, \ #stype, #tfield, \ - (unsigned)s1->stype.out.tfield); \ + (uint_t)s1->stype.out.tfield); \ }} while (0) /* now get a bit fancier .... */ diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c index 5e1d055e22..5fba3f1b31 100644 --- a/source4/torture/raw/read.c +++ b/source4/torture/raw/read.c @@ -48,7 +48,7 @@ /* setup a random buffer based on a seed */ -static void setup_buffer(char *buf, unsigned seed, int len) +static void setup_buffer(char *buf, uint_t seed, int len) { int i; srandom(seed); @@ -58,7 +58,7 @@ static void setup_buffer(char *buf, unsigned seed, int len) /* check a random buffer based on a seed */ -static BOOL check_buffer(char *buf, unsigned seed, int len, int line) +static BOOL check_buffer(char *buf, uint_t seed, int len, int line) { int i; srandom(seed); @@ -86,7 +86,7 @@ static BOOL test_read(struct cli_state *cli, TALLOC_CTX *mem_ctx) const int maxsize = 90000; const char *fname = BASEDIR "\\test.txt"; const char *test_data = "TEST DATA"; - unsigned seed = time(NULL); + uint_t seed = time(NULL); buf = talloc_zero(mem_ctx, maxsize); @@ -212,7 +212,7 @@ static BOOL test_lockread(struct cli_state *cli, TALLOC_CTX *mem_ctx) const int maxsize = 90000; const char *fname = BASEDIR "\\test.txt"; const char *test_data = "TEST DATA"; - unsigned seed = time(NULL); + uint_t seed = time(NULL); buf = talloc_zero(mem_ctx, maxsize); @@ -355,7 +355,7 @@ static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx) const int maxsize = 90000; const char *fname = BASEDIR "\\test.txt"; const char *test_data = "TEST DATA"; - unsigned seed = time(NULL); + uint_t seed = time(NULL); buf = talloc_zero(mem_ctx, maxsize); @@ -540,7 +540,7 @@ static BOOL test_readbraw(struct cli_state *cli, TALLOC_CTX *mem_ctx) const int maxsize = 90000; const char *fname = BASEDIR "\\test.txt"; const char *test_data = "TEST DATA"; - unsigned seed = time(NULL); + uint_t seed = time(NULL); buf = talloc_zero(mem_ctx, maxsize); diff --git a/source4/torture/raw/write.c b/source4/torture/raw/write.c index 18c992b8c6..8873ca5ae8 100644 --- a/source4/torture/raw/write.c +++ b/source4/torture/raw/write.c @@ -61,7 +61,7 @@ /* setup a random buffer based on a seed */ -static void setup_buffer(char *buf, unsigned seed, int len) +static void setup_buffer(char *buf, uint_t seed, int len) { int i; srandom(seed); @@ -71,7 +71,7 @@ static void setup_buffer(char *buf, unsigned seed, int len) /* check a random buffer based on a seed */ -static BOOL check_buffer(char *buf, unsigned seed, int len, int line) +static BOOL check_buffer(char *buf, uint_t seed, int len, int line) { int i; srandom(seed); @@ -98,7 +98,7 @@ static BOOL test_write(struct cli_state *cli, TALLOC_CTX *mem_ctx) char *buf; const int maxsize = 90000; const char *fname = BASEDIR "\\test.txt"; - unsigned seed = time(NULL); + uint_t seed = time(NULL); union smb_fileinfo finfo; buf = talloc_zero(mem_ctx, maxsize); @@ -217,7 +217,7 @@ static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx) char *buf; const int maxsize = 90000; const char *fname = BASEDIR "\\test.txt"; - unsigned seed = time(NULL); + uint_t seed = time(NULL); union smb_fileinfo finfo; buf = talloc_zero(mem_ctx, maxsize); @@ -391,7 +391,7 @@ static BOOL test_writeunlock(struct cli_state *cli, TALLOC_CTX *mem_ctx) char *buf; const int maxsize = 90000; const char *fname = BASEDIR "\\test.txt"; - unsigned seed = time(NULL); + uint_t seed = time(NULL); union smb_fileinfo finfo; buf = talloc_zero(mem_ctx, maxsize); @@ -530,7 +530,7 @@ static BOOL test_writeclose(struct cli_state *cli, TALLOC_CTX *mem_ctx) char *buf; const int maxsize = 90000; const char *fname = BASEDIR "\\test.txt"; - unsigned seed = time(NULL); + uint_t seed = time(NULL); union smb_fileinfo finfo; buf = talloc_zero(mem_ctx, maxsize); diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 7dfa2494b7..e3c603da17 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -343,7 +343,7 @@ static BOOL test_CreateSecret(struct dcerpc_pipe *p, printf("Testing CreateSecret\n"); - asprintf(&secname, "torturesecret-%u", (unsigned)random()); + asprintf(&secname, "torturesecret-%u", (uint_t)random()); init_lsa_Name(&r.in.name, secname); diff --git a/source4/torture/torture.c b/source4/torture/torture.c index aadc07781a..fbe0fd5097 100644 --- a/source4/torture/torture.c +++ b/source4/torture/torture.c @@ -237,7 +237,7 @@ static BOOL rw_torture(struct cli_state *c) for (i=0;i<torture_numops;i++) { - unsigned n = (unsigned)sys_random()%10; + uint_t n = (uint_t)sys_random()%10; if (i % 10 == 0) { printf("%d\r", i); fflush(stdout); } @@ -324,8 +324,8 @@ static BOOL rw_torture3(struct cli_state *c, const char *lockfname) uint_t i = 0; char buf[131072]; char buf_rd[131072]; - unsigned count; - unsigned countprev = 0; + uint_t count; + uint_t countprev = 0; ssize_t sent = 0; BOOL correct = True; @@ -372,7 +372,7 @@ static BOOL rw_torture3(struct cli_state *c, const char *lockfname) if (procnum == 0) { - sent = ((unsigned)sys_random()%(20))+ 1; + sent = ((uint_t)sys_random()%(20))+ 1; if (sent > sizeof(buf) - count) { sent = sizeof(buf) - count; @@ -453,7 +453,7 @@ static BOOL rw_torture2(struct cli_state *c1, struct cli_state *c2) for (i=0;i<torture_numops;i++) { - size_t buf_size = ((unsigned)sys_random()%(sizeof(buf)-1))+ 1; + size_t buf_size = ((uint_t)sys_random()%(sizeof(buf)-1))+ 1; if (i % 10 == 0) { printf("%d\r", i); fflush(stdout); } @@ -556,7 +556,7 @@ static BOOL run_locktest1(int dummy) const char *fname = "\\lockt1.lck"; int fnum1, fnum2, fnum3; time_t t1, t2; - unsigned lock_timeout; + uint_t lock_timeout; if (!torture_open_connection(&cli1) || !torture_open_connection(&cli2)) { return False; @@ -4053,7 +4053,7 @@ double torture_create_procs(BOOL (*fn)(struct cli_state *, int), BOOL *result) static struct { const char *name; BOOL (*fn)(int); - unsigned flags; + uint_t flags; } torture_ops[] = { {"FDPASS", run_fdpasstest, 0}, {"LOCK1", run_locktest1, 0}, diff --git a/source4/utils/net.c b/source4/utils/net.c index ce874d2efd..5ccc50242f 100644 --- a/source4/utils/net.c +++ b/source4/utils/net.c @@ -161,7 +161,7 @@ NTSTATUS connect_to_ipc_anonymous(struct cli_state **c, } } -BOOL net_find_server(unsigned flags, struct in_addr *server_ip, char **server_name) +BOOL net_find_server(uint_t flags, struct in_addr *server_ip, char **server_name) { if (opt_host) { @@ -248,7 +248,7 @@ BOOL net_find_dc(struct in_addr *server_ip, fstring server_name, const char *dom } -struct cli_state *net_make_ipc_connection(unsigned flags) +struct cli_state *net_make_ipc_connection(uint_t flags) { char *server_name = NULL; struct in_addr server_ip; diff --git a/source4/utils/net_ads_cldap.c b/source4/utils/net_ads_cldap.c index 2fdb6e58fd..a4464182bb 100644 --- a/source4/utils/net_ads_cldap.c +++ b/source4/utils/net_ads_cldap.c @@ -57,14 +57,14 @@ struct cldap_netlogon_reply { length encoded strings, terminated by either 1) a zero length string or 2) a 0xc0 byte with what appears to be a one byte flags immediately following. */ -static unsigned pull_netlogon_string(struct netlogon_string *ret,const char *d) +static uint_t pull_netlogon_string(struct netlogon_string *ret,const char *d) { char *p = (char *)d; ZERO_STRUCTP(ret); do { - unsigned len = (uint8_t)*p; + uint_t len = (uint8_t)*p; p++; if (len > 0 && len != 0xc0) { @@ -91,7 +91,7 @@ static unsigned pull_netlogon_string(struct netlogon_string *ret,const char *d) do a cldap netlogon query */ static int send_cldap_netlogon(int sock, const char *domain, - const char *hostname, unsigned ntversion) + const char *hostname, uint_t ntversion) { ASN1_DATA data; char ntver[4]; diff --git a/source4/utils/net_rpc.c b/source4/utils/net_rpc.c index 08782d8320..fb42493a8b 100644 --- a/source4/utils/net_rpc.c +++ b/source4/utils/net_rpc.c @@ -2131,7 +2131,7 @@ static int rpc_trustdom(int argc, const char **argv) * if the host is not explicitly specified * @return BOOL (true means rpc supported) */ -BOOL net_rpc_check(unsigned flags) +BOOL net_rpc_check(uint_t flags) { struct cli_state cli; BOOL ret = False; diff --git a/source4/utils/net_rpc_samsync.c b/source4/utils/net_rpc_samsync.c index 7e6f515c29..3a6b754f37 100644 --- a/source4/utils/net_rpc_samsync.c +++ b/source4/utils/net_rpc_samsync.c @@ -118,9 +118,9 @@ static void display_sam_entry(SAM_DELTA_HDR *hdr_delta, SAM_DELTA_CTR *delta) } -static void dump_database(struct cli_state *cli, unsigned db_type, DOM_CRED *ret_creds) +static void dump_database(struct cli_state *cli, uint_t db_type, DOM_CRED *ret_creds) { - unsigned sync_context = 0; + uint_t sync_context = 0; NTSTATUS result; int i; TALLOC_CTX *mem_ctx; @@ -635,10 +635,10 @@ fetch_sam_entry(SAM_DELTA_HDR *hdr_delta, SAM_DELTA_CTR *delta, } static void -fetch_database(struct cli_state *cli, unsigned db_type, DOM_CRED *ret_creds, +fetch_database(struct cli_state *cli, uint_t db_type, DOM_CRED *ret_creds, DOM_SID dom_sid) { - unsigned sync_context = 0; + uint_t sync_context = 0; NTSTATUS result; int i; TALLOC_CTX *mem_ctx; |