From dffe228283ba756d4370753a1e2aed3cee3acccd Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Sat, 9 May 2015 16:33:10 -0700 Subject: [PATCH] Convert all uint32/16/8 to _t in source3/lib. Signed-off-by: Richard Sharpe Reviewed-by: Jeremy Allison --- source3/lib/ctdbd_conn.c | 4 ++-- source3/lib/events.c | 2 +- source3/lib/messages.c | 6 +++--- source3/lib/popt_common.c | 2 +- source3/lib/sysquotas_4A.c | 6 +++--- source3/lib/sysquotas_linux.c | 20 ++++++++++---------- source3/lib/sysquotas_nfs.c | 2 +- source3/lib/sysquotas_xfs.c | 4 ++-- source3/lib/system.c | 8 ++++---- source3/lib/util.c | 4 ++-- source3/lib/util_ea.c | 2 +- source3/lib/util_sd.c | 10 +++++----- source3/lib/util_tdb.c | 40 ++++++++++++++++++++-------------------- source3/lib/util_wellknown.c | 4 ++-- source3/lib/winbind_util.c | 4 ++-- source3/lib/winbind_util.h | 2 +- 16 files changed, 60 insertions(+), 60 deletions(-) diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 748a99ffa74..1285e4b3c54 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -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; diff --git a/source3/lib/events.c b/source3/lib/events.c index 62aa4d973e9..0bc56e454ad 100644 --- a/source3/lib/events.c +++ b/source3/lib/events.c @@ -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; diff --git a/source3/lib/messages.c b/source3/lib/messages.c index f0d2797dba4..51e88e26419 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -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, diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c index 44f6aae9996..c2a95d74151 100644 --- a/source3/lib/popt_common.c +++ b/source3/lib/popt_common.c @@ -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) diff --git a/source3/lib/sysquotas_4A.c b/source3/lib/sysquotas_4A.c index 8a1b12238cc..244b612c11f 100644 --- a/source3/lib/sysquotas_4A.c +++ b/source3/lib/sysquotas_4A.c @@ -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; diff --git a/source3/lib/sysquotas_linux.c b/source3/lib/sysquotas_linux.c index 5720328764b..68b9f906429 100644 --- a/source3/lib/sysquotas_linux.c +++ b/source3/lib/sysquotas_linux.c @@ -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"); diff --git a/source3/lib/sysquotas_nfs.c b/source3/lib/sysquotas_nfs.c index 2b0e494aef7..58eedf0a52e 100644 --- a/source3/lib/sysquotas_nfs.c +++ b/source3/lib/sysquotas_nfs.c @@ -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"); diff --git a/source3/lib/sysquotas_xfs.c b/source3/lib/sysquotas_xfs.c index cf77eace977..ccc7fc09111 100644 --- a/source3/lib/sysquotas_xfs.c +++ b/source3/lib/sysquotas_xfs.c @@ -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; diff --git a/source3/lib/system.c b/source3/lib/system.c index e933c46c306..e54b946d33c 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -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 } diff --git a/source3/lib/util.c b/source3/lib/util.c index 1d768202448..2fd2b6b9f21 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -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) diff --git a/source3/lib/util_ea.c b/source3/lib/util_ea.c index 81684da4cb2..e980e69ab4c 100644 --- a/source3/lib/util_ea.c +++ b/source3/lib/util_ea.c @@ -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; diff --git a/source3/lib/util_sd.c b/source3/lib/util_sd.c index 810053927f2..bfd5dbb979a 100644 --- a/source3/lib/util_sd.c +++ b/source3/lib/util_sd.c @@ -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); diff --git a/source3/lib/util_tdb.c b/source3/lib/util_tdb.c index f30cccabb7e..d7a8a475804 100644 --- a/source3/lib/util_tdb.c +++ b/source3/lib/util_tdb.c @@ -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); diff --git a/source3/lib/util_wellknown.c b/source3/lib/util_wellknown.c index f3c0f17a2a6..0f627d1443c 100644 --- a/source3/lib/util_wellknown.c +++ b/source3/lib/util_wellknown.c @@ -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); diff --git a/source3/lib/winbind_util.c b/source3/lib/winbind_util.c index 3189dd3b142..b3ecac15d79 100644 --- a/source3/lib/winbind_util.c +++ b/source3/lib/winbind_util.c @@ -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) { diff --git a/source3/lib/winbind_util.h b/source3/lib/winbind_util.h index abbc5a93c9d..2a90092ca89 100644 --- a/source3/lib/winbind_util.h +++ b/source3/lib/winbind_util.h @@ -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); -- 2.11.4.GIT