summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/gencache.c2
-rw-r--r--source3/lib/interface.c2
-rw-r--r--source3/lib/interfaces.c4
-rw-r--r--source3/lib/messages.c2
-rw-r--r--source3/lib/netapi/samr.c2
-rw-r--r--source3/lib/netapi/user.c2
-rw-r--r--source3/lib/smbldap.c2
-rw-r--r--source3/lib/tallocmsg.c2
-rw-r--r--source3/lib/util.c8
-rw-r--r--source3/lib/util_sock.c4
10 files changed, 15 insertions, 15 deletions
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c
index 67c37f34e7..19cc7c947c 100644
--- a/source3/lib/gencache.c
+++ b/source3/lib/gencache.c
@@ -125,7 +125,7 @@ again:
static TDB_DATA last_stabilize_key(void)
{
TDB_DATA result;
- result.dptr = (uint8_t *)"@LAST_STABILIZED";
+ result.dptr = discard_const_p(uint8_t, "@LAST_STABILIZED");
result.dsize = 17;
return result;
}
diff --git a/source3/lib/interface.c b/source3/lib/interface.c
index 30e94069a5..ac68324de9 100644
--- a/source3/lib/interface.c
+++ b/source3/lib/interface.c
@@ -305,7 +305,7 @@ static void add_interface(const struct iface_struct *ifs)
char addr[INET6_ADDRSTRLEN];
struct interface *iface;
- if (iface_find((struct sockaddr *)&ifs->ip, False)) {
+ if (iface_find((const struct sockaddr *)&ifs->ip, False)) {
DEBUG(3,("add_interface: not adding duplicate interface %s\n",
print_sockaddr(addr, sizeof(addr), &ifs->ip) ));
return;
diff --git a/source3/lib/interfaces.c b/source3/lib/interfaces.c
index e40eaa9142..a2dce97eb6 100644
--- a/source3/lib/interfaces.c
+++ b/source3/lib/interfaces.c
@@ -81,13 +81,13 @@ static void make_bcast_or_net(struct sockaddr_storage *pss_out,
#if defined(HAVE_IPV6)
if (pss_in->ss_family == AF_INET6) {
p = (char *)&((struct sockaddr_in6 *)pss_out)->sin6_addr;
- pmask = (char *)&((struct sockaddr_in6 *)nmask)->sin6_addr;
+ pmask = discard_const_p(char, &((const struct sockaddr_in6 *)nmask)->sin6_addr);
len = 16;
}
#endif
if (pss_in->ss_family == AF_INET) {
p = (char *)&((struct sockaddr_in *)pss_out)->sin_addr;
- pmask = (char *)&((struct sockaddr_in *)nmask)->sin_addr;
+ pmask = discard_const_p(char, &((const struct sockaddr_in *)nmask)->sin_addr);
len = 4;
}
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index 4335554c2a..7b2b8c1c17 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -112,7 +112,7 @@ static int traverse_fn(struct db_record *rec, const struct server_id *id,
* the msg has already been deleted from the messages.tdb.*/
status = messaging_send_buf(msg_all->msg_ctx, *id, msg_all->msg_type,
- (uint8 *)msg_all->buf, msg_all->len);
+ (const uint8 *)msg_all->buf, msg_all->len);
if (NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
diff --git a/source3/lib/netapi/samr.c b/source3/lib/netapi/samr.c
index 544698004a..1c3a94ee9c 100644
--- a/source3/lib/netapi/samr.c
+++ b/source3/lib/netapi/samr.c
@@ -240,7 +240,7 @@ WERROR libnetapi_samr_open_builtin_domain(struct libnetapi_ctx *mem_ctx,
status = dcerpc_samr_OpenDomain(b, mem_ctx,
connect_handle,
builtin_mask,
- CONST_DISCARD(struct dom_sid *, &global_sid_Builtin),
+ discard_const_p(struct dom_sid, &global_sid_Builtin),
builtin_handle,
&result);
if (!NT_STATUS_IS_OK(status)) {
diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c
index 653ece1385..7831e20a0a 100644
--- a/source3/lib/netapi/user.c
+++ b/source3/lib/netapi/user.c
@@ -575,7 +575,7 @@ WERROR NetUserDel_r(struct libnetapi_ctx *ctx,
status = dcerpc_samr_OpenDomain(b, talloc_tos(),
&connect_handle,
SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT,
- CONST_DISCARD(struct dom_sid *, &global_sid_Builtin),
+ discard_const_p(struct dom_sid, &global_sid_Builtin),
&builtin_handle,
&result);
if (!NT_STATUS_IS_OK(status)) {
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index fe43237464..002b1706b2 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -1562,7 +1562,7 @@ int smbldap_search_paged(struct smbldap_state *ldap_state,
}
ber_flatten(cookie_be, &cookie_bv);
- pr.ldctl_oid = CONST_DISCARD(char *, ADS_PAGE_CTL_OID);
+ pr.ldctl_oid = discard_const_p(char, ADS_PAGE_CTL_OID);
pr.ldctl_iscritical = (char) critical;
pr.ldctl_value.bv_len = cookie_bv->bv_len;
pr.ldctl_value.bv_val = cookie_bv->bv_val;
diff --git a/source3/lib/tallocmsg.c b/source3/lib/tallocmsg.c
index da380c9335..9a0ce8ada1 100644
--- a/source3/lib/tallocmsg.c
+++ b/source3/lib/tallocmsg.c
@@ -65,7 +65,7 @@ static void msg_pool_usage_helper(const void *ptr, int depth, int max_depth, int
(unsigned long)talloc_total_blocks(ptr),
talloc_reference_count(ptr),
MIN(50, talloc_get_size(ptr)),
- (char *)ptr);
+ (const char *)ptr);
return;
}
diff --git a/source3/lib/util.c b/source3/lib/util.c
index cd856ee355..b0b6377087 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -335,7 +335,7 @@ void show_msg(const char *buf)
if (DEBUGLEVEL < 50)
bcc = MIN(bcc, 512);
- dump_data(10, (const uint8 *)smb_buf(buf), bcc);
+ dump_data(10, (const uint8 *)smb_buf_const(buf), bcc);
}
/*******************************************************************
@@ -1321,10 +1321,10 @@ bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensit
if possible.
********************************************************************/
-void set_namearray(name_compare_entry **ppname_array, const char *namelist)
+void set_namearray(name_compare_entry **ppname_array, char *namelist)
{
char *name_end;
- char *nameptr = (char *)namelist;
+ char *nameptr = namelist;
int num_entries = 0;
int i;
@@ -1367,7 +1367,7 @@ void set_namearray(name_compare_entry **ppname_array, const char *namelist)
}
/* Now copy out the names */
- nameptr = (char *)namelist;
+ nameptr = namelist;
i = 0;
while(*nameptr) {
if ( *nameptr == '/' ) {
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 0e1bfc04d1..ca355c2709 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -306,7 +306,7 @@ ssize_t write_data(int fd, const char *buffer, size_t N)
{
struct iovec iov;
- iov.iov_base = CONST_DISCARD(void *, buffer);
+ iov.iov_base = discard_const_p(void, buffer);
iov.iov_len = N;
return write_data_iov(fd, &iov, 1);
}
@@ -960,7 +960,7 @@ static bool matchname(const char *remotehost,
continue;
}
if (sockaddr_equal((const struct sockaddr *)res->ai_addr,
- (struct sockaddr *)pss)) {
+ (const struct sockaddr *)pss)) {
freeaddrinfo(ailist);
return true;
}