Skip to content

Commit 1fd8f61

Browse files
author
Krzysztof Parzyszek
authored
[Hexagon] Don't use {} initialization with FastRPC structures (#9033)
The data members in FastRPC structures aren't guaranteed to remain in the same order. Replace aggregate initialization with direct, member-by-member initialization.
1 parent af61d1e commit 1fd8f61

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/runtime/hexagon/launcher/launcher_android.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
#include "launcher_rpc.h"
3333

3434
AEEResult enable_unsigned_pd(bool enable) {
35-
remote_rpc_control_unsigned_module data{static_cast<int>(enable), CDSP_DOMAIN_ID};
35+
remote_rpc_control_unsigned_module data;
36+
data.domain = CDSP_DOMAIN_ID;
37+
data.enable = static_cast<int>(enable);
3638
AEEResult rc = remote_session_control(DSPRPC_CONTROL_UNSIGNED_MODULE, &data, sizeof(data));
3739
if (rc != AEE_SUCCESS) {
3840
std::cout << "error " << (enable ? "enabling" : "disabling") << " unsigned PD\n";
@@ -41,8 +43,11 @@ AEEResult enable_unsigned_pd(bool enable) {
4143
}
4244

4345
AEEResult set_remote_stack_size(int size) {
44-
remote_rpc_thread_params th_data{CDSP_DOMAIN_ID, -1, size};
45-
AEEResult rc = remote_session_control(FASTRPC_THREAD_PARAMS, &th_data, sizeof(th_data));
46+
remote_rpc_thread_params data;
47+
data.domain = CDSP_DOMAIN_ID;
48+
data.prio = -1;
49+
data.stack_size = size;
50+
AEEResult rc = remote_session_control(FASTRPC_THREAD_PARAMS, &data, sizeof(data));
4651
if (rc != AEE_SUCCESS) {
4752
std::cout << "error setting remote stack size: " << std::hex << rc << '\n';
4853
}

0 commit comments

Comments
 (0)