r962: convert 'unsigned' and 'unsigned int' to uint_t
authorStefan Metzmacher <metze@samba.org>
Tue, 1 Jun 2004 10:12:52 +0000 (10:12 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:56:23 +0000 (12:56 -0500)
metze
(This used to be commit 57151e80eb1090281401930c8fe25b20a8cf3a38)

52 files changed:
source4/client/smbmnt.c
source4/client/smbmount.c
source4/include/ads.h
source4/include/byteorder.h
source4/include/cli_context.h
source4/include/md5.h
source4/include/smb.h
source4/lib/bitmap.c
source4/lib/crypto/md5.c
source4/lib/iconv.c
source4/lib/interfaces.c
source4/lib/pidfile.c
source4/lib/talloc.c
source4/lib/tdb/common/spinlock.c
source4/lib/tdb/common/tdb.c
source4/lib/time.c
source4/lib/util.c
source4/lib/wins_srv.c
source4/libads/disp_sec.c
source4/libads/ldap.c
source4/libads/sasl.c
source4/libcli/auth/ntlmssp_parse.c
source4/libcli/clifile.c
source4/libcli/namequery.c
source4/libcli/raw/clikrb5.c
source4/libcli/raw/rawrequest.c
source4/libcli/util/asn1.c
source4/libcli/util/smbdes.c
source4/librpc/rpc/dcerpc.c
source4/librpc/rpc/dcerpc.h
source4/librpc/rpc/dcerpc_auth.c
source4/librpc/rpc/dcerpc_ntlm.c
source4/librpc/rpc/dcerpc_schannel.c
source4/librpc/rpc/dcerpc_util.c
source4/ntvfs/ntvfs_generic.c
source4/smb_server/conn.c
source4/smb_server/request.c
source4/smbd/server.c
source4/torture/basic/denytest.c
source4/torture/basic/mangle_test.c
source4/torture/locktest.c
source4/torture/locktest2.c
source4/torture/nbench/nbio.c
source4/torture/raw/qfileinfo.c
source4/torture/raw/read.c
source4/torture/raw/write.c
source4/torture/rpc/lsa.c
source4/torture/torture.c
source4/utils/net.c
source4/utils/net_ads_cldap.c
source4/utils/net_rpc.c
source4/utils/net_rpc_samsync.c

index 5c0d7ea1b3251352c9adf59d133f5bc6344b7ecc..0d619a88fe5e4d3d09d43cb890463a5df69435c5 100644 (file)
@@ -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;
 
index 6373e556b565b6ee2ad30d5310ca37a9562da94a..fe8f2136397e14648c364b22c068d843a683a484 100644 (file)
@@ -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;
index 410395a71ba9a170868e6ef80da6a669f87333ad..36f898b2b06bb32f6e8b9f7c33035d8e374aea6b 100644 (file)
@@ -44,7 +44,7 @@ typedef struct {
                char *password;
                char *user_name;
                char *kdc_server;
-               unsigned flags;
+               uint_t flags;
                int time_offset;
        } auth;
 
index b3caa310a4cb6b710d2800d3e5358ab733b24ad5..bf68ee7df7a4f0df6470b6aed5dd4c56f7cb9624 100644 (file)
@@ -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))
index b0e178e1d0a6347517f9270c3f968bc32d9ce1a2..24dcfe72355b3bc32351f623dac3f711f9bfb6df 100644 (file)
@@ -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
index 57c2f99caa90d4985a557dd7c093886a8e68c78d..cd23979f8af55a49673d5acb4bc5fbffa43f542f 100644 (file)
@@ -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);
 
 /*
index 55dd430d0500562baa21a563e04f92310ec973e9..f0ddab65af93215b98ff91b809dbed8573108243 100644 (file)
@@ -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;
index 2e67fb5439eb90ea34d51a157c26bf948ab6f38c..5a8325d4badf8629a815236068c58ae3c21c80a4 100644 (file)
@@ -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;
 
index 1c53a0a1527e19b5fba89bc473ccbdcc67ce9cd6..07028e90439c8675be79f0a78eeae2f5ce430319 100644 (file)
@@ -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;
 
index 65fa45248ffce7e5b4d6f86222339f37b4784dd1..f75621af099155a5403f7f9e3b5082e9a405794c 100644 (file)
@@ -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 */
index 96f4b4cd94fefdf3169a72b2bd076dc018207ebd..89ed144eec1865f43e46e4b356f3087116a6e188 100644 (file)
@@ -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;
 
