Apply some const to get_lock_*()
authorVolker Lendecke <vl@samba.org>
Sat, 1 Nov 2008 16:22:15 +0000 (17:22 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 1 Nov 2008 18:41:07 +0000 (19:41 +0100)
source3/include/proto.h
source3/smbd/blocking.c
source3/smbd/reply.c

index 2c2232ade8514d7a00a0e6b364e008a9f9e574b1..c78c0a0fa7451fa0839627e6edaeabf529535d31 100644 (file)
@@ -8351,9 +8351,12 @@ NTSTATUS copy_file(TALLOC_CTX *ctx,
                        int count,
                        bool target_is_directory);
 void reply_copy(struct smb_request *req);
-uint32 get_lock_pid( char *data, int data_offset, bool large_file_format);
-uint64_t get_lock_count( char *data, int data_offset, bool large_file_format);
-uint64_t get_lock_offset( char *data, int data_offset, bool large_file_format, bool *err);
+uint32 get_lock_pid(const uint8_t *data, int data_offset,
+                   bool large_file_format);
+uint64_t get_lock_count(const uint8_t *data, int data_offset,
+                       bool large_file_format);
+uint64_t get_lock_offset(const uint8_t *data, int data_offset,
+                        bool large_file_format, bool *err);
 void reply_lockingX(struct smb_request *req);
 void reply_readbmpx(struct smb_request *req);
 void reply_readbs(struct smb_request *req);
index 4374b50eac98e6073470a6dea2cd6dc7851f2d49..14ce237ab8ebc641fa41c97b4fa1afccc710a9fe 100644 (file)
@@ -335,10 +335,11 @@ static void reply_lockingX_error(blocking_lock_record *blr, NTSTATUS status)
        uint32 lock_pid;
        unsigned char locktype = CVAL(inbuf,smb_vwv3);
        bool large_file_format = (locktype & LOCKING_ANDX_LARGE_FILES);
-       char *data;
+       uint8_t *data;
        int i;
 
-       data = smb_buf(inbuf) + ((large_file_format ? 20 : 10)*num_ulocks);
+       data = (uint8_t *)smb_buf(inbuf)
+               + ((large_file_format ? 20 : 10)*num_ulocks);
        
        /* 
         * Data now points at the beginning of the list
@@ -423,10 +424,11 @@ static bool process_lockingX(blocking_lock_record *blr)
        uint64_t count = (uint64_t)0, offset = (uint64_t)0;
        uint32 lock_pid;
        bool large_file_format = (locktype & LOCKING_ANDX_LARGE_FILES);
-       char *data;
+       uint8_t *data;
        NTSTATUS status = NT_STATUS_OK;
 
-       data = smb_buf(inbuf) + ((large_file_format ? 20 : 10)*num_ulocks);
+       data = (uint8_t *)smb_buf(inbuf)
+               + ((large_file_format ? 20 : 10)*num_ulocks);
 
        /* 
         * Data now points at the beginning of the list
index 2d7e55798065b6517bf6511b0d5338f75f107c5d..c5abac77e2204d414ee30f8fc60f0f56b201339c 100644 (file)
@@ -6476,7 +6476,8 @@ void reply_copy(struct smb_request *req)
  Get a lock pid, dealing with large count requests.
 ****************************************************************************/
 
-uint32 get_lock_pid( char *data, int data_offset, bool large_file_format)
+uint32 get_lock_pid(const uint8_t *data, int data_offset,
+                   bool large_file_format)
 {
        if(!large_file_format)
                return (uint32)SVAL(data,SMB_LPID_OFFSET(data_offset));
@@ -6488,7 +6489,8 @@ uint32 get_lock_pid( char *data, int data_offset, bool large_file_format)
  Get a lock count, dealing with large count requests.
 ****************************************************************************/
 
-uint64_t get_lock_count( char *data, int data_offset, bool large_file_format)
+uint64_t get_lock_count(const uint8_t *data, int data_offset,
+                       bool large_file_format)
 {
        uint64_t count = 0;
 
@@ -6560,7 +6562,8 @@ static uint32 map_lock_offset(uint32 high, uint32 low)
  Get a lock offset, dealing with large offset requests.
 ****************************************************************************/
 
-uint64_t get_lock_offset( char *data, int data_offset, bool large_file_format, bool *err)
+uint64_t get_lock_offset(const uint8_t *data, int data_offset,
+                        bool large_file_format, bool *err)
 {
        uint64_t offset = 0;