From 1e776786488f7fb2b26af45bdabc6d41579725ac Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Fri, 8 May 2015 20:10:12 -0700 Subject: [PATCH] Convert all uses of uint32/16/8 to _t in source3/torture. Signed-off-by: Richard Sharpe Reviewed-by: Jeremy Allison --- source3/torture/cmd_vfs.c | 2 +- source3/torture/mangle_test.c | 2 +- source3/torture/msgtest.c | 4 +- source3/torture/nbio.c | 2 +- source3/torture/pdbtest.c | 20 +++++----- source3/torture/torture.c | 74 +++++++++++++++++------------------ source3/torture/utable.c | 2 +- 7 files changed, 53 insertions(+), 53 deletions(-) diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index 26e40c52936..040759af0c8 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -93,7 +93,7 @@ static NTSTATUS cmd_show_data(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int ar printf("show_data: error=-1 (not enough data in buffer)\n"); return NT_STATUS_UNSUCCESSFUL; } - dump_data(0, (uint8 *)(vfs->data) + offset, len); + dump_data(0, (uint8_t *)(vfs->data) + offset, len); return NT_STATUS_OK; } diff --git a/source3/torture/mangle_test.c b/source3/torture/mangle_test.c index 1239f10630f..9886e38b532 100644 --- a/source3/torture/mangle_test.c +++ b/source3/torture/mangle_test.c @@ -107,7 +107,7 @@ static bool test_one(struct cli_state *cli, const char *name) } else { TDB_DATA namedata; /* store it for later */ - namedata.dptr = discard_const_p(uint8, name); + namedata.dptr = discard_const_p(uint8_t, name); namedata.dsize = strlen(name)+1; tdb_store_bystring(tdb, shortname, namedata, TDB_REPLACE); } diff --git a/source3/torture/msgtest.c b/source3/torture/msgtest.c index a23e992a75b..1d2a8a9b1c8 100644 --- a/source3/torture/msgtest.c +++ b/source3/torture/msgtest.c @@ -94,7 +94,7 @@ static void pong_message(struct messaging_context *msg_ctx, messaging_send(msg_ctx, messaging_server_id(msg_ctx), MSG_PING, &data_blob_null); messaging_send_buf(msg_ctx, messaging_server_id(msg_ctx), - MSG_PING,(uint8 *)buf, 11); + MSG_PING,(uint8_t *)buf, 11); } /* @@ -132,7 +132,7 @@ static void pong_message(struct messaging_context *msg_ctx, if(NT_STATUS_IS_OK(messaging_send_buf( msg_ctx, pid_to_procid(pid), MSG_PING, - (uint8 *)buf, 11))) + (uint8_t *)buf, 11))) ping_count++; if(NT_STATUS_IS_OK(messaging_send( msg_ctx, pid_to_procid(pid), diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c index 55dd8363b07..6373a107ef3 100644 --- a/source3/torture/nbio.c +++ b/source3/torture/nbio.c @@ -153,7 +153,7 @@ void nb_createx(const char *fname, uint16_t fd = (uint16_t)-1; int i; NTSTATUS status; - uint32 desired_access; + uint32_t desired_access; if (create_options & FILE_DIRECTORY_FILE) { desired_access = FILE_READ_DATA; diff --git a/source3/torture/pdbtest.c b/source3/torture/pdbtest.c index 0acf54f699a..fe51a764798 100644 --- a/source3/torture/pdbtest.c +++ b/source3/torture/pdbtest.c @@ -40,9 +40,9 @@ static bool samu_correct(struct samu *s1, struct samu *s2) { bool ret = True; - uint32 s1_len, s2_len; + uint32_t s1_len, s2_len; const char *s1_buf, *s2_buf; - const uint8 *d1_buf, *d2_buf; + const uint8_t *d1_buf, *d2_buf; const struct dom_sid *s1_sid, *s2_sid; /* Check Unix username */ @@ -443,8 +443,8 @@ int main(int argc, const char **argv) struct timeval tv; bool error = False; struct passwd *pwd; - uint8 *buf; - uint32 expire, min_age, history; + uint8_t *buf; + uint32_t expire, min_age, history; struct pdb_methods *pdb; poptContext pc; static const char *backend = NULL; @@ -504,24 +504,24 @@ int main(int argc, const char **argv) pdb_get_account_policy(PDB_POLICY_PASSWORD_HISTORY, &history); if (history * PW_HISTORY_ENTRY_LEN < NT_HASH_LEN) { - buf = (uint8 *)TALLOC(ctx, NT_HASH_LEN); + buf = (uint8_t *)TALLOC(ctx, NT_HASH_LEN); } else { - buf = (uint8 *)TALLOC(ctx, history * PW_HISTORY_ENTRY_LEN); + buf = (uint8_t *)TALLOC(ctx, history * PW_HISTORY_ENTRY_LEN); } /* Generate some random hashes */ GetTimeOfDay(&tv); srand(tv.tv_usec); for (i = 0; i < NT_HASH_LEN; i++) { - buf[i] = (uint8) rand(); + buf[i] = (uint8_t) rand(); } pdb_set_nt_passwd(out, buf, PDB_SET); for (i = 0; i < LM_HASH_LEN; i++) { - buf[i] = (uint8) rand(); + buf[i] = (uint8_t) rand(); } pdb_set_lanman_passwd(out, buf, PDB_SET); for (i = 0; i < history * PW_HISTORY_ENTRY_LEN; i++) { - buf[i] = (uint8) rand(); + buf[i] = (uint8_t) rand(); } pdb_set_pw_history(out, buf, history, PDB_SET); @@ -529,7 +529,7 @@ int main(int argc, const char **argv) pdb_get_account_policy(PDB_POLICY_MIN_PASSWORD_AGE, &min_age); pdb_set_pass_last_set_time(out, time(NULL), PDB_SET); - if (min_age == (uint32)-1) { + if (min_age == (uint32_t)-1) { pdb_set_pass_can_change_time(out, 0, PDB_SET); } else { pdb_set_pass_can_change_time(out, time(NULL)+min_age, PDB_SET); diff --git a/source3/torture/torture.c b/source3/torture/torture.c index e9c91ffa7ea..d5ec4c6fed1 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -79,8 +79,8 @@ static double create_procs(bool (*fn)(int), bool *result); static bool force_cli_encryption(struct cli_state *c, const char *sharename) { - uint16 major, minor; - uint32 caplow, caphigh; + uint16_t major, minor; + uint32_t caplow, caphigh; NTSTATUS status; if (!SERVER_HAS_UNIX_CIFS(c)) { @@ -409,7 +409,7 @@ bool torture_init_connection(struct cli_state **pcli) return true; } -bool torture_cli_session_setup2(struct cli_state *cli, uint16 *new_vuid) +bool torture_cli_session_setup2(struct cli_state *cli, uint16_t *new_vuid) { uint16_t old_vuid = cli_state_get_uid(cli); size_t passlen = strlen(password); @@ -447,11 +447,11 @@ bool torture_close_connection(struct cli_state *c) /* check if the server produced the expected dos or nt error code */ static bool check_both_error(int line, NTSTATUS status, - uint8 eclass, uint32 ecode, NTSTATUS nterr) + uint8_t eclass, uint32_t ecode, NTSTATUS nterr) { if (NT_STATUS_IS_DOS(status)) { - uint8 cclass; - uint32 num; + uint8_t cclass; + uint32_t num; /* Check DOS error */ cclass = NT_STATUS_DOS_CLASS(status); @@ -481,11 +481,11 @@ static bool check_both_error(int line, NTSTATUS status, /* check if the server produced the expected error code */ static bool check_error(int line, NTSTATUS status, - uint8 eclass, uint32 ecode, NTSTATUS nterr) + uint8_t eclass, uint32_t ecode, NTSTATUS nterr) { if (NT_STATUS_IS_DOS(status)) { - uint8 cclass; - uint32 num; + uint8_t cclass; + uint32_t num; /* Check DOS error */ @@ -517,7 +517,7 @@ static bool check_error(int line, NTSTATUS status, } -static bool wait_lock(struct cli_state *c, int fnum, uint32 offset, uint32 len) +static bool wait_lock(struct cli_state *c, int fnum, uint32_t offset, uint32_t len) { NTSTATUS status; @@ -677,7 +677,7 @@ static bool rw_torture3(struct cli_state *c, char *lockfname) NTSTATUS status = NT_STATUS_OK; srandom(1); - for (i = 0; i < sizeof(buf); i += sizeof(uint32)) + for (i = 0; i < sizeof(buf); i += sizeof(uint32_t)) { SIVAL(buf, i, sys_random()); } @@ -1307,9 +1307,9 @@ static bool run_tcon_test(int dummy) { static struct cli_state *cli; const char *fname = "\\tcontest.tmp"; - uint16 fnum1; - uint16 cnum1, cnum2, cnum3; - uint16 vuid1, vuid2; + uint16_t fnum1; + uint16_t cnum1, cnum2, cnum3; + uint16_t vuid1, vuid2; char buf[4]; bool ret = True; NTSTATUS status; @@ -1424,7 +1424,7 @@ static bool run_tcon_test(int dummy) static bool run_tcon2_test(int dummy) { static struct cli_state *cli; - uint16 cnum, max_xmit; + uint16_t cnum, max_xmit; char *service; NTSTATUS status; @@ -1741,11 +1741,11 @@ static bool run_locktest3(int dummy) const char *fname = "\\lockt3.lck"; uint16_t fnum1, fnum2; int i; - uint32 offset; + uint32_t offset; bool correct = True; NTSTATUS status; -#define NEXT_OFFSET offset += (~(uint32)0) / torture_numops +#define NEXT_OFFSET offset += (~(uint32_t)0) / torture_numops if (!torture_open_connection(&cli1, 0) || !torture_open_connection(&cli2, 1)) { return False; @@ -2766,10 +2766,10 @@ static bool run_fdpasstest(int dummy) static bool run_fdsesstest(int dummy) { struct cli_state *cli; - uint16 new_vuid; - uint16 saved_vuid; - uint16 new_cnum; - uint16 saved_cnum; + uint16_t new_vuid; + uint16_t saved_vuid; + uint16_t new_cnum; + uint16_t saved_cnum; const char *fname = "\\fdsess.tst"; const char *fname1 = "\\fdsess1.tst"; uint16_t fnum1; @@ -3106,7 +3106,7 @@ static bool run_randomipc(int dummy) -static void browse_callback(const char *sname, uint32 stype, +static void browse_callback(const char *sname, uint32_t stype, const char *comment, void *state) { printf("\t%20.20s %08x %s\n", sname, stype, comment); @@ -3380,7 +3380,7 @@ static bool run_trans2test(int dummy) static NTSTATUS new_trans(struct cli_state *pcli, int fnum, int level) { uint8_t *buf = NULL; - uint32 len; + uint32_t len; NTSTATUS status; status = cli_qfileinfo(talloc_tos(), pcli, fnum, level, 0, @@ -3390,7 +3390,7 @@ static NTSTATUS new_trans(struct cli_state *pcli, int fnum, int level) nt_errstr(status)); } else { printf("qfileinfo: level %d, len = %u\n", level, len); - dump_data(0, (uint8 *)buf, len); + dump_data(0, (uint8_t *)buf, len); printf("\n"); } TALLOC_FREE(buf); @@ -5322,8 +5322,8 @@ static bool run_opentest(int dummy) NTSTATUS torture_setup_unix_extensions(struct cli_state *cli) { - uint16 major, minor; - uint32 caplow, caphigh; + uint16_t major, minor; + uint32_t caplow, caphigh; NTSTATUS status; if (!SERVER_HAS_UNIX_CIFS(cli)) { @@ -5751,7 +5751,7 @@ static bool run_simple_posix_open_test(int dummy) } -static uint32 open_attrs_table[] = { +static uint32_t open_attrs_table[] = { FILE_ATTRIBUTE_NORMAL, FILE_ATTRIBUTE_ARCHIVE, FILE_ATTRIBUTE_READONLY, @@ -5773,9 +5773,9 @@ static uint32 open_attrs_table[] = { struct trunc_open_results { unsigned int num; - uint32 init_attr; - uint32 trunc_attr; - uint32 result_attr; + uint32_t init_attr; + uint32_t trunc_attr; + uint32_t result_attr; }; static struct trunc_open_results attr_results[] = { @@ -5813,7 +5813,7 @@ static bool run_openattrtest(int dummy) const char *fname = "\\openattr.file"; uint16_t fnum1; bool correct = True; - uint16 attr; + uint16_t attr; unsigned int i, j, k, l; NTSTATUS status; @@ -5825,7 +5825,7 @@ static bool run_openattrtest(int dummy) smbXcli_conn_set_sockopt(cli1->conn, sockops); - for (k = 0, i = 0; i < sizeof(open_attrs_table)/sizeof(uint32); i++) { + for (k = 0, i = 0; i < sizeof(open_attrs_table)/sizeof(uint32_t); i++) { cli_setatr(cli1, fname, 0, 0); cli_unlink(cli1, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN); @@ -5843,7 +5843,7 @@ static bool run_openattrtest(int dummy) return False; } - for (j = 0; j < sizeof(open_attrs_table)/sizeof(uint32); j++) { + for (j = 0; j < sizeof(open_attrs_table)/sizeof(uint32_t); j++) { status = cli_ntcreate(cli1, fname, 0, FILE_READ_DATA|FILE_WRITE_DATA, open_attrs_table[j], @@ -6049,7 +6049,7 @@ bool torture_ioctl_test(int dummy) for (device=0;device<0x100;device++) { printf("ioctl test with device = 0x%x\n", device); for (function=0;function<0x100;function++) { - uint32 code = (device<<16) | function; + uint32_t code = (device<<16) | function; status = cli_raw_ioctl(cli, fnum, code, &blob); @@ -6383,10 +6383,10 @@ static bool run_error_map_extract(int dummy) { static struct cli_state *c_nt; NTSTATUS status; - uint32 error; + uint32_t error; - uint32 errnum; - uint8 errclass; + uint32_t errnum; + uint8_t errclass; NTSTATUS nt_status; diff --git a/source3/torture/utable.c b/source3/torture/utable.c index 27330914e5e..666f21a27f5 100644 --- a/source3/torture/utable.c +++ b/source3/torture/utable.c @@ -32,7 +32,7 @@ bool torture_utable(int dummy) smb_ucs2_t c2; int c, len, fd; int chars_allowed=0, alt_allowed=0; - uint8 valid[0x10000]; + uint8_t valid[0x10000]; printf("starting utable\n"); -- 2.34.1