summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/bitmap.c4
-rw-r--r--source4/lib/crypto/crc32.c4
-rw-r--r--source4/lib/crypto/md4.c28
-rw-r--r--source4/lib/crypto/md5.c28
-rw-r--r--source4/lib/debug.c2
-rw-r--r--source4/lib/genrand.c4
-rw-r--r--source4/lib/interface.c2
-rw-r--r--source4/lib/messages.c2
-rw-r--r--source4/lib/registry/common/reg_interface.c2
-rw-r--r--source4/lib/registry/common/reg_objects.c2
-rw-r--r--source4/lib/registry/common/reg_util.c2
-rw-r--r--source4/lib/registry/common/registry.h2
-rw-r--r--source4/lib/registry/reg_backend_dir/reg_backend_dir.c2
-rw-r--r--source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c2
-rw-r--r--source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c4
-rw-r--r--source4/lib/system.c4
-rw-r--r--source4/lib/tdb/common/tdbutil.c70
-rw-r--r--source4/lib/time.c16
-rw-r--r--source4/lib/util.c12
-rw-r--r--source4/lib/util_sid.c8
-rw-r--r--source4/lib/util_sock.c2
21 files changed, 101 insertions, 101 deletions
diff --git a/source4/lib/bitmap.c b/source4/lib/bitmap.c
index 1023dd6541..63b093617b 100644
--- a/source4/lib/bitmap.c
+++ b/source4/lib/bitmap.c
@@ -35,7 +35,7 @@ struct bitmap *bitmap_allocate(int n)
if (!bm) return NULL;
bm->n = n;
- bm->b = (uint32 *)malloc(sizeof(bm->b[0])*(n+31)/32);
+ bm->b = (uint32_t *)malloc(sizeof(bm->b[0])*(n+31)/32);
if (!bm->b) {
SAFE_FREE(bm);
return NULL;
@@ -73,7 +73,7 @@ struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n)
if (!bm) return NULL;
bm->n = n;
- bm->b = (uint32 *)talloc(mem_ctx, sizeof(bm->b[0])*(n+31)/32);
+ bm->b = (uint32_t *)talloc(mem_ctx, sizeof(bm->b[0])*(n+31)/32);
if (!bm->b) {
return NULL;
}
diff --git a/source4/lib/crypto/crc32.c b/source4/lib/crypto/crc32.c
index da3aeaa901..f2d76332f9 100644
--- a/source4/lib/crypto/crc32.c
+++ b/source4/lib/crypto/crc32.c
@@ -55,9 +55,9 @@ static const unsigned long CRCTable[256] =
0xB40BBE37,0xC30C8EA1,0x5A05DF1B,0x2D02EF8D
};
-uint32 crc32_calc_buffer( const char *buffer, uint32 count)
+uint32_t crc32_calc_buffer( const char *buffer, uint32_t count)
{
- uint32 crc=0xffffffff, i;
+ uint32_t crc=0xffffffff, i;
for(i=0;i<count;i++)
crc = (crc>>8) ^ CRCTable[(buffer[i] ^ crc) & 0xff];
crc^=0xffffffff;
diff --git a/source4/lib/crypto/md4.c b/source4/lib/crypto/md4.c
index 417e87bd8e..cc8b9b6841 100644
--- a/source4/lib/crypto/md4.c
+++ b/source4/lib/crypto/md4.c
@@ -26,40 +26,40 @@
*/
struct mdfour_state {
- uint32 A, B, C, D;
+ uint32_t A, B, C, D;
};
-static uint32 F(uint32 X, uint32 Y, uint32 Z)
+static uint32_t F(uint32_t X, uint32_t Y, uint32_t Z)
{
return (X&Y) | ((~X)&Z);
}
-static uint32 G(uint32 X, uint32 Y, uint32 Z)
+static uint32_t G(uint32_t X, uint32_t Y, uint32_t Z)
{
return (X&Y) | (X&Z) | (Y&Z);
}
-static uint32 H(uint32 X, uint32 Y, uint32 Z)
+static uint32_t H(uint32_t X, uint32_t Y, uint32_t Z)
{
return X^Y^Z;
}
-static uint32 lshift(uint32 x, int s)
+static uint32_t lshift(uint32_t x, int s)
{
x &= 0xFFFFFFFF;
return ((x<<s)&0xFFFFFFFF) | (x>>(32-s));
}
#define ROUND1(a,b,c,d,k,s) a = lshift(a + F(b,c,d) + X[k], s)
-#define ROUND2(a,b,c,d,k,s) a = lshift(a + G(b,c,d) + X[k] + (uint32)0x5A827999,s)
-#define ROUND3(a,b,c,d,k,s) a = lshift(a + H(b,c,d) + X[k] + (uint32)0x6ED9EBA1,s)
+#define ROUND2(a,b,c,d,k,s) a = lshift(a + G(b,c,d) + X[k] + (uint32_t)0x5A827999,s)
+#define ROUND3(a,b,c,d,k,s) a = lshift(a + H(b,c,d) + X[k] + (uint32_t)0x6ED9EBA1,s)
/* this applies md4 to 64 byte chunks */
-static void mdfour64(struct mdfour_state *s, uint32 *M)
+static void mdfour64(struct mdfour_state *s, uint32_t *M)
{
int j;
- uint32 AA, BB, CC, DD;
- uint32 X[16];
+ uint32_t AA, BB, CC, DD;
+ uint32_t X[16];
for (j=0;j<16;j++)
X[j] = M[j];
@@ -107,7 +107,7 @@ static void mdfour64(struct mdfour_state *s, uint32 *M)
X[j] = 0;
}
-static void copy64(uint32 *M, const unsigned char *in)
+static void copy64(uint32_t *M, const unsigned char *in)
{
int i;
@@ -116,7 +116,7 @@ static void copy64(uint32 *M, const unsigned char *in)
(in[i*4+1]<<8) | (in[i*4+0]<<0);
}
-static void copy4(unsigned char *out, uint32 x)
+static void copy4(unsigned char *out, uint32_t x)
{
out[0] = x&0xFF;
out[1] = (x>>8)&0xFF;
@@ -128,8 +128,8 @@ static void copy4(unsigned char *out, uint32 x)
void mdfour(unsigned char *out, const unsigned char *in, int n)
{
unsigned char buf[128];
- uint32 M[16];
- uint32 b = n * 8;
+ uint32_t M[16];
+ uint32_t b = n * 8;
int i;
struct mdfour_state state;
diff --git a/source4/lib/crypto/md5.c b/source4/lib/crypto/md5.c
index 2121b17047..dbb3462bd4 100644
--- a/source4/lib/crypto/md5.c
+++ b/source4/lib/crypto/md5.c
@@ -22,18 +22,18 @@
#include "md5.h"
-static void MD5Transform(uint32 buf[4], uint32 const in[16]);
+static void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
/*
* Note: this code is harmless on little-endian machines.
*/
static void byteReverse(unsigned char *buf, unsigned longs)
{
- uint32 t;
+ uint32_t t;
do {
- t = (uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
+ t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
((unsigned) buf[1] << 8 | buf[0]);
- *(uint32 *) buf = t;
+ *(uint32_t *) buf = t;
buf += 4;
} while (--longs);
}
@@ -59,12 +59,12 @@ void MD5Init(struct MD5Context *ctx)
*/
void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
{
- register uint32 t;
+ register uint32_t t;
/* Update bitcount */
t = ctx->bits[0];
- if ((ctx->bits[0] = t + ((uint32) len << 3)) < t)
+ if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t)
ctx->bits[1]++; /* Carry from low to high */
ctx->bits[1] += len >> 29;
@@ -82,7 +82,7 @@ void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
}
memmove(p, buf, t);
byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
buf += t;
len -= t;
}
@@ -91,7 +91,7 @@ void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
while (len >= 64) {
memmove(ctx->in, buf, 64);
byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
buf += 64;
len -= 64;
}
@@ -126,7 +126,7 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
/* Two lots of padding: Pad the first block to 64 bytes */
memset(p, 0, count);
byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
/* Now fill the next block with 56 bytes */
memset(ctx->in, 0, 56);
@@ -137,10 +137,10 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
byteReverse(ctx->in, 14);
/* Append length in bits and transform */
- ((uint32 *) ctx->in)[14] = ctx->bits[0];
- ((uint32 *) ctx->in)[15] = ctx->bits[1];
+ ((uint32_t *) ctx->in)[14] = ctx->bits[0];
+ ((uint32_t *) ctx->in)[15] = ctx->bits[1];
- MD5Transform(ctx->buf, (uint32 *) ctx->in);
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
byteReverse((unsigned char *) ctx->buf, 4);
memmove(digest, ctx->buf, 16);
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
@@ -163,9 +163,9 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
* reflect the addition of 16 longwords of new data. MD5Update blocks
* the data and converts bytes into longwords for this routine.
*/
-static void MD5Transform(uint32 buf[4], uint32 const in[16])
+static void MD5Transform(uint32_t buf[4], uint32_t const in[16])
{
- register uint32 a, b, c, d;
+ register uint32_t a, b, c, d;
a = buf[0];
b = buf[1];
diff --git a/source4/lib/debug.c b/source4/lib/debug.c
index dbd3946c81..c9247f380f 100644
--- a/source4/lib/debug.c
+++ b/source4/lib/debug.c
@@ -141,7 +141,7 @@ void print_suspicious_usage(const char* from, const char* info)
}
}
-uint32 get_task_id(void)
+uint32_t get_task_id(void)
{
if (debug_handlers.ops.get_task_id) {
return debug_handlers.ops.get_task_id();
diff --git a/source4/lib/genrand.c b/source4/lib/genrand.c
index 9645dd7999..a5002969bd 100644
--- a/source4/lib/genrand.c
+++ b/source4/lib/genrand.c
@@ -23,7 +23,7 @@
#include "includes.h"
static unsigned char hash[258];
-static uint32 counter;
+static uint32_t counter;
static unsigned char *reseed_data;
static size_t reseed_data_size;
@@ -134,7 +134,7 @@ static void do_filehash(const char *fname, unsigned char *the_hash)
static int do_reseed(BOOL use_fd, int fd)
{
unsigned char seed_inbuf[40];
- uint32 v1, v2; struct timeval tval; pid_t mypid;
+ uint32_t v1, v2; struct timeval tval; pid_t mypid;
if (use_fd) {
if (fd != -1)
diff --git a/source4/lib/interface.c b/source4/lib/interface.c
index 2540c898ff..14abfbd09a 100644
--- a/source4/lib/interface.c
+++ b/source4/lib/interface.c
@@ -28,7 +28,7 @@ struct in_addr loopback_ip;
static struct interface *local_interfaces;
-#define ALLONES ((uint32)0xFFFFFFFF)
+#define ALLONES ((uint32_t)0xFFFFFFFF)
#define MKBCADDR(_IP, _NM) ((_IP & _NM) | (_NM ^ ALLONES))
#define MKNETADDR(_IP, _NM) (_IP & _NM)
diff --git a/source4/lib/messages.c b/source4/lib/messages.c
index cb26b356bd..9357b12f1f 100644
--- a/source4/lib/messages.c
+++ b/source4/lib/messages.c
@@ -474,7 +474,7 @@ void message_deregister(int msg_type)
struct msg_all {
int msg_type;
- uint32 msg_flag;
+ uint32_t msg_flag;
const void *buf;
size_t len;
BOOL duplicates;
diff --git a/source4/lib/registry/common/reg_interface.c b/source4/lib/registry/common/reg_interface.c
index 6acedb3591..6d305e61bf 100644
--- a/source4/lib/registry/common/reg_interface.c
+++ b/source4/lib/registry/common/reg_interface.c
@@ -508,7 +508,7 @@ WERROR reg_key_add_name_recursive(REG_KEY *parent, const char *path)
return WERR_OK;
}
-WERROR reg_key_add_name(REG_KEY *parent, const char *name, uint32 access_mask, SEC_DESC *desc, REG_KEY **newkey)
+WERROR reg_key_add_name(REG_KEY *parent, const char *name, uint32_t access_mask, SEC_DESC *desc, REG_KEY **newkey)
{
WERROR error;
diff --git a/source4/lib/registry/common/reg_objects.c b/source4/lib/registry/common/reg_objects.c
index 168ee946e8..be15108f4d 100644
--- a/source4/lib/registry/common/reg_objects.c
+++ b/source4/lib/registry/common/reg_objects.c
@@ -85,7 +85,7 @@ char *reg_val_name( REG_VAL *val )
/**********************************************************************
*********************************************************************/
-uint32 reg_val_type( REG_VAL *val )
+uint32_t reg_val_type( REG_VAL *val )
{
return val->data_type;
}
diff --git a/source4/lib/registry/common/reg_util.c b/source4/lib/registry/common/reg_util.c
index 82b8d06679..353963f78d 100644
--- a/source4/lib/registry/common/reg_util.c
+++ b/source4/lib/registry/common/reg_util.c
@@ -105,7 +105,7 @@ WERROR reg_key_get_subkey_val(REG_KEY *key, const char *subname, const char *val
return reg_key_get_value_by_name(k, valname, val);
}
-WERROR reg_key_set_subkey_val(REG_KEY *key, const char *subname, const char *valname, uint32 type, uint8 *data, int real_len)
+WERROR reg_key_set_subkey_val(REG_KEY *key, const char *subname, const char *valname, uint32_t type, uint8 *data, int real_len)
{
REG_KEY *k;
REG_VAL *v;
diff --git a/source4/lib/registry/common/registry.h b/source4/lib/registry/common/registry.h
index 5325a89086..caa0e284bf 100644
--- a/source4/lib/registry/common/registry.h
+++ b/source4/lib/registry/common/registry.h
@@ -107,7 +107,7 @@ struct registry_ops {
WERROR (*request_value_change_notify) (REG_VAL *, value_notification_function);
/* Key management */
- WERROR (*add_key)(REG_KEY *, const char *name, uint32 access_mask, SEC_DESC *, REG_KEY **);
+ WERROR (*add_key)(REG_KEY *, const char *name, uint32_t access_mask, SEC_DESC *, REG_KEY **);
WERROR (*del_key)(REG_KEY *);
/* Value management */
diff --git a/source4/lib/registry/reg_backend_dir/reg_backend_dir.c b/source4/lib/registry/reg_backend_dir/reg_backend_dir.c
index c7ed95d80f..cac54f8437 100644
--- a/source4/lib/registry/reg_backend_dir/reg_backend_dir.c
+++ b/source4/lib/registry/reg_backend_dir/reg_backend_dir.c
@@ -21,7 +21,7 @@
#include "includes.h"
#include "lib/registry/common/registry.h"
-static WERROR reg_dir_add_key(REG_KEY *parent, const char *name, uint32 access_mask, SEC_DESC *desc, REG_KEY **result)
+static WERROR reg_dir_add_key(REG_KEY *parent, const char *name, uint32_t access_mask, SEC_DESC *desc, REG_KEY **result)
{
char *path;
int ret;
diff --git a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
index 415f764f61..627b5a8f13 100644
--- a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
+++ b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
@@ -501,7 +501,7 @@ static DWORD str_to_dword(const char *a) {
/*
* Create an ACE
*/
-static BOOL nt_create_ace(SEC_ACE *ace, int type, int flags, uint32 perms, const char *sid)
+static BOOL nt_create_ace(SEC_ACE *ace, int type, int flags, uint32_t perms, const char *sid)
{
DOM_SID s;
SEC_ACCESS access;
diff --git a/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c b/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c
index d863568c17..28e2094bed 100644
--- a/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c
+++ b/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c
@@ -197,7 +197,7 @@ static WERROR rpc_get_value_by_index(REG_KEY *parent, int n, REG_VAL **value)
struct winreg_EnumValueName vn;
NTSTATUS status;
struct rpc_key_data *mykeydata;
- uint32 type = 0x0, requested_len = 0, returned_len = 0;
+ uint32_t type = 0x0, requested_len = 0, returned_len = 0;
WERROR error;
error = rpc_key_put_rpc_data(parent, &mykeydata);
@@ -283,7 +283,7 @@ static WERROR rpc_get_subkey_by_index(REG_KEY *parent, int n, REG_KEY **subkey)
return r.out.result;
}
-static WERROR rpc_add_key(REG_KEY *parent, const char *name, uint32 access_mask, SEC_DESC *sec, REG_KEY **key)
+static WERROR rpc_add_key(REG_KEY *parent, const char *name, uint32_t access_mask, SEC_DESC *sec, REG_KEY **key)
{
struct rpc_key_data *mykeydata;
WERROR error;
diff --git a/source4/lib/system.c b/source4/lib/system.c
index 8c9627eb26..2641a180ef 100644
--- a/source4/lib/system.c
+++ b/source4/lib/system.c
@@ -410,7 +410,7 @@ struct hostent *sys_gethostbyname(const char *name)
/**************************************************************************
Try and abstract process capabilities (for systems that have them).
****************************************************************************/
-static BOOL set_process_capability( uint32 cap_flag, BOOL enable )
+static BOOL set_process_capability( uint32_t cap_flag, BOOL enable )
{
if(cap_flag == KERNEL_OPLOCK_CAPABILITY) {
cap_t cap = cap_get_proc();
@@ -444,7 +444,7 @@ static BOOL set_process_capability( uint32 cap_flag, BOOL enable )
Try and abstract inherited process capabilities (for systems that have them).
****************************************************************************/
-static BOOL set_inherited_process_capability( uint32 cap_flag, BOOL enable )
+static BOOL set_inherited_process_capability( uint32_t cap_flag, BOOL enable )
{
if(cap_flag == KERNEL_OPLOCK_CAPABILITY) {
cap_t cap = cap_get_proc();
diff --git a/source4/lib/tdb/common/tdbutil.c b/source4/lib/tdb/common/tdbutil.c
index 62841ddfc2..b8babf48aa 100644
--- a/source4/lib/tdb/common/tdbutil.c
+++ b/source4/lib/tdb/common/tdbutil.c
@@ -180,15 +180,15 @@ void tdb_read_unlock_bystring(TDB_CONTEXT *tdb, const char *keyval)
/****************************************************************************
- Fetch a int32 value by a arbitrary blob key, return -1 if not found.
- Output is int32 in native byte order.
+ Fetch a int32_t value by a arbitrary blob key, return -1 if not found.
+ Output is int32_t in native byte order.
****************************************************************************/
-int32 tdb_fetch_int32_byblob(TDB_CONTEXT *tdb, const char *keyval, size_t len)
+int32_t tdb_fetch_int32_byblob(TDB_CONTEXT *tdb, const char *keyval, size_t len)
{
TDB_DATA key = make_tdb_data(keyval, len);
TDB_DATA data;
- int32 ret;
+ int32_t ret;
data = tdb_fetch(tdb, key);
if (!data.dptr || data.dsize != sizeof(int32)) {
@@ -202,25 +202,25 @@ int32 tdb_fetch_int32_byblob(TDB_CONTEXT *tdb, const char *keyval, size_t len)
}
/****************************************************************************
- Fetch a int32 value by string key, return -1 if not found.
- Output is int32 in native byte order.
+ Fetch a int32_t value by string key, return -1 if not found.
+ Output is int32_t in native byte order.
****************************************************************************/
-int32 tdb_fetch_int32(TDB_CONTEXT *tdb, const char *keystr)
+int32_t tdb_fetch_int32(TDB_CONTEXT *tdb, const char *keystr)
{
return tdb_fetch_int32_byblob(tdb, keystr, strlen(keystr) + 1);
}
/****************************************************************************
- Store a int32 value by an arbitary blob key, return 0 on success, -1 on failure.
- Input is int32 in native byte order. Output in tdb is in little-endian.
+ Store a int32_t value by an arbitary blob key, return 0 on success, -1 on failure.
+ Input is int32_t in native byte order. Output in tdb is in little-endian.
****************************************************************************/
-int tdb_store_int32_byblob(TDB_CONTEXT *tdb, const char *keystr, size_t len, int32 v)
+int tdb_store_int32_byblob(TDB_CONTEXT *tdb, const char *keystr, size_t len, int32_t v)
{
TDB_DATA key = make_tdb_data(keystr, len);
TDB_DATA data;
- int32 v_store;
+ int32_t v_store;
SIVAL(&v_store,0,v);
data.dptr = (void *)&v_store;
@@ -230,21 +230,21 @@ int tdb_store_int32_byblob(TDB_CONTEXT *tdb, const char *keystr, size_t len, int
}
/****************************************************************************
- Store a int32 value by string key, return 0 on success, -1 on failure.
- Input is int32 in native byte order. Output in tdb is in little-endian.
+ Store a int32_t value by string key, return 0 on success, -1 on failure.
+ Input is int32_t in native byte order. Output in tdb is in little-endian.
****************************************************************************/
-int tdb_store_int32(TDB_CONTEXT *tdb, const char *keystr, int32 v)
+int tdb_store_int32(TDB_CONTEXT *tdb, const char *keystr, int32_t v)
{
return tdb_store_int32_byblob(tdb, keystr, strlen(keystr) + 1, v);
}
/****************************************************************************
- Fetch a uint32 value by a arbitrary blob key, return -1 if not found.
- Output is uint32 in native byte order.
+ Fetch a uint32_t value by a arbitrary blob key, return -1 if not found.
+ Output is uint32_t in native byte order.
****************************************************************************/
-BOOL tdb_fetch_uint32_byblob(TDB_CONTEXT *tdb, const char *keyval, size_t len, uint32 *value)
+BOOL tdb_fetch_uint32_byblob(TDB_CONTEXT *tdb, const char *keyval, size_t len, uint32_t *value)
{
TDB_DATA key = make_tdb_data(keyval, len);
TDB_DATA data;
@@ -261,25 +261,25 @@ BOOL tdb_fetch_uint32_byblob(TDB_CONTEXT *tdb, const char *keyval, size_t len, u
}
/****************************************************************************
- Fetch a uint32 value by string key, return -1 if not found.
- Output is uint32 in native byte order.
+ Fetch a uint32_t value by string key, return -1 if not found.
+ Output is uint32_t in native byte order.
****************************************************************************/
-BOOL tdb_fetch_uint32(TDB_CONTEXT *tdb, const char *keystr, uint32 *value)
+BOOL tdb_fetch_uint32(TDB_CONTEXT *tdb, const char *keystr, uint32_t *value)
{
return tdb_fetch_uint32_byblob(tdb, keystr, strlen(keystr) + 1, value);
}
/****************************************************************************
- Store a uint32 value by an arbitary blob key, return 0 on success, -1 on failure.
- Input is uint32 in native byte order. Output in tdb is in little-endian.
+ Store a uint32_t value by an arbitary blob key, return 0 on success, -1 on failure.
+ Input is uint32_t in native byte order. Output in tdb is in little-endian.
****************************************************************************/
-BOOL tdb_store_uint32_byblob(TDB_CONTEXT *tdb, const char *keystr, size_t len, uint32 value)
+BOOL tdb_store_uint32_byblob(TDB_CONTEXT *tdb, const char *keystr, size_t len, uint32_t value)
{
TDB_DATA key = make_tdb_data(keystr, len);
TDB_DATA data;
- uint32 v_store;
+ uint32_t v_store;
BOOL ret = True;
SIVAL(&v_store, 0, value);
@@ -293,11 +293,11 @@ BOOL tdb_store_uint32_byblob(TDB_CONTEXT *tdb, const char *keystr, size_t len, u
}
/****************************************************************************
- Store a uint32 value by string key, return 0 on success, -1 on failure.
- Input is uint32 in native byte order. Output in tdb is in little-endian.
+ Store a uint32_t value by string key, return 0 on success, -1 on failure.
+ Input is uint32_t in native byte order. Output in tdb is in little-endian.
****************************************************************************/
-BOOL tdb_store_uint32(TDB_CONTEXT *tdb, const char *keystr, uint32 value)
+BOOL tdb_store_uint32(TDB_CONTEXT *tdb, const char *keystr, uint32_t value)
{
return tdb_store_uint32_byblob(tdb, keystr, strlen(keystr) + 1, value);
}
@@ -340,10 +340,10 @@ int tdb_delete_bystring(TDB_CONTEXT *tdb, const char *keystr)
Atomic integer change. Returns old value. To create, set initial value in *oldval.
****************************************************************************/
-int32 tdb_change_int32_atomic(TDB_CONTEXT *tdb, const char *keystr, int32 *oldval, int32 change_val)
+int32_t tdb_change_int32_atomic(TDB_CONTEXT *tdb, const char *keystr, int32_t *oldval, int32_t change_val)
{
- int32 val;
- int32 ret = -1;
+ int32_t val;
+ int32_t ret = -1;
if (tdb_lock_bystring(tdb, keystr,0) == -1)
return -1;
@@ -381,9 +381,9 @@ int32 tdb_change_int32_atomic(TDB_CONTEXT *tdb, const char *keystr, int32 *oldva
Atomic unsigned integer change. Returns old value. To create, set initial value in *oldval.
****************************************************************************/
-BOOL tdb_change_uint32_atomic(TDB_CONTEXT *tdb, const char *keystr, uint32 *oldval, uint32 change_val)
+BOOL tdb_change_uint32_atomic(TDB_CONTEXT *tdb, const char *keystr, uint32_t *oldval, uint32_t change_val)
{
- uint32 val;
+ uint32_t val;
BOOL ret = False;
if (tdb_lock_bystring(tdb, keystr,0) == -1)
@@ -429,7 +429,7 @@ size_t tdb_pack(TDB_CONTEXT *tdb, char *buf, int bufsize, const char *fmt, ...)
va_list ap;
uint8 bt;
uint16 w;
- uint32 d;
+ uint32_t d;
int i;
void *p;
int len;
@@ -523,7 +523,7 @@ int tdb_unpack(TDB_CONTEXT *tdb, char *buf, int bufsize, const char *fmt, ...)
va_list ap;
uint8 *bt;
uint16 *w;
- uint32 *d;
+ uint32_t *d;
int len;
int *i;
void **p;
@@ -553,7 +553,7 @@ int tdb_unpack(TDB_CONTEXT *tdb, char *buf, int bufsize, const char *fmt, ...)
break;
case 'd':
len = 4;
- d = va_arg(ap, uint32 *);
+ d = va_arg(ap, uint32_t *);
if (bufsize < len)
goto no_space;
*d = IVAL(buf, 0);
diff --git a/source4/lib/time.c b/source4/lib/time.c
index e3811c884e..99738d5a4a 100644
--- a/source4/lib/time.c
+++ b/source4/lib/time.c
@@ -164,10 +164,10 @@ static uint16 make_dos_time1(struct tm *t)
create a 32 bit dos packed date/time from some parameters
This takes a GMT time and returns a packed localtime structure
********************************************************************/
-static uint32 make_dos_date(time_t unixdate, int zone_offset)
+static uint32_t make_dos_date(time_t unixdate, int zone_offset)
{
struct tm *t;
- uint32 ret=0;
+ uint32_t ret=0;
if (unixdate == 0) {
return 0;
@@ -192,7 +192,7 @@ This takes GMT time and puts local time in the buffer
********************************************************************/
void push_dos_date(char *buf, int offset, time_t unixdate, int zone_offset)
{
- uint32 x = make_dos_date(unixdate, zone_offset);
+ uint32_t x = make_dos_date(unixdate, zone_offset);
SIVAL(buf,offset,x);
}
@@ -202,7 +202,7 @@ This takes GMT time and puts local time in the buffer
********************************************************************/
void push_dos_date2(char *buf,int offset,time_t unixdate, int zone_offset)
{
- uint32 x;
+ uint32_t x;
x = make_dos_date(unixdate, zone_offset);
x = ((x&0xFFFF)<<16) | ((x&0xFFFF0000)>>16);
SIVAL(buf,offset,x);
@@ -224,9 +224,9 @@ void push_dos_date3(char *buf,int offset,time_t unixdate, int zone_offset)
/*******************************************************************
interpret a 32 bit dos packed date/time to some parameters
********************************************************************/
-static void interpret_dos_date(uint32 date,int *year,int *month,int *day,int *hour,int *minute,int *second)
+static void interpret_dos_date(uint32_t date,int *year,int *month,int *day,int *hour,int *minute,int *second)
{
- uint32 p0,p1,p2,p3;
+ uint32_t p0,p1,p2,p3;
p0=date&0xFF; p1=((date&0xFF00)>>8)&0xFF;
p2=((date&0xFF0000)>>16)&0xFF; p3=((date&0xFF000000)>>24)&0xFF;
@@ -245,7 +245,7 @@ static void interpret_dos_date(uint32 date,int *year,int *month,int *day,int *ho
********************************************************************/
time_t pull_dos_date(const uint8 *date_ptr, int zone_offset)
{
- uint32 dos_date=0;
+ uint32_t dos_date=0;
struct tm t;
time_t ret;
@@ -269,7 +269,7 @@ like make_unix_date() but the words are reversed
********************************************************************/
time_t pull_dos_date2(const uint8 *date_ptr, int zone_offset)
{
- uint32 x,x2;
+ uint32_t x,x2;
x = IVAL(date_ptr,0);
x2 = ((x&0xFFFF)<<16) | ((x&0xFFFF0000)>>16);
diff --git a/source4/lib/util.c b/source4/lib/util.c
index 0cb5258a64..a4be8f8bf8 100644
--- a/source4/lib/util.c
+++ b/source4/lib/util.c
@@ -426,10 +426,10 @@ BOOL is_ipaddress(const char *str)
Interpret an internet address or name into an IP address in 4 byte form.
****************************************************************************/
-uint32 interpret_addr(const char *str)
+uint32_t interpret_addr(const char *str)
{
struct hostent *hp;
- uint32 res;
+ uint32_t res;
if (strcmp(str,"0.0.0.0") == 0)
return(0);
@@ -454,7 +454,7 @@ uint32 interpret_addr(const char *str)
putip((char *)&res,(char *)hp->h_addr);
}
- if (res == (uint32)-1)
+ if (res == (uint32_t)-1)
return(0);
return(res);
@@ -467,7 +467,7 @@ uint32 interpret_addr(const char *str)
struct in_addr *interpret_addr2(TALLOC_CTX *mem_ctx, const char *str)
{
struct in_addr *ret;
- uint32 a = interpret_addr(str);
+ uint32_t a = interpret_addr(str);
ret = talloc(mem_ctx, sizeof(struct in_addr));
if (!ret) return NULL;
@@ -481,7 +481,7 @@ struct in_addr *interpret_addr2(TALLOC_CTX *mem_ctx, const char *str)
BOOL is_zero_ip(struct in_addr ip)
{
- uint32 a;
+ uint32_t a;
putip((char *)&a,(char *)&ip);
return(a == 0);
}
@@ -503,7 +503,7 @@ void zero_ip(struct in_addr *ip)
BOOL same_net(struct in_addr ip1,struct in_addr ip2,struct in_addr mask)
{
- uint32 net1,net2,nmask;
+ uint32_t net1,net2,nmask;
nmask = ntohl(mask.s_addr);
net1 = ntohl(ip1.s_addr);
diff --git a/source4/lib/util_sid.c b/source4/lib/util_sid.c
index 56f5abd611..2a70625317 100644
--- a/source4/lib/util_sid.c
+++ b/source4/lib/util_sid.c
@@ -78,7 +78,7 @@ static const struct {
{SID_NAME_USE_NONE, NULL}
};
-const char *sid_type_lookup(uint32 sid_type)
+const char *sid_type_lookup(uint32_t sid_type)
{
int i = 0;
@@ -147,7 +147,7 @@ void generate_wellknown_sids(void)
Return the last rid from the end of a sid
*****************************************************************/
-BOOL sid_peek_rid(const struct dom_sid *sid, uint32 *rid)
+BOOL sid_peek_rid(const struct dom_sid *sid, uint32_t *rid)
{
if (!sid || !rid)
return False;
@@ -164,7 +164,7 @@ BOOL sid_peek_rid(const struct dom_sid *sid, uint32 *rid)
and check the sid against the exp_dom_sid
*****************************************************************/
-BOOL sid_peek_check_rid(const struct dom_sid *exp_dom_sid, const struct dom_sid *sid, uint32 *rid)
+BOOL sid_peek_check_rid(const struct dom_sid *exp_dom_sid, const struct dom_sid *sid, uint32_t *rid)
{
if (!exp_dom_sid || !sid || !rid)
return False;
@@ -285,7 +285,7 @@ size_t sid_size(const struct dom_sid *sid)
if (sid == NULL)
return 0;
- return sid->num_auths * sizeof(uint32) + 8;
+ return sid->num_auths * sizeof(uint32_t) + 8;
}
/*****************************************************************
diff --git a/source4/lib/util_sock.c b/source4/lib/util_sock.c
index 57d3715cfc..999aeae744 100644
--- a/source4/lib/util_sock.c
+++ b/source4/lib/util_sock.c
@@ -250,7 +250,7 @@ BOOL send_nbt_keepalive(int sock_fd)
/****************************************************************************
Open a socket of the specified type, port, and address for incoming data.
****************************************************************************/
-int open_socket_in( int type, int port, int dlevel, uint32 socket_addr, BOOL rebind )
+int open_socket_in( int type, int port, int dlevel, uint32_t socket_addr, BOOL rebind )
{
struct sockaddr_in sock;
int res;