Skip to content
Snippets Groups Projects
Commit 8f5f4a37 authored by Martine Lenders's avatar Martine Lenders
Browse files

gnrc_netapi: declare `data` for set function as const

parent e0e02c04
No related branches found
No related tags found
No related merge requests found
...@@ -204,7 +204,7 @@ int gnrc_netapi_get(kernel_pid_t pid, netopt_t opt, uint16_t context, ...@@ -204,7 +204,7 @@ int gnrc_netapi_get(kernel_pid_t pid, netopt_t opt, uint16_t context,
* wrong. * wrong.
*/ */
int gnrc_netapi_set(kernel_pid_t pid, netopt_t opt, uint16_t context, int gnrc_netapi_set(kernel_pid_t pid, netopt_t opt, uint16_t context,
void *data, size_t data_len); const void *data, size_t data_len);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -163,8 +163,10 @@ int gnrc_netapi_get(kernel_pid_t pid, netopt_t opt, uint16_t context, ...@@ -163,8 +163,10 @@ int gnrc_netapi_get(kernel_pid_t pid, netopt_t opt, uint16_t context,
} }
int gnrc_netapi_set(kernel_pid_t pid, netopt_t opt, uint16_t context, int gnrc_netapi_set(kernel_pid_t pid, netopt_t opt, uint16_t context,
void *data, size_t data_len) const void *data, size_t data_len)
{ {
/* disregard const pointer. This *should* be safe and any modification
* to `data` should be considered a bug */
return _get_set(pid, GNRC_NETAPI_MSG_TYPE_SET, opt, context, return _get_set(pid, GNRC_NETAPI_MSG_TYPE_SET, opt, context,
data, data_len); (void *)data, data_len);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment