s4:torture - suppress printf "%llu" on uint64_t variables warnings
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 1 Nov 2010 10:17:37 +0000 (11:17 +0100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 1 Nov 2010 10:31:33 +0000 (11:31 +0100)
The signed/unsignedness does match (always unsigned). The bitlength (64 bit) on
all regular platforms does also. Therefore simply add a cast to
"unsigned long long".

source4/torture/drs/rpc/dssync.c
source4/torture/raw/lock.c
source4/torture/smb2/lock.c
source4/torture/smb2/oplock.c

index 19a4baf849e8d249e2ed882dab371f590f1d395e..522123c366b711b52a98d3f9e95baf002a02cdff 100644 (file)
@@ -793,16 +793,16 @@ static bool test_GetNCChanges(struct torture_context *tctx,
                                torture_comment(tctx,
                                                "start[%d] tmp_higest_usn: %llu , highest_usn: %llu\n",
                                                y,
-                                               r.in.req->req5.highwatermark.tmp_highest_usn,
-                                               r.in.req->req5.highwatermark.highest_usn);
+                                               (unsigned long long) r.in.req->req5.highwatermark.tmp_highest_usn,
+                                               (unsigned long long) r.in.req->req5.highwatermark.highest_usn);
                        }
 
                        if (r.in.level == 8) {
                                torture_comment(tctx,
                                                "start[%d] tmp_higest_usn: %llu , highest_usn: %llu\n",
                                                y,
-                                               r.in.req->req8.highwatermark.tmp_highest_usn,
-                                               r.in.req->req8.highwatermark.highest_usn);
+                                               (unsigned long long) r.in.req->req8.highwatermark.tmp_highest_usn,
+                                               (unsigned long long) r.in.req->req8.highwatermark.highest_usn);
                        }
 
                        status = dcerpc_drsuapi_DsGetNCChanges_r(ctx->new_dc.drsuapi.drs_handle, ctx, &r);
@@ -822,8 +822,8 @@ static bool test_GetNCChanges(struct torture_context *tctx,
                                torture_comment(tctx,
                                                "end[%d] tmp_highest_usn: %llu , highest_usn: %llu\n",
                                                y,
-                                               ctr1->new_highwatermark.tmp_highest_usn,
-                                               ctr1->new_highwatermark.highest_usn);
+                                               (unsigned long long) ctr1->new_highwatermark.tmp_highest_usn,
+                                               (unsigned long long) ctr1->new_highwatermark.highest_usn);
 
                                if (!test_analyse_objects(tctx, ctx, nc_dn_str, &ctr1->mapping_ctr,  ctr1->object_count,
                                                          ctr1->first_object, &gensec_skey)) {
@@ -857,8 +857,8 @@ static bool test_GetNCChanges(struct torture_context *tctx,
                                torture_comment(tctx,
                                                "end[%d] tmp_highest_usn: %llu , highest_usn: %llu\n",
                                                y,
-                                               ctr6->new_highwatermark.tmp_highest_usn,
-                                               ctr6->new_highwatermark.highest_usn);
+                                               (unsigned long long) ctr6->new_highwatermark.tmp_highest_usn,
+                                               (unsigned long long) ctr6->new_highwatermark.highest_usn);
 
                                if (!test_analyse_objects(tctx, ctx, nc_dn_str, &ctr6->mapping_ctr,  ctr6->object_count,
                                                          ctr6->first_object, &gensec_skey)) {
index 1643005f27f55f7b17fc9d135700457f226e0eca..17757e41160f8843065240294509c860be8b25df 100644 (file)
@@ -1611,11 +1611,11 @@ static bool test_zerobytelocks(struct torture_context *tctx, struct smbcli_state
             i++) {
                torture_comment(tctx, "  ... {%d, %llu, %llu} + {%d, %llu, %llu} = %s\n",
                    zero_byte_tests[i].lock1.pid,
-                   zero_byte_tests[i].lock1.offset,
-                   zero_byte_tests[i].lock1.count,
+                   (unsigned long long) zero_byte_tests[i].lock1.offset,
+                   (unsigned long long) zero_byte_tests[i].lock1.count,
                    zero_byte_tests[i].lock2.pid,
-                   zero_byte_tests[i].lock2.offset,
-                   zero_byte_tests[i].lock2.count,
+                   (unsigned long long) zero_byte_tests[i].lock2.offset,
+                   (unsigned long long) zero_byte_tests[i].lock2.count,
                    nt_errstr(zero_byte_tests[i].exp_status));
 
                /* Lock both locks. */
index 508358ea613471158ad10eeb8fa2672f3670b3e5..ad66b6236bd50b70fb674b895e439b24e70db7ac 100644 (file)
@@ -1373,10 +1373,10 @@ static bool test_zerobytelength(struct torture_context *torture,
        for (i = 0; i < ARRAY_SIZE(zero_byte_tests); i++) {
                torture_comment(torture,
                    "  ... {%llu, %llu} + {%llu, %llu} = %s\n",
-                   zero_byte_tests[i].lock1.offset,
-                   zero_byte_tests[i].lock1.length,
-                   zero_byte_tests[i].lock2.offset,
-                   zero_byte_tests[i].lock2.length,
+                   (unsigned long long) zero_byte_tests[i].lock1.offset,
+                   (unsigned long long) zero_byte_tests[i].lock1.length,
+                   (unsigned long long) zero_byte_tests[i].lock2.offset,
+                   (unsigned long long) zero_byte_tests[i].lock2.length,
                    nt_errstr(zero_byte_tests[i].status));
 
                /* Lock both locks. */
@@ -1410,10 +1410,10 @@ static bool test_zerobytelength(struct torture_context *torture,
        for (i = 0; i < ARRAY_SIZE(zero_byte_tests); i++) {
                torture_comment(torture,
                    "  ... {%llu, %llu} + {%llu, %llu} = %s\n",
-                   zero_byte_tests[i].lock1.offset,
-                   zero_byte_tests[i].lock1.length,
-                   zero_byte_tests[i].lock2.offset,
-                   zero_byte_tests[i].lock2.length,
+                   (unsigned long long) zero_byte_tests[i].lock1.offset,
+                   (unsigned long long) zero_byte_tests[i].lock1.length,
+                   (unsigned long long) zero_byte_tests[i].lock2.offset,
+                   (unsigned long long) zero_byte_tests[i].lock2.length,
                    nt_errstr(zero_byte_tests[i].status));
 
                /* Lock both locks. */
@@ -2524,7 +2524,7 @@ static bool test_range(struct torture_context *torture,
                CHECK_STATUS_CMT(status, NT_STATUS_OK,
                                 talloc_asprintf(torture,
                                     "lock h failed at offset %#llx ",
-                                    el[0].offset));
+                                    (unsigned long long) el[0].offset));
 
                lck.in.file.handle      = h2;
                el[0].offset            = offset - 2;
@@ -2532,7 +2532,7 @@ static bool test_range(struct torture_context *torture,
                CHECK_STATUS_CMT(status, NT_STATUS_OK,
                                 talloc_asprintf(torture,
                                     "lock h2 failed at offset %#llx ",
-                                    el[0].offset));
+                                    (unsigned long long) el[0].offset));
        }
 
        torture_comment(torture, "  testing %d locks\n", torture_numops);
@@ -2546,7 +2546,8 @@ static bool test_range(struct torture_context *torture,
                CHECK_STATUS_CMT(status, NT_STATUS_LOCK_NOT_GRANTED,
                                 talloc_asprintf(torture,
                                     "lock h at offset %#llx should not have "
-                                    "succeeded ", el[0].offset));
+                                    "succeeded ",
+                                    (unsigned long long) el[0].offset));
 
                lck.in.file.handle      = h;
                el[0].offset            = offset - 2;
@@ -2554,7 +2555,8 @@ static bool test_range(struct torture_context *torture,
                CHECK_STATUS_CMT(status, NT_STATUS_LOCK_NOT_GRANTED,
                                 talloc_asprintf(torture,
                                     "lock h2 at offset %#llx should not have "
-                                    "succeeded ", el[0].offset));
+                                    "succeeded ",
+                                    (unsigned long long) el[0].offset));
 
                lck.in.file.handle      = h2;
                el[0].offset            = offset - 1;
@@ -2562,7 +2564,8 @@ static bool test_range(struct torture_context *torture,
                CHECK_STATUS_CMT(status, NT_STATUS_LOCK_NOT_GRANTED,
                                 talloc_asprintf(torture,
                                     "lock h at offset %#llx should not have "
-                                    "succeeded ", el[0].offset));
+                                    "succeeded ",
+                                    (unsigned long long) el[0].offset));
 
                lck.in.file.handle      = h2;
                el[0].offset            = offset - 2;
@@ -2570,7 +2573,8 @@ static bool test_range(struct torture_context *torture,
                CHECK_STATUS_CMT(status, NT_STATUS_LOCK_NOT_GRANTED,
                                 talloc_asprintf(torture,
                                     "lock h2 at offset %#llx should not have "
-                                    "succeeded ", el[0].offset));
+                                    "succeeded ",
+                                    (unsigned long long) el[0].offset));
        }
 
        torture_comment(torture, "  removing %d locks\n", torture_numops);
@@ -2586,7 +2590,7 @@ static bool test_range(struct torture_context *torture,
                CHECK_STATUS_CMT(status, NT_STATUS_OK,
                                 talloc_asprintf(torture,
                                     "unlock from h failed at offset %#llx ",
-                                    el[0].offset));
+                                    (unsigned long long) el[0].offset));
 
                lck.in.file.handle      = h2;
                el[0].offset            = offset - 2;
@@ -2594,7 +2598,7 @@ static bool test_range(struct torture_context *torture,
                CHECK_STATUS_CMT(status, NT_STATUS_OK,
                                 talloc_asprintf(torture,
                                     "unlock from h2 failed at offset %#llx ",
-                                    el[0].offset));
+                                    (unsigned long long) el[0].offset));
        }
 
 done:
index aa0b92dc80d4b9147a9693a982fc0be5b31ca4f9..5261b584733e44685b6fbf2dd28f506857618c10 100644 (file)
@@ -3514,7 +3514,8 @@ static bool torture_oplock_handler_hold(struct smb2_transport *transport,
 
        if (i == ARRAY_SIZE(hold_info)) {
                printf("oplock break for unknown handle 0x%llx%llx\n",
-                      handle->data[0], handle->data[1]);
+                      (unsigned long long) handle->data[0],
+                      (unsigned long long) handle->data[1]);
                return false;
        }