Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix warnings in nanopb encoding code #2643

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/studio/behavior_subsystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions app/src/studio/keymap_subsystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ static bool encode_layouts(pb_ostream_t *stream, const pb_field_t *field, void *
zmk_keymap_PhysicalLayout layout = zmk_keymap_PhysicalLayout_init_zero;

layout.name.funcs.encode = encode_layout_name;
layout.name.arg = l;
layout.name.arg = (void *)l;

layout.keys.funcs.encode = encode_layout_keys;
layout.keys.arg = l;
layout.keys.arg = (void *)l;

if (!pb_encode_submessage(stream, &zmk_keymap_PhysicalLayout_msg, &layout)) {
LOG_WRN("Failed to encode layout submessage");
Expand Down Expand Up @@ -459,10 +459,10 @@ zmk_studio_Response restore_layer(const zmk_studio_Request *req) {
resp.result.ok.id = restore_req->layer_id;

resp.result.ok.name.funcs.encode = encode_layer_name;
resp.result.ok.name.arg = &restore_req->layer_id;
resp.result.ok.name.arg = (void *)&restore_req->layer_id;

resp.result.ok.bindings.funcs.encode = encode_layer_bindings;
resp.result.ok.bindings.arg = &restore_req->layer_id;
resp.result.ok.bindings.arg = (void *)&restore_req->layer_id;

raise_zmk_studio_rpc_notification((struct zmk_studio_rpc_notification){
.notification = KEYMAP_NOTIFICATION(unsaved_changes_status_changed, true)});
Expand Down