1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-30 06:50:24 +03:00

Convert all uint32/16/8 to _t in source3/lib.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Richard Sharpe 2015-05-09 16:33:10 -07:00 committed by Jeremy Allison
parent c833baa24c
commit dffe228283
16 changed files with 60 additions and 60 deletions

View File

@ -699,7 +699,7 @@ static NTSTATUS ctdb_handle_message(struct messaging_context *msg_ctx,
static void ctdbd_socket_handler(struct tevent_context *event_ctx,
struct tevent_fd *event,
uint16 flags,
uint16_t flags,
void *private_data)
{
struct ctdbd_connection *conn = talloc_get_type_abort(
@ -887,7 +887,7 @@ static NTSTATUS ctdbd_control(struct ctdbd_connection *conn,
reply = (struct ctdb_reply_control *)hdr;
if (outdata) {
if (!(outdata->dptr = (uint8 *)talloc_memdup(
if (!(outdata->dptr = (uint8_t *)talloc_memdup(
mem_ctx, reply->data, reply->datalen))) {
TALLOC_FREE(reply);
return NT_STATUS_NO_MEMORY;

View File

@ -212,7 +212,7 @@ bool run_events_poll(struct tevent_context *ev, int pollrtn,
for (fde = ev->fd_events; fde; fde = fde->next) {
struct pollfd *pfd;
uint16 flags = 0;
uint16_t flags = 0;
if ((fde->flags & (TEVENT_FD_READ|TEVENT_FD_WRITE)) == 0) {
continue;

View File

@ -59,7 +59,7 @@
struct messaging_callback {
struct messaging_callback *prev, *next;
uint32 msg_type;
uint32_t msg_type;
void (*fn)(struct messaging_context *msg, void *private_data,
uint32_t msg_type,
struct server_id server_id, DATA_BLOB *data);
@ -112,7 +112,7 @@ static void ping_message(struct messaging_context *msg_ctx,
struct msg_all {
struct messaging_context *msg_ctx;
int msg_type;
uint32 msg_flag;
uint32_t msg_flag;
const void *buf;
size_t len;
int n_sent;
@ -243,7 +243,7 @@ static void messaging_recv_cb(const uint8_t *msg, size_t msg_len,
rec = (struct messaging_rec) {
.msg_version = MESSAGE_VERSION,
.buf.data = discard_const_p(uint8, msg) + sizeof(hdr),
.buf.data = discard_const_p(uint8_t, msg) + sizeof(hdr),
.buf.length = msg_len - sizeof(hdr),
.num_fds = num_fds,
.fds = fds64,

View File

@ -286,7 +286,7 @@ static void get_credentials_file(struct user_auth_info *auth_info,
{
XFILE *auth;
fstring buf;
uint16 len = 0;
uint16_t len = 0;
char *ptr, *val, *param;
if ((auth=x_fopen(file, O_RDONLY, 0)) == NULL)

View File

@ -87,7 +87,7 @@
int sys_get_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp)
{
int ret = -1;
uint32 qflags = 0;
uint32_t qflags = 0;
struct dqblk D;
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
@ -181,8 +181,8 @@ int sys_get_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
int sys_set_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp)
{
int ret = -1;
uint32 qflags = 0;
uint32 oldqflags = 0;
uint32_t qflags = 0;
uint32_t oldqflags = 0;
struct dqblk D;
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;

View File

@ -39,7 +39,7 @@
static int sys_get_linux_v1_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp)
{
int ret = -1;
uint32 qflags = 0;
uint32_t qflags = 0;
struct v1_kern_dqblk D;
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
@ -107,8 +107,8 @@ static int sys_get_linux_v1_quota(const char *path, const char *bdev, enum SMB_Q
static int sys_set_linux_v1_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp)
{
int ret = -1;
uint32 qflags = 0;
uint32 oldqflags = 0;
uint32_t qflags = 0;
uint32_t oldqflags = 0;
struct v1_kern_dqblk D;
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
@ -173,7 +173,7 @@ static int sys_set_linux_v1_quota(const char *path, const char *bdev, enum SMB_Q
static int sys_get_linux_v2_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp)
{
int ret = -1;
uint32 qflags = 0;
uint32_t qflags = 0;
struct v2_kern_dqblk D;
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
@ -241,8 +241,8 @@ static int sys_get_linux_v2_quota(const char *path, const char *bdev, enum SMB_Q
static int sys_set_linux_v2_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp)
{
int ret = -1;
uint32 qflags = 0;
uint32 oldqflags = 0;
uint32_t qflags = 0;
uint32_t oldqflags = 0;
struct v2_kern_dqblk D;
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
@ -307,7 +307,7 @@ static int sys_set_linux_v2_quota(const char *path, const char *bdev, enum SMB_Q
static int sys_get_linux_gen_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp)
{
int ret = -1;
uint32 qflags = 0;
uint32_t qflags = 0;
struct if_dqblk D;
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
@ -375,8 +375,8 @@ static int sys_get_linux_gen_quota(const char *path, const char *bdev, enum SMB_
static int sys_set_linux_gen_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp)
{
int ret = -1;
uint32 qflags = 0;
uint32 oldqflags = 0;
uint32_t qflags = 0;
uint32_t oldqflags = 0;
struct if_dqblk D;
uint64_t bsize = (uint64_t)QUOTABLOCK_SIZE;
@ -504,7 +504,7 @@ int sys_get_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
int sys_set_vfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp)
{
int ret = -1;
uint32 oldqflags = 0;
uint32_t oldqflags = 0;
if (!path||!bdev||!dp)
smb_panic("sys_set_vfs_quota: called with NULL pointer");

View File

@ -113,7 +113,7 @@ int sys_get_nfs_quota(const char *path, const char *bdev,
enum clnt_stat clnt_stat;
int ret = -1;
uint32 qflags = 0;
uint32_t qflags = 0;
if (!path || !bdev || !dp) {
smb_panic("sys_get_nfs_quota: called with NULL pointer");

View File

@ -72,7 +72,7 @@
int sys_get_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp)
{
int ret = -1;
uint32 qflags = 0;
uint32_t qflags = 0;
uint64_t bsize = (uint64_t)BBSIZE;
struct fs_disk_quota D;
struct fs_quota_stat F;
@ -159,7 +159,7 @@ int sys_get_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qt
int sys_set_xfs_quota(const char *path, const char *bdev, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *dp)
{
int ret = -1;
uint32 qflags = 0;
uint32_t qflags = 0;
uint64_t bsize = (uint64_t)BBSIZE;
struct fs_disk_quota D;
struct fs_quota_stat F;

View File

@ -1217,9 +1217,9 @@ int sys_pclose(int fd)
uint32_t unix_dev_major(SMB_DEV_T dev)
{
#if defined(HAVE_DEVICE_MAJOR_FN)
return (uint32)major(dev);
return (uint32_t)major(dev);
#else
return (uint32)(dev >> 8);
return (uint32_t)(dev >> 8);
#endif
}
@ -1230,9 +1230,9 @@ uint32_t unix_dev_major(SMB_DEV_T dev)
uint32_t unix_dev_minor(SMB_DEV_T dev)
{
#if defined(HAVE_DEVICE_MINOR_FN)
return (uint32)minor(dev);
return (uint32_t)minor(dev);
#else
return (uint32)(dev & 0xff);
return (uint32_t)(dev & 0xff);
#endif
}

View File

@ -223,7 +223,7 @@ ssize_t message_push_blob(uint8_t **outbuf, DATA_BLOB blob)
size_t newlen = smb_len(*outbuf) + 4 + blob.length;
uint8_t *tmp;
if (!(tmp = talloc_realloc(NULL, *outbuf, uint8, newlen))) {
if (!(tmp = talloc_realloc(NULL, *outbuf, uint8_t, newlen))) {
DEBUG(0, ("talloc failed\n"));
return -1;
}
@ -1937,7 +1937,7 @@ uint32_t map_share_mode_to_deny_mode(uint32_t share_access, uint32_t private_opt
return DENY_FCB;
}
return (uint32)-1;
return (uint32_t)-1;
}
pid_t procid_to_pid(const struct server_id *proc)

View File

@ -28,7 +28,7 @@
struct ea_list *read_ea_list_entry(TALLOC_CTX *ctx, const char *pdata, size_t data_size, size_t *pbytes_used)
{
struct ea_list *eal = talloc_zero(ctx, struct ea_list);
uint16 val_len;
uint16_t val_len;
unsigned int namelen;
size_t converted_size;

View File

@ -33,7 +33,7 @@
struct perm_value {
const char *perm;
uint32 mask;
uint32_t mask;
};
static const struct perm_value special_values[] = {
@ -84,7 +84,7 @@ static NTSTATUS cli_lsa_lookup_sid(struct cli_state *cli,
enum lsa_SidType *type,
char **domain, char **name)
{
uint16 orig_cnum = cli_state_get_tid(cli);
uint16_t orig_cnum = cli_state_get_tid(cli);
struct rpc_pipe_client *p = NULL;
struct policy_handle handle;
NTSTATUS status;
@ -165,7 +165,7 @@ static NTSTATUS cli_lsa_lookup_name(struct cli_state *cli,
enum lsa_SidType *type,
struct dom_sid *sid)
{
uint16 orig_cnum = cli_state_get_tid(cli);
uint16_t orig_cnum = cli_state_get_tid(cli);
struct rpc_pipe_client *p;
struct policy_handle handle;
NTSTATUS status;
@ -292,7 +292,7 @@ void print_ace(struct cli_state *cli, FILE *f, struct security_ace *ace,
const struct perm_value *v;
fstring sidstr;
int do_print = 0;
uint32 got_mask;
uint32_t got_mask;
SidToString(cli, sidstr, &ace->trustee, numeric);
@ -580,7 +580,7 @@ void sec_desc_print(struct cli_state *cli, FILE *f,
struct security_descriptor *sd, bool numeric)
{
fstring sidstr;
uint32 i;
uint32_t i;
fprintf(f, "REVISION:%d\n", sd->revision);
print_acl_ctrl(f, sd->type, numeric);

View File

@ -45,17 +45,17 @@ int tdb_trans_store_bystring(TDB_CONTEXT *tdb, const char *keystr,
integers and strings.
****************************************************************************/
static size_t tdb_pack_va(uint8 *buf, int bufsize, const char *fmt, va_list ap)
static size_t tdb_pack_va(uint8_t *buf, int bufsize, const char *fmt, va_list ap)
{
uint8 bt;
uint16 w;
uint32 d;
uint8_t bt;
uint16_t w;
uint32_t d;
int i;
void *p;
int len;
char *s;
char c;
uint8 *buf0 = buf;
uint8_t *buf0 = buf;
const char *fmt0 = fmt;
int bufsize0 = bufsize;
@ -63,19 +63,19 @@ static size_t tdb_pack_va(uint8 *buf, int bufsize, const char *fmt, va_list ap)
switch ((c = *fmt++)) {
case 'b': /* unsigned 8-bit integer */
len = 1;
bt = (uint8)va_arg(ap, int);
bt = (uint8_t)va_arg(ap, int);
if (bufsize && bufsize >= len)
SSVAL(buf, 0, bt);
break;
case 'w': /* unsigned 16-bit integer */
len = 2;
w = (uint16)va_arg(ap, int);
w = (uint16_t)va_arg(ap, int);
if (bufsize && bufsize >= len)
SSVAL(buf, 0, w);
break;
case 'd': /* signed 32-bit integer (standard int in most systems) */
len = 4;
d = va_arg(ap, uint32);
d = va_arg(ap, uint32_t);
if (bufsize && bufsize >= len)
SIVAL(buf, 0, d);
break;
@ -129,7 +129,7 @@ static size_t tdb_pack_va(uint8 *buf, int bufsize, const char *fmt, va_list ap)
return PTR_DIFF(buf, buf0);
}
size_t tdb_pack(uint8 *buf, int bufsize, const char *fmt, ...)
size_t tdb_pack(uint8_t *buf, int bufsize, const char *fmt, ...)
{
va_list ap;
size_t result;
@ -140,7 +140,7 @@ size_t tdb_pack(uint8 *buf, int bufsize, const char *fmt, ...)
return result;
}
bool tdb_pack_append(TALLOC_CTX *mem_ctx, uint8 **buf, size_t *len,
bool tdb_pack_append(TALLOC_CTX *mem_ctx, uint8_t **buf, size_t *len,
const char *fmt, ...)
{
va_list ap;
@ -151,10 +151,10 @@ bool tdb_pack_append(TALLOC_CTX *mem_ctx, uint8 **buf, size_t *len,
va_end(ap);
if (mem_ctx != NULL) {
*buf = talloc_realloc(mem_ctx, *buf, uint8,
*buf = talloc_realloc(mem_ctx, *buf, uint8_t,
(*len) + len1);
} else {
*buf = SMB_REALLOC_ARRAY(*buf, uint8, (*len) + len1);
*buf = SMB_REALLOC_ARRAY(*buf, uint8_t, (*len) + len1);
}
if (*buf == NULL) {
@ -179,18 +179,18 @@ bool tdb_pack_append(TALLOC_CTX *mem_ctx, uint8 **buf, size_t *len,
integers and strings.
****************************************************************************/
int tdb_unpack(const uint8 *buf, int bufsize, const char *fmt, ...)
int tdb_unpack(const uint8_t *buf, int bufsize, const char *fmt, ...)
{
va_list ap;
uint8 *bt;
uint16 *w;
uint32 *d;
uint8_t *bt;
uint16_t *w;
uint32_t *d;
int len;
int *i;
void **p;
char *s, **b, **ps;
char c;
const uint8 *buf0 = buf;
const uint8_t *buf0 = buf;
const char *fmt0 = fmt;
int bufsize0 = bufsize;
@ -200,21 +200,21 @@ int tdb_unpack(const uint8 *buf, int bufsize, const char *fmt, ...)
switch ((c=*fmt++)) {
case 'b': /* unsigned 8-bit integer */
len = 1;
bt = va_arg(ap, uint8 *);
bt = va_arg(ap, uint8_t *);
if (bufsize < len)
goto no_space;
*bt = SVAL(buf, 0);
break;
case 'w': /* unsigned 16-bit integer */
len = 2;
w = va_arg(ap, uint16 *);
w = va_arg(ap, uint16_t *);
if (bufsize < len)
goto no_space;
*w = SVAL(buf, 0);
break;
case 'd': /* unsigned 32-bit integer (standard int in most systems) */
len = 4;
d = va_arg(ap, uint32 *);
d = va_arg(ap, uint32_t *);
if (bufsize < len)
goto no_space;
*d = IVAL(buf, 0);

View File

@ -24,7 +24,7 @@
#include "../libcli/security/security.h"
struct rid_name_map {
uint32 rid;
uint32_t rid;
const char *name;
};
@ -114,7 +114,7 @@ bool lookup_wellknown_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
{
int i;
struct dom_sid dom_sid;
uint32 rid;
uint32_t rid;
const struct rid_name_map *users = NULL;
sid_copy(&dom_sid, sid);

View File

@ -217,7 +217,7 @@ wbcErr wb_is_trusted_domain(const char *domain)
bool winbind_lookup_rids(TALLOC_CTX *mem_ctx,
const struct dom_sid *domain_sid,
int num_rids, uint32 *rids,
int num_rids, uint32_t *rids,
const char **domain_name,
const char ***names, enum lsa_SidType **types)
{
@ -449,7 +449,7 @@ wbcErr wb_is_trusted_domain(const char *domain)
bool winbind_lookup_rids(TALLOC_CTX *mem_ctx,
const struct dom_sid *domain_sid,
int num_rids, uint32 *rids,
int num_rids, uint32_t *rids,
const char **domain_name,
const char ***names, enum lsa_SidType **types)
{

View File

@ -43,7 +43,7 @@ struct passwd * winbind_getpwsid(const struct dom_sid *sid);
wbcErr wb_is_trusted_domain(const char *domain);
bool winbind_lookup_rids(TALLOC_CTX *mem_ctx,
const struct dom_sid *domain_sid,
int num_rids, uint32 *rids,
int num_rids, uint32_t *rids,
const char **domain_name,
const char ***names, enum lsa_SidType **types);
bool winbind_allocate_uid(uid_t *uid);