From dfa4e5f78440e375a9c47eab913c5980c1aa640b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 23 Aug 2007 02:10:17 +0000 Subject: r24631: Fix up format warnings, found on my Fedora 7 x86_64 workstation. Andrew Bartlett (This used to be commit 3d74d178bfd89127ff387939e848b240e638cc35) --- source4/dsdb/schema/schema_init.c | 4 ++-- source4/dsdb/schema/schema_syntax.c | 4 ++-- source4/lib/gendb.c | 1 + source4/lib/util/tests/idtree.c | 9 +++++---- source4/librpc/tools/ndrdump.c | 6 ++++-- source4/smbd/server.c | 2 +- source4/torture/ldap/uptodatevector.c | 6 +++--- source4/torture/unix/whoami.c | 4 ++-- 8 files changed, 20 insertions(+), 16 deletions(-) diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index ce7645c4546..41b53be9775 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -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 \ diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c index db34e58f711..760417b6760 100644 --- a/source4/dsdb/schema/schema_syntax.c +++ b/source4/dsdb/schema/schema_syntax.c @@ -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); diff --git a/source4/lib/gendb.c b/source4/lib/gendb.c index 097a2795f4a..003384b1ee9 100644 --- a/source4/lib/gendb.c +++ b/source4/lib/gendb.c @@ -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 diff --git a/source4/lib/util/tests/idtree.c b/source4/lib/util/tests/idtree.c index 448abb5c040..d89fb8c4897 100644 --- a/source4/lib/util/tests/idtree.c +++ b/source4/lib/util/tests/idtree.c @@ -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); diff --git a/source4/librpc/tools/ndrdump.c b/source4/librpc/tools/ndrdump.c index 4b840fed5a4..8a5e55f91ee 100644 --- a/source4/librpc/tools/ndrdump.c +++ b/source4/librpc/tools/ndrdump.c @@ -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; diff --git a/source4/smbd/server.c b/source4/smbd/server.c index d164c5054ab..7731db85f87 100644 --- a/source4/smbd/server.c +++ b/source4/smbd/server.c @@ -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); } diff --git a/source4/torture/ldap/uptodatevector.c b/source4/torture/ldap/uptodatevector.c index 470c2f247aa..0ff9948cad5 100644 --- a/source4/torture/ldap/uptodatevector.c +++ b/source4/torture/ldap/uptodatevector.c @@ -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); diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c index 28e220d3635..8322e57bd1f 100644 --- a/source4/torture/unix/whoami.c +++ b/source4/torture/unix/whoami.c @@ -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); -- cgit