s4:torture/raw/lock - Fix "discard const" warnings by introducing "discard_const_p"s
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Fri, 20 Nov 2009 10:35:13 +0000 (11:35 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 1 Dec 2009 05:48:47 +0000 (16:48 +1100)
source4/torture/raw/lock.c

index 8b49df5de5c70a4642d21bbe8bf78bf769106770..1ccba61c55a80ea5fe3188d3ba31475a39628a14 100644 (file)
@@ -1404,11 +1404,13 @@ static bool test_zerobytelocks(struct torture_context *tctx, struct smbcli_state
                io.lockx.in.ulock_cnt = 0;
                io.lockx.in.lock_cnt = 1;
 
-               io.lockx.in.locks = &zero_byte_tests[i].lock1;
+               io.lockx.in.locks = discard_const_p(struct smb_lock_entry,
+                                                   &zero_byte_tests[i].lock1);
                status = smb_raw_lock(cli->tree, &io);
                CHECK_STATUS(status, NT_STATUS_OK);
 
-               io.lockx.in.locks = &zero_byte_tests[i].lock2;
+               io.lockx.in.locks = discard_const_p(struct smb_lock_entry,
+                                                   &zero_byte_tests[i].lock2);
                status = smb_raw_lock(cli->tree, &io);
 
                if (NT_STATUS_EQUAL(zero_byte_tests[i].exp_status,
@@ -1433,7 +1435,8 @@ static bool test_zerobytelocks(struct torture_context *tctx, struct smbcli_state
                        CHECK_STATUS(status, NT_STATUS_OK);
                }
 
-               io.lockx.in.locks = &zero_byte_tests[i].lock1;
+               io.lockx.in.locks = discard_const_p(struct smb_lock_entry,
+                                                   &zero_byte_tests[i].lock1);
                status = smb_raw_lock(cli->tree, &io);
                CHECK_STATUS(status, NT_STATUS_OK);
        }