diff options
author | Jeremy Allison <jra@samba.org> | 2011-05-05 14:22:11 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-05-05 23:56:07 +0200 |
commit | 02af3075858814811bc30f03623eb6715f9b7a78 (patch) | |
tree | 10e10b4df41d6a8059ca136e76901f2a8af5bce4 /source3/smbd | |
parent | e131c94ac1b06cc49b1c25717d3496dba8b0b3df (diff) | |
download | samba-02af3075858814811bc30f03623eb6715f9b7a78.tar.gz |
More simple const fixes.
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/lanman.c | 8 | ||||
-rw-r--r-- | source3/smbd/msdfs.c | 2 | ||||
-rw-r--r-- | source3/smbd/notify_internal.c | 2 | ||||
-rw-r--r-- | source3/smbd/sesssetup.c | 4 | ||||
-rw-r--r-- | source3/smbd/smb2_server.c | 8 | ||||
-rw-r--r-- | source3/smbd/smb2_sesssetup.c | 2 | ||||
-rw-r--r-- | source3/smbd/smb2_tcon.c | 2 |
7 files changed, 14 insertions, 14 deletions
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c index 79737b01b5..b5171867a3 100644 --- a/source3/smbd/lanman.c +++ b/source3/smbd/lanman.c @@ -612,9 +612,9 @@ static void fill_printq_info_52(struct spoolss_DriverInfo3 *driver, { int i; fstring location; - trim_string((char *)driver->driver_path, "\\print$\\WIN40\\0\\", 0); - trim_string((char *)driver->data_file, "\\print$\\WIN40\\0\\", 0); - trim_string((char *)driver->help_file, "\\print$\\WIN40\\0\\", 0); + trim_string(discard_const_p(char, driver->driver_path), "\\print$\\WIN40\\0\\", 0); + trim_string(discard_const_p(char, driver->data_file), "\\print$\\WIN40\\0\\", 0); + trim_string(discard_const_p(char, driver->help_file), "\\print$\\WIN40\\0\\", 0); PACKI(desc, "W", 0x0400); /* don't know */ PACKS(desc, "z", driver->driver_name); /* long printer name */ @@ -641,7 +641,7 @@ static void fill_printq_info_52(struct spoolss_DriverInfo3 *driver, for ( i=0; i<count && driver->dependent_files && *driver->dependent_files[i]; i++) { - trim_string((char *)driver->dependent_files[i], "\\print$\\WIN40\\0\\", 0); + trim_string(discard_const_p(char, driver->dependent_files[i]), "\\print$\\WIN40\\0\\", 0); PACKS(desc,"z",driver->dependent_files[i]); /* driver files to copy */ DEBUG(3,("Dependent File: %s:\n", driver->dependent_files[i])); } diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index ab67ac8596..82abda79de 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -1786,7 +1786,7 @@ NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx, * Once srvstr_get_path() uses talloc it'll * be a talloced ptr anyway. */ - *pp_name_out = CONST_DISCARD(char *,name_in); + *pp_name_out = discard_const_p(char, name_in); } return status; } diff --git a/source3/smbd/notify_internal.c b/source3/smbd/notify_internal.c index a8eaf79392..050f931122 100644 --- a/source3/smbd/notify_internal.c +++ b/source3/smbd/notify_internal.c @@ -597,7 +597,7 @@ NTSTATUS notify_remove_onelevel(struct notify_context *notify, rec = notify->db_onelevel->fetch_locked( notify->db_onelevel, array, - make_tdb_data((uint8_t *)fid, sizeof(*fid))); + make_tdb_data((const uint8_t *)fid, sizeof(*fid))); if (rec == NULL) { DEBUG(10, ("notify_remove_onelevel: fetch_locked for %s failed" "\n", file_id_string_tos(fid))); diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index 3631d589f5..026380e3e6 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -1043,7 +1043,7 @@ static void reply_sesssetup_and_X_spnego(struct smb_request *req) file_save("negotiate.dat", blob1.data, blob1.length); #endif - p2 = (char *)req->buf + blob1.length; + p2 = (const char *)req->buf + blob1.length; p2 += srvstr_pull_req_talloc(talloc_tos(), req, &tmp, p2, STR_TERMINATE); @@ -1685,7 +1685,7 @@ void reply_sesssetup_and_X(struct smb_request *req) data_blob_free(&lm_resp); SSVAL(req->outbuf,smb_uid,sess_vuid); - SSVAL(req->inbuf,smb_uid,sess_vuid); + SSVAL(discard_const_p(char, req->inbuf),smb_uid,sess_vuid); req->vuid = sess_vuid; if (!sconn->smb1.sessions.done_sesssetup) { diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index 7cbe90a773..1bb3cc22ce 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -269,15 +269,15 @@ static NTSTATUS smbd_smb2_request_create(struct smbd_server_connection *sconn, memcpy(req->in.nbt_hdr, inbuf, 4); ofs = 0; - req->in.vector[0].iov_base = (void *)req->in.nbt_hdr; + req->in.vector[0].iov_base = discard_const_p(void, req->in.nbt_hdr); req->in.vector[0].iov_len = 4; ofs += req->in.vector[0].iov_len; - req->in.vector[1].iov_base = (void *)(inbuf + ofs); + req->in.vector[1].iov_base = discard_const_p(void, (inbuf + ofs)); req->in.vector[1].iov_len = SMB2_HDR_BODY; ofs += req->in.vector[1].iov_len; - req->in.vector[2].iov_base = (void *)(inbuf + ofs); + req->in.vector[2].iov_base = discard_const_p(void, (inbuf + ofs)); req->in.vector[2].iov_len = SVAL(inbuf, ofs) & 0xFFFE; ofs += req->in.vector[2].iov_len; @@ -285,7 +285,7 @@ static NTSTATUS smbd_smb2_request_create(struct smbd_server_connection *sconn, return NT_STATUS_INVALID_PARAMETER; } - req->in.vector[3].iov_base = (void *)(inbuf + ofs); + req->in.vector[3].iov_base = discard_const_p(void, (inbuf + ofs)); req->in.vector[3].iov_len = size - ofs; ofs += req->in.vector[3].iov_len; diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c index d727ee98b0..c33d1c61be 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -844,7 +844,7 @@ NTSTATUS smbd_smb2_request_check_session(struct smbd_smb2_request *req) if (chained_fixup) { /* Fix up our own outhdr. */ outhdr = (const uint8_t *)req->out.vector[i].iov_base; - SBVAL(outhdr, SMB2_HDR_SESSION_ID, in_session_id); + SBVAL(discard_const_p(uint8_t, outhdr), SMB2_HDR_SESSION_ID, in_session_id); } return NT_STATUS_OK; } diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c index bdd18d5d07..1b4aa79070 100644 --- a/source3/smbd/smb2_tcon.c +++ b/source3/smbd/smb2_tcon.c @@ -331,7 +331,7 @@ NTSTATUS smbd_smb2_request_check_tcon(struct smbd_smb2_request *req) if (chained_fixup) { /* Fix up our own outhdr. */ outhdr = (const uint8_t *)req->out.vector[i].iov_base; - SIVAL(outhdr, SMB2_HDR_TID, in_tid); + SIVAL(discard_const_p(uint8_t, outhdr), SMB2_HDR_TID, in_tid); } return NT_STATUS_OK; |