Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
8f5f4a37
You need to sign in or sign up before continuing.
Commit
8f5f4a37
authored
6 years ago
by
Martine Lenders
Browse files
Options
Downloads
Patches
Plain Diff
gnrc_netapi: declare `data` for set function as const
parent
e0e02c04
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sys/include/net/gnrc/netapi.h
+1
-1
1 addition, 1 deletion
sys/include/net/gnrc/netapi.h
sys/net/gnrc/netapi/gnrc_netapi.c
+4
-2
4 additions, 2 deletions
sys/net/gnrc/netapi/gnrc_netapi.c
with
5 additions
and
3 deletions
sys/include/net/gnrc/netapi.h
+
1
−
1
View file @
8f5f4a37
...
@@ -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
}
}
...
...
This diff is collapsed.
Click to expand it.
sys/net/gnrc/netapi/gnrc_netapi.c
+
4
−
2
View file @
8f5f4a37
...
@@ -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
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment