forked from kofal.net/zmk
fix: Fix warnings in nanopb encoding code (#2643)
The "arg" field on nanopb structs is a void* because it is shared between the encode and decode callbacks, even though the encode callback probably should not modify the data. We are passing const data using this non-const pointer, which causes warnings about discarding const. This commit explicitly casts to void* to suppress these warnings.
This commit is contained in:
@@ -84,7 +84,7 @@ static bool encode_value_description(pb_ostream_t *stream, const pb_field_t *fie
|
||||
zmk_behaviors_BehaviorParameterValueDescription desc =
|
||||
zmk_behaviors_BehaviorParameterValueDescription_init_zero;
|
||||
desc.name.funcs.encode = encode_value_description_name;
|
||||
desc.name.arg = val;
|
||||
desc.name.arg = (void *)val;
|
||||
|
||||
switch (val->type) {
|
||||
case BEHAVIOR_PARAMETER_VALUE_TYPE_VALUE:
|
||||
|
||||
Reference in New Issue
Block a user