mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-28 07:51:19 +01:00
gnrc_netapi: declare data for set function as const
This commit is contained in:
parent
e0e02c04c8
commit
8f5f4a370d
@ -204,7 +204,7 @@ int gnrc_netapi_get(kernel_pid_t pid, netopt_t opt, uint16_t context,
|
||||
* wrong.
|
||||
*/
|
||||
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
|
||||
}
|
||||
|
||||
@ -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,
|
||||
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,
|
||||
data, data_len);
|
||||
(void *)data, data_len);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user