r24631: Fix up format warnings, found on my Fedora 7 x86_64 workstation.
authorAndrew Bartlett <abartlet@samba.org>
Thu, 23 Aug 2007 02:10:17 +0000 (02:10 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:02:27 +0000 (15:02 -0500)
Andrew Bartlett

source/dsdb/schema/schema_init.c
source/dsdb/schema/schema_syntax.c
source/lib/gendb.c
source/lib/util/tests/idtree.c
source/librpc/tools/ndrdump.c
source/smbd/server.c
source/torture/ldap/uptodatevector.c
source/torture/unix/whoami.c

index ce7645c4546c12c0a93a001532b6095dc776d33f..41b53be97757161c272e69f1ae1c4f096744cdcb 100644 (file)
@@ -674,7 +674,7 @@ static struct drsuapi_DsReplicaAttribute *dsdb_find_object_attr_name(struct dsdb
        } \
        if (strict && _a->value_ctr.num_values != 1) { \
                d_printf("%s: %s num_values == %u\n", __location__, attr, \
-                       _a->value_ctr.num_values); \
+                        (unsigned int)_a->value_ctr.num_values);       \
                return WERR_INVALID_PARAM; \
        } \
        if (strict && !_a->value_ctr.values[0].blob) { \
@@ -683,7 +683,7 @@ static struct drsuapi_DsReplicaAttribute *dsdb_find_object_attr_name(struct dsdb
        } \
        if (strict && _a->value_ctr.values[0].blob->length != 4) { \
                d_printf("%s: %s length == %u\n", __location__, attr, \
-                       _a->value_ctr.values[0].blob->length); \
+                        (unsigned int)_a->value_ctr.values[0].blob->length); \
                return WERR_INVALID_PARAM; \
        } \
        if (_a && _a->value_ctr.num_values >= 1 \
index db34e58f7119891d5a4a25b8e0c07b9ceee364f8..760417b6760101b8a48120f3925701e7acc9a220 100644 (file)
@@ -261,7 +261,7 @@ static WERROR dsdb_syntax_INT64_drsuapi_to_ldb(const struct dsdb_schema *schema,
 
                v = BVALS(in->value_ctr.values[i].blob->data, 0);
 
-               str = talloc_asprintf(out->values, "%lld", v);
+               str = talloc_asprintf(out->values, "%lld", (long long int)v);
                W_ERROR_HAVE_NO_MEMORY(str);
 
                out->values[i] = data_blob_string_const(str);
@@ -948,7 +948,7 @@ static WERROR dsdb_syntax_DN_BINARY_drsuapi_to_ldb(const struct dsdb_schema *sch
                W_ERROR_HAVE_NO_MEMORY(binary);
 
                str = talloc_asprintf(out->values, "B:%u:%s:%s",
-                                     id3b.binary.length * 2, /* because of 2 hex chars per byte */
+                                     (unsigned int)(id3b.binary.length * 2), /* because of 2 hex chars per byte */
                                      binary,
                                      id3b.dn);
                W_ERROR_HAVE_NO_MEMORY(str);
index 097a2795f4a222b167e592ddbccda37e0e3d365b..003384b1ee9b4738e120ab3e36b93a82ad8a065c 100644 (file)
@@ -23,6 +23,7 @@
 #include "includes.h"
 #include "lib/ldb/include/ldb.h"
 #include "lib/ldb/include/ldb_errors.h"
+#include "lib/db_wrap.h"
 
 /*
   search the sam for the specified attributes - va_list variant
index 448abb5c04023972a2470209930fef6e4653d4fb..d89fb8c4897104c1a34898dbfd2fc99d20236134 100644 (file)
@@ -61,10 +61,11 @@ static bool torture_local_idtree_simple(struct torture_context *tctx)
                        }
                } else {
                        if (p != NULL) {
-                               torture_fail(tctx, talloc_asprintf(tctx,
-                                       "non-present at %d gave %p (would be %d)", 
-                                      ii, p, 
-                                      (int)(((char *)p) - (char *)(&ids[0])) / sizeof(int)));
+                               torture_fail(tctx, 
+                                            talloc_asprintf(tctx,
+                                                            "non-present at %d gave %p (would be %d)", 
+                                                            ii, p, 
+                                                            (int)((((char *)p) - (char *)(&ids[0])) / sizeof(int))));
                        }
                        if (random() % 5) {
                                ids[ii] = idr_get_new(idr, &ids[ii], n);
index 4b840fed5a4d1e577d4848a9f0898c12262ea3a7..8a5e55f91eeac84912c25edaad76f5c93c2aceed 100644 (file)
@@ -402,11 +402,13 @@ const struct ndr_interface_table *load_iface_from_plugin(const char *plugin, con
                f->ndr_print(ndr_v_print, function, flags, v_st);
 
                if (blob.length != v_blob.length) {
-                       printf("WARNING! orig bytes:%u validated pushed bytes:%u\n", blob.length, v_blob.length);
+                       printf("WARNING! orig bytes:%llu validated pushed bytes:%llu\n", 
+                              (unsigned long long)blob.length, (unsigned long long)v_blob.length);
                }
 
                if (ndr_pull->offset != ndr_v_pull->offset) {
-                       printf("WARNING! orig pulled bytes:%u validated pulled bytes:%u\n", ndr_pull->offset, ndr_v_pull->offset);
+                       printf("WARNING! orig pulled bytes:%llu validated pulled bytes:%llu\n", 
+                              (unsigned long long)ndr_pull->offset, (unsigned long long)ndr_v_pull->offset);
                }
 
                differ = false;
index d164c5054ab154018817b3658100bbb002e96ad8..7731db85f8732289f38717e14e09226d7970df69 100644 (file)
@@ -256,7 +256,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
        if (sizeof(uint16_t) < 2 || sizeof(uint32_t) < 4 || sizeof(uint64_t) < 8) {
                DEBUG(0,("ERROR: Samba is not configured correctly for the word size on your machine\n"));
                DEBUGADD(0,("sizeof(uint16_t) = %u, sizeof(uint32_t) %u, sizeof(uint64_t) = %u\n",
-                       sizeof(uint16_t), sizeof(uint32_t), sizeof(uint64_t)));
+                           (unsigned int)sizeof(uint16_t), (unsigned int)sizeof(uint32_t), (unsigned int)sizeof(uint64_t)));
                exit(1);
        }
 
index 470c2f247aa153692843524eca474aaffe412997..0ff9948cad58bd2c96030e575116f8187177dac3 100644 (file)
@@ -132,9 +132,9 @@ static bool test_check_uptodatevector(struct torture_context *torture,
                }
 
                torture_comment(torture, "[%u]: uSNChanged[%llu] description[%s] replUpToDateVector[%s]\n", i,
-                                       samdb_result_uint64(r->msgs[0], "uSNChanged", 0),
-                                       samdb_result_string(r->msgs[0], "description", NULL),
-                                       (no_match ? "changed!: not ok" : "not changed: ok"));
+                               (unsigned long long)samdb_result_uint64(r->msgs[0], "uSNChanged", 0),
+                               samdb_result_string(r->msgs[0], "description", NULL),
+                               (no_match ? "changed!: not ok" : "not changed: ok"));
 
                if (no_match) {
                        NDR_PRINT_DEBUG(replUpToDateVectorBlob, &utdv1);
index 28e220d363585548526401772d4dce3b3c30e74d..8322e57bd1ff58f0713a24de3491fcf99556993a 100644 (file)
@@ -185,8 +185,8 @@ static BOOL smb_raw_query_posix_whoami(void *mem_ctx,
 
        printf("\tmapping_flags=0x%08x mapping_mask=0x%08x\n",
                        whoami->mapping_flags, whoami->mapping_mask);
-       printf("\tserver UID=%lld GID=%lld\n",
-                       whoami->server_uid, whoami->server_gid);
+       printf("\tserver UID=%llu GID=%llu\n",
+              (unsigned long long)whoami->server_uid, (unsigned long long)whoami->server_gid);
        printf("\t%u GIDs, %u SIDs, %u SID bytes\n",
                        whoami->num_gids, whoami->num_sids,
                        whoami->num_sid_bytes);