index 7126482256add0d351ac7e2185174ba6857173df..989f19b32374df1d746d97b59602ed2cf1f2ab49 100644 (file)
@@ -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);
index 92e0d52d2d91984309388e25bb7b88344c2b3c98..f3cdd75231a30befcc78a7ccbf8b8a9852ad12f5 100644 (file)
@@ -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) {
index 0c8991c1e0e9b23a6172e987c94876a355d37de7..ee3eff1b317c5f62224ccbef0d5bf11a56fbae47 100644 (file)
@@ -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;
index b7b9631444dc92eda5bda702b1a425c7c1f130af..d4c0928217d70dd5e64b872e7d7e1c887acc3eee 100644 (file)
@@ -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;
 }
index 5fd8aa3081ce18a12f902df9c70220d4fa729400..dbbfab24b5bf94b5c04ebe2d358fe9dfde6d113b 100644 (file)
@@ -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;
 }
index e8ad79af0ca61bf8e6dd2e1888ce866805a5b127..16f5e7a88870e18d84f6ce00afbfb48ac16a1e0b 100644 (file)
@@ -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;
index 30e81b08abaf2fbfc36dcf27aecc226d755d23e2..71368658b0cc19bab50c2bb8bf52877e5b715368 100644 (file)
@@ -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;
index 0d8954a9784277afa6e8f70cebf77ce03d394250..8cdef5e16884503a817f08484899cb28749b4907 100644 (file)
@@ -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);
                                }       
                        }
index 6a2dcbaa87356862ea1e60f35d7d6017733d5dda..0abdb3f1064f3f9acbab12b010569965bfcc23be 100644 (file)
@@ -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);
index 760441436599982b514c4f4e2b68809ca90ca6a1..ce787400f7b4081947911b54e1ed33da63ca2f28 100644 (file)
@@ -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;
index aa4fc6b98f7b89f2b52eb656fdae90cd0987db46..251effd7e1fc0a41a5067fb78013914f11188f9d 100644 (file)
@@ -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)
index 7f4384a2224df7cd4c582c7bee5dcc69b50eb8ee..6f1c98555baaa4ba89d45472eeba77c591d963a0 100644 (file)
@@ -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;
 
index 18d1ce3e934d2c73bb0567965b36a0b39b9c0450..0094cc26bbd90075b4b1291ccbe7f0edb434ab22 100644 (file)
@@ -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;
 }
 
 
index 1d9c02f7f4e50a21d6045f9b8ce32283e5b33849..ba3e9ccd17ddb8426fef6dbca013cecdbb046d0d 100644 (file)
@@ -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);
        }
index fd2d85cc656b7494832436f80db3b940186bdc5c..c31f07505fd935443b7bcf1f7c151e775060b915 100644 (file)
@@ -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;
index b44c62bc500f57556ed1956667af1e28c5f66e69..ddefe0baa6fa018226a395d39526a15d81674762 100644 (file)
@@ -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);
index 90724cb778b1eda406dd462412480bb3cb2b1881..967d0ffb8294517bbd45cdb76082fa6c147641fd 100644 (file)
@@ -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);
 }
