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:
Joel Spadin
2024-12-11 14:00:48 -06:00
committed by GitHub
parent a8f5ab67b5
commit 7013158a67
2 changed files with 5 additions and 5 deletions

View File

@@ -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: