s4:extended_dn_out LDB module - change counter variables to "unsigned" where appropriate
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Sun, 7 Mar 2010 18:03:21 +0000 (19:03 +0100)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Sun, 7 Mar 2010 19:18:10 +0000 (20:18 +0100)
source4/dsdb/samdb/ldb_modules/extended_dn_out.c

index 2d0ee6a4aa22a4c8075720624e5d441ecc6d61d8..c986f8fe93ee15398c56474883852da3138d7d3e 100644 (file)
@@ -49,7 +49,7 @@ struct extended_dn_out_private {
 
 static bool is_attr_in_list(const char * const * attrs, const char *attr)
 {
 
 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)
 
        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;
 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++);
 
 
        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;
 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++);
 
 
        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 */
 {
        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;
                        
        
        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 */
 {
        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;
                        
        
        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;
        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;
        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;
        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[])
 {
 
 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;
        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;