The branch, master has been updated
       via  85598be... s4:extended_dn_out LDB module - change counter variables 
to "unsigned" where appropriate
       via  632adf7... s4:repl_meta_data LDB module - change counter variables 
to "unsigned" where appropriate
       via  3bb3667... s4:local_password LDB module - change counter variables 
to "unsigned" where appropriate
      from  6997185... s4:ranged_results LDB module - change counter variables 
to "unsigned" where appropriate

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 85598be1f967765f65b78940b73187609fc9694d
Author: Matthias Dieter Wallnöfer <mwallnoe...@yahoo.de>
Date:   Sun Mar 7 19:03:21 2010 +0100

    s4:extended_dn_out LDB module - change counter variables to "unsigned" 
where appropriate

commit 632adf73288fe65c19ece464994f8e2c5021116c
Author: Matthias Dieter Wallnöfer <mwallnoe...@yahoo.de>
Date:   Sun Mar 7 19:02:47 2010 +0100

    s4:repl_meta_data LDB module - change counter variables to "unsigned" where 
appropriate
    
    I used "unsigned int" counters where we count LDB objects (LDB specification
    prescribes to use "unsigned" index variables).
    But on DSDB replication object counters I used "uint32_t" typed variables 
as it
    is suggested.
    If a counter variable counts both types of objects I used "unsigned int" 
since
    size(unsigned int) >= size(uint32_t), but on most platforms equal.

commit 3bb3667b4378702ba63352bfc172869379249302
Author: Matthias Dieter Wallnöfer <mwallnoe...@yahoo.de>
Date:   Sun Mar 7 19:04:11 2010 +0100

    s4:local_password LDB module - change counter variables to "unsigned" where 
appropriate

-----------------------------------------------------------------------

Summary of changes:
 source4/dsdb/samdb/ldb_modules/extended_dn_out.c |   19 +++++----
 source4/dsdb/samdb/ldb_modules/local_password.c  |    8 ++--
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c  |   44 ++++++++++++----------
 3 files changed, 39 insertions(+), 32 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c 
