]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
torture: Align a few integer types
authorVolker Lendecke <vl@samba.org>
Mon, 3 Aug 2020 19:55:51 +0000 (21:55 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 17 Aug 2020 19:35:37 +0000 (19:35 +0000)
Also move a variable closer to its use

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/torture/drs/drs_util.c
source4/torture/drs/unit/schemainfo_tests.c
source4/torture/ldap/basic.c
source4/torture/ldap/ldap_sort.c
source4/torture/ldap/nested_search.c

index 4795bd90fe32010370e27f6d78206e47098c349a..c43836e7c5d3c2b1850fcd447ac15e47565b966f 100644 (file)
@@ -39,8 +39,7 @@ bool drs_util_oid_from_attid(struct torture_context *tctx,
                             const char **_oid,
                             int *map_idx)
 {
-       int i;
-       uint32_t hi_word, lo_word;
+       uint32_t i, hi_word, lo_word;
        DATA_BLOB bin_oid = {NULL, 0};
        char *oid;
        struct drsuapi_DsReplicaOIDMapping *map_entry = NULL;
index e5a1c87bbebead9853adcd745406fd2d3c100b0e..4b4cca64241817916deffff2220b510c1522cb6c 100644 (file)
@@ -226,7 +226,7 @@ static bool test_dsdb_schema_info_new(struct torture_context *tctx,
 static bool test_dsdb_schema_info_from_blob(struct torture_context *tctx,
                                            struct drsut_schemainfo_data *priv)
 {
-       int i;
+       uint32_t i;
        WERROR werr;
        char *msg;
        struct dsdb_schema_info *schema_info;
@@ -263,7 +263,7 @@ static bool test_dsdb_schema_info_from_blob(struct torture_context *tctx,
 static bool test_dsdb_blob_from_schema_info(struct torture_context *tctx,
                                            struct drsut_schemainfo_data *priv)
 {
-       int i;
+       uint32_t i;
        WERROR werr;
        char *msg;
        DATA_BLOB ndr_blob;
@@ -606,7 +606,7 @@ DONE:
 static bool torture_drs_unit_schemainfo_setup(struct torture_context *tctx,
                                              struct drsut_schemainfo_data **_priv)
 {
-       int i;
+       size_t i;
        int ldb_err;
        NTSTATUS status;
        DATA_BLOB ndr_blob;
index fd287bde73cf6756f3a6fbf33f3b75a79cde5e19..0432281f759491932256f4626355525ddd473e29 100644 (file)
@@ -131,7 +131,7 @@ static bool test_search_rootDSE(struct ldap_connection *conn, const char **based
                
        DEBUG(1,("\tdn: %s\n", r->dn));
        for (i=0; i<r->num_attributes; i++) {
-               int j;
+               unsigned int j;
                for (j=0; j<r->attributes[i].num_values; j++) {
                        DEBUG(1,("\t%s: %d %.*s\n", r->attributes[i].name,
                                 (int)r->attributes[i].values[j].length,
index 7aa0d54bf6f78240a58084e11e80b03f8c585eca..ee552fc79167a74463eed8ee19545326b754d1d0 100644 (file)
@@ -39,7 +39,6 @@ bool torture_ldap_sort(struct torture_context *torture)
        bool ret = false;
        const char *host = torture_setting_string(torture, "host", NULL);
        char *url;
-       int i;
        codepoint_t j;
        struct ldb_message_element *elem;
        struct ldb_message *msg;
@@ -96,6 +95,7 @@ bool torture_ldap_sort(struct torture_context *torture)
 
        ret = true;
        if (ctx->count > 1) {
+               unsigned int i;
                for (i=0;i<ctx->count;i++) {
                        msg = ctx->msgs[i];
                        elem = ldb_msg_find_element(msg,"cn");
index 31e127d04ff3b329b7277fcfba30729071e46417..3e58961894f2de097f735fffe1fb7ea17a8e2a53 100644 (file)
@@ -48,7 +48,7 @@ struct nested_search_context {
 static int nested_search_callback(struct ldb_request *req,
                                  struct ldb_reply *ares)
 {
-       int i;
+       unsigned int i;
        int res;
        struct nested_search_context *sctx;
        struct ldb_result *ldb_res;