index f0a9649a444b2a08bc3d27e33f96fc7bf0874a86..5d317794e1867105f7d3072736d5150a47d8a662 100644 (file)
@@ -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;
index 9406b9e20acd3089c5fed254711ea53525d23727..74bdaf878e68a83956f279c45698af01e639bf85 100644 (file)
@@ -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;
index 2b01ad2d4e9e452864d9b9cad3dae0785c07fe30..3faf0603ce1f59c8d4deb45dac6d1fcdf687507d 100644 (file)
@@ -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;
index e2bea2f18ca5361bc39b183c5c468a2600a2e545..db707be1b5dc3c4b0d74b0789716e9af2a103ade 100644 (file)
@@ -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)
index dd05343b41652653b1112864c7aa5c2631ed69d1..1874de726bf71000fb1b65133cdbfafa4e4f234b 100644 (file)
@@ -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)
index 5022449182448b3b99e2cefafe7b54c6e1b85e9f..d8da1327d500688f646654fa074afa8f8f0912fc 100644 (file)
@@ -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;
index 116b71647470889832ada4662a3a0c923035c0c8..0781558e8e314b0339b40e7a43532b28cfbd50f2 100644 (file)
@@ -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) {
index d0b60fe29df30eba9be9da78c2d5aa7ad10a57b0..490dde979c1b1897ff30d7f70b9807a8f0d23e1c 100644 (file)
@@ -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;
index 5b1335a6516e0304b703441b0f79e61217d16b25..b1e3b5f66e1df37ce450cac7e107a4a71067331a 100644 (file)
@@ -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;
index 1dc8082b309c3b0f5a8b237f8cb8df3615e1f7cf..a753a2d6dbeb953714d9c9b838557e0013e32730 100644 (file)
@@ -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);
        }
index 0e4f5251da4686275843d5245c32a246e36dd7ba..102b44fbd345adfef50d1c7309e602033a1633d4 100644 (file)
@@ -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);
index 94dac45b9d17e6a9a9601a56c69f8b43cb536268..4859ee7c4cf7e96335599247c4510e03aadaa5cb 100644 (file)
@@ -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;
 
index 99dcf9fd47b61d26741625276bba7720de9f0eb3..10238c75a544ec588bf4516d53adbda8d413fd8a 100644 (file)
@@ -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;
index ac48da58b98565d22ce55be972e824fbfceb10fd..40227d29979b40b162c1fe1a68d9ae93d8a62ab5 100644 (file)
@@ -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;
index 9f8c6e6c7327947837c4074da9b69d16ccb97141..a7a82027a393cab7b548b25a25f401295fed1cb4 100644 (file)
@@ -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;
index 26c94b6a09be387e05871ee8e019e6478ada9e7b..07fb81e6d97ed6b5dd0fc0da0685fddca9151fea 100644 (file)
@@ -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 .... */
index 5e1d055e22e7771c5b502e66a7a96fb58b606ec9..5fba3f1b31ba182ff08d94e4ff5461baace3b7b7 100644 (file)
@@ -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);
 
index 18c992b8c633435ab5b80aaa010dc91fc828564f..8873ca5ae82e710f012bf248de4e1650e2d9a4d2 100644 (file)
@@ -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);
index 7dfa2494b7c0ce675811fdcd2bf464f4ae1cd4e7..e3c603da17caea89dee8980094d2f4c3f8cc9c8e 100644 (file)
@@ -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);
 
index aadc07781a19002113c10c977abc08c4eba3b3cc..fbe0fd50975a1e84dd41cd399901746725d1b44b 100644 (file)
@@ -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},
index ce874d2efda9442a917c2909f7a353a769aa295c..5ccc50242fbb246a01aecdd7f6ce6f528b20c9ff 100644 (file)
@@ -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;
index 2fdb6e58fda84c7acd77dab1c412e900c667ec2e..a4464182bbc84f34979218c732cee309f94ace53 100644 (file)
@@ -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];
index 08782d8320b4814c47e24e9d372fa3c891e6b6c1..fb42493a8bdff82a7a7e0da39300d114c1fbb563 100644 (file)
@@ -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;
index 7e6f515c29c12792a6c34253acb79f019e1aeaea..3a6b754f3719f87f84395dd4f346baccf238feb4 100644 (file)
@@ -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;