b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c
index 2d0ee6a..c986f8f 100644
--- a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c
+++ b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c
@@ -49,7 +49,7 @@ struct extended_dn_out_private {
 
 static bool is_attr_in_list(const char * const * attrs, const char *attr)
 {
-       int i;
+       unsigned int i;
 
        for (i = 0; attrs[i]; i++) {
                if (ldb_attr_cmp(attrs[i], attr) == 0)
@@ -62,7 +62,7 @@ static bool is_attr_in_list(const char * const * attrs, const 
char *attr)
 static char **copy_attrs(void *mem_ctx, const char * const * attrs)
 {
        char **nattrs;
-       int i, num;
+       unsigned int i, num;
 
        for (num = 0; attrs[num]; num++);
 
@@ -84,7 +84,7 @@ static char **copy_attrs(void *mem_ctx, const char * const * 
attrs)
 static bool add_attrs(void *mem_ctx, char ***attrs, const char *attr)
 {
        char **nattrs;
-       int num;
+       unsigned int num;
 
        for (num = 0; (*attrs)[num]; num++);
 
@@ -180,7 +180,7 @@ static int handle_dereference_openldap(struct ldb_dn *dn,
 {
        const struct ldb_val *entryUUIDblob, *sid_blob;
        struct ldb_message fake_msg; /* easier to use routines that expect an 
ldb_message */
-       int j;
+       unsigned int j;
        
        fake_msg.num_elements = 0;
                        
@@ -233,7 +233,7 @@ static int handle_dereference_fds(struct ldb_dn *dn,
 {
        const struct ldb_val *nsUniqueIdBlob, *sidBlob;
        struct ldb_message fake_msg; /* easier to use routines that expect an 
ldb_message */
-       int j;
+       unsigned int j;
        
        fake_msg.num_elements = 0;
                        
@@ -318,7 +318,8 @@ static int extended_callback(struct ldb_request *req, 
struct ldb_reply *ares,
        struct extended_search_context *ac;
        struct ldb_control *control;
        struct dsdb_openldap_dereference_result_control *dereference_control = 
NULL;
-       int ret, i, j;
+       int ret;
+       unsigned int i, j;
        struct ldb_message *msg = ares->message;
        struct extended_dn_out_private *p;
        struct ldb_context *ldb;
@@ -392,7 +393,8 @@ static int extended_callback(struct ldb_request *req, 
struct ldb_reply *ares,
                }
        }
 
-       /* Walk the retruned elements (but only if we have a schema to 
interpret the list with) */
+       /* Walk the returned elements (but only if we have a schema to
+        * interpret the list with) */
        for (i = 0; ac->schema && i < msg->num_elements; i++) {
                bool make_extended_dn;
                const struct dsdb_attribute *attribute;
@@ -734,7 +736,8 @@ static int extended_dn_out_ldb_init(struct ldb_module 
*module)
 
 static int extended_dn_out_dereference_init(struct ldb_module *module, const 
char *attrs[])
 {
-       int ret, i = 0;
+       int ret;
+       unsigned int i = 0;
        struct extended_dn_out_private *p = talloc_zero(module, struct 
extended_dn_out_private);
        struct dsdb_extended_dn_store_format *dn_format;
        struct dsdb_openldap_dereference_control *dereference_control;
diff --git a/source4/dsdb/samdb/ldb_modules/local_password.c 
b/source4/dsdb/samdb/ldb_modules/local_password.c
index 9c386b3..aa4d3af 100644
--- a/source4/dsdb/samdb/ldb_modules/local_password.c
+++ b/source4/dsdb/samdb/ldb_modules/local_password.c
@@ -151,7 +151,7 @@ static int local_password_add(struct ldb_module *module, 
struct ldb_request *req
        struct lpdb_context *ac;
        struct GUID objectGUID;
        int ret;
-       int i;
+       unsigned int i;
 
        ldb = ldb_module_get_ctx(module);
        ldb_debug(ldb, LDB_DEBUG_TRACE, "local_password_add\n");
@@ -311,7 +311,7 @@ static int local_password_modify(struct ldb_module *module, 
struct ldb_request *
        struct ldb_message *remote_message;
        struct ldb_request *remote_req;
        int ret;
-       int i;
+       unsigned int i;
 
        ldb = ldb_module_get_ctx(module);
        ldb_debug(ldb, LDB_DEBUG_TRACE, "local_password_modify\n");
@@ -784,7 +784,7 @@ static int lpdb_local_search_callback(struct ldb_request 
*req,
        struct ldb_reply *merge;
        struct lpdb_reply *lr;
        int ret;
-       int i;
+       unsigned int i;
 
        ac = talloc_get_type(req->context, struct lpdb_context);
        ldb = ldb_module_get_ctx(ac->module);
@@ -1013,7 +1013,7 @@ static int local_password_search(struct ldb_module 
*module, struct ldb_request *
        struct ldb_context *ldb;
        struct ldb_request *remote_req;
        struct lpdb_context *ac;
-       int i;
+       unsigned int i;
        int ret;
        const char * const *search_attrs = NULL;
 
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c 
b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index b1abc7d..e96a205 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -656,7 +656,7 @@ static int replmd_add_fix_la(struct ldb_module *module, 
struct ldb_message_eleme
                             uint64_t seq_num, const struct GUID *invocationId, 
time_t t,
                             struct GUID *guid, const struct dsdb_attribute *sa)
 {
-       int i;
+       unsigned int i;
        TALLOC_CTX *tmp_ctx = talloc_new(el->values);
        struct ldb_context *ldb = ldb_module_get_ctx(module);
        struct dsdb_schema *schema = dsdb_get_schema(ldb);
@@ -726,7 +726,8 @@ static int replmd_add(struct ldb_module *module, struct 
ldb_request *req)
        NTTIME now;
        char *time_str;
        int ret;
-       uint32_t i, ni=0;
+       unsigned int i;
+       uint32_t ni=0;
        bool allow_add_guid = false;
        bool remove_current_guid = false;
        bool is_urgent = false;
@@ -990,7 +991,7 @@ static int replmd_update_rpmd_element(struct ldb_context 
*ldb,
                                      const struct GUID *our_invocation_id,
                                      NTTIME now)
 {
-       int i;
+       uint32_t i;
        const struct dsdb_attribute *a;
        struct replPropertyMetaData1 *md1;
 
@@ -1075,7 +1076,7 @@ static int replmd_update_rpmd(struct ldb_module *module,
        const struct ldb_val *omd_value;
        enum ndr_err_code ndr_err;
        struct replPropertyMetaDataBlob omd;
-       int i;
+       unsigned int i;
        NTTIME now;
        const struct GUID *our_invocation_id;
        int ret;
@@ -1245,7 +1246,7 @@ static int get_parsed_dns(struct ldb_module *module, 
TALLOC_CTX *mem_ctx,
                          struct ldb_message_element *el, struct parsed_dn 
**pdn,
                          const char *ldap_oid)
 {
-       int i;
+       unsigned int i;
        struct ldb_context *ldb = ldb_module_get_ctx(module);
 
        if (el == NULL) {
@@ -1402,7 +1403,7 @@ static int replmd_update_la_val(TALLOC_CTX *mem_ctx, 
struct ldb_val *v, struct d
  */
 static int replmd_check_upgrade_links(struct parsed_dn *dns, uint32_t count, 
const struct GUID *invocation_id)
 {
-       int i;
+       uint32_t i;
        for (i=0; i<count; i++) {
                NTSTATUS status;
                uint32_t version;
@@ -1536,7 +1537,7 @@ static int replmd_modify_la_add(struct ldb_module *module,
                                time_t t,
                                struct GUID *msg_guid)
 {
-       int i;
+       unsigned int i;
        struct parsed_dn *dns, *old_dns;
        TALLOC_CTX *tmp_ctx = talloc_new(msg);
        int ret;
@@ -1655,7 +1656,7 @@ static int replmd_modify_la_delete(struct ldb_module 
*module,
                                   time_t t,
                                   struct GUID *msg_guid)
 {
-       int i;
+       unsigned int i;
        struct parsed_dn *dns, *old_dns;
        TALLOC_CTX *tmp_ctx = talloc_new(msg);
        int ret;
@@ -1774,15 +1775,15 @@ static int replmd_modify_la_replace(struct ldb_module 
*module,
                                    time_t t,
                                    struct GUID *msg_guid)
 {
-       int i;
+       unsigned int i;
        struct parsed_dn *dns, *old_dns;
        TALLOC_CTX *tmp_ctx = talloc_new(msg);
        int ret;
        const struct GUID *invocation_id;
        struct ldb_context *ldb = ldb_module_get_ctx(module);
        struct ldb_val *new_values = NULL;
-       uint32_t num_new_values = 0;
-       unsigned old_num_values = old_el?old_el->num_values:0;
+       unsigned int num_new_values = 0;
+       unsigned int old_num_values = old_el?old_el->num_values:0;
        NTTIME now;
 
        unix_to_nt_time(&now, t);
@@ -1922,7 +1923,8 @@ static int replmd_modify_handle_linked_attribs(struct 
ldb_module *module,
                                               uint64_t seq_num, time_t t)
 {
        struct ldb_result *res;
-       int ret, i;
+       unsigned int i;
+       int ret;
        struct ldb_context *ldb = ldb_module_get_ctx(module);
        struct ldb_message *old_msg;
        struct dsdb_schema *schema = dsdb_get_schema(ldb);
@@ -2223,7 +2225,7 @@ static int replmd_delete_remove_link(struct ldb_module 
*module,
                                     struct ldb_message_element *el,
                                     const struct dsdb_attribute *sa)
 {
-       int i;
+       unsigned int i;
        TALLOC_CTX *tmp_ctx = talloc_new(module);
        struct ldb_context *ldb = ldb_module_get_ctx(module);
 
@@ -2321,8 +2323,7 @@ static int replmd_delete(struct ldb_module *module, 
struct ldb_request *req)
                "securityIdentifier", "sIDHistory", "subClassOf", 
"systemFlags", "trustPartner", "trustDirection",
                "trustType", "trustAttributes", "userAccountControl", 
"uSNChanged", "uSNCreated", "whenCreated",
                "whenChanged", NULL};
-       uint32_t el_count = 0;
-       int i;
+       unsigned int i, el_count = 0;
 
        if (ldb_dn_is_special(req->op.del.dn)) {
                return ldb_next_request(module, req);
@@ -2557,7 +2558,7 @@ static int replmd_replicated_apply_add(struct 
replmd_replicated_request *ar)
        struct ldb_message *msg;
        struct replPropertyMetaDataBlob *md;
        struct ldb_val md_value;
-       uint32_t i;
+       unsigned int i;
        int ret;
 
        /*
@@ -2697,8 +2698,9 @@ static int replmd_replicated_apply_merge(struct 
replmd_replicated_request *ar)
        const struct ldb_val *omd_value;
        struct replPropertyMetaDataBlob nmd;
        struct ldb_val nmd_value;
-       uint32_t i,j,ni=0;
-       uint32_t removed_attrs = 0;
+       unsigned int i;
+       uint32_t j,ni=0;
+       unsigned int removed_attrs = 0;
        int ret;
 
        ldb = ldb_module_get_ctx(ar->module);
@@ -3039,7 +3041,8 @@ static int replmd_replicated_uptodate_modify(struct 
replmd_replicated_request *a
        struct repsFromToBlob nrf;
        struct ldb_val *nrf_value = NULL;
        struct ldb_message_element *nrf_el = NULL;
-       uint32_t i,j,ni=0;
+       unsigned int i;
+       uint32_t j,ni=0;
        bool found = false;
        time_t t = time(NULL);
        NTTIME now;
@@ -3387,7 +3390,8 @@ static int replmd_extended_replicated_objects(struct 
ldb_module *module, struct
        struct dsdb_extended_replicated_objects *objs;
        struct replmd_replicated_request *ar;
        struct ldb_control **ctrls;
-       int ret, i;
+       int ret;
+       uint32_t i;
        struct replmd_private *replmd_private = 
                talloc_get_type(ldb_module_get_private(module), struct 
replmd_private);
 


-- 
Samba Shared Repository

Reply via email to