diff options
author | 2024-08-23 11:45:28 +0800 | |
---|---|---|
committer | 2024-08-23 13:34:41 +0800 | |
commit | e31b4169c1f6bb12f480134213822d96a460c662 (patch) | |
tree | 393e0295e8cb5de0fe6588aa3c95bd08bc26e916 | |
parent | 2098b15ec2b642b69f93b59298f765c72e7c7a09 (diff) |
floss: Fix build faliure: non-void function does not return a value
Also enabled Werror in build.py and fixed a warning in bt_service.
Bug: 290844854
Bug: 361684591
Tag: #floss
Test: mmm packages/modules/Bluetooth
Test: USE=floss_upstream emerge-nami floss
Flag: EXEMPT, Floss-only changes
Change-Id: If832a37a4bd466b0862ca0c4773919b80239fb2f
-rwxr-xr-x | build.py | 2 | ||||
-rw-r--r-- | system/btif/src/bluetooth.cc | 2 | ||||
-rw-r--r-- | system/gd/rust/linux/service/src/main.rs | 2 | ||||
-rw-r--r-- | system/include/hardware/bluetooth.h | 2 |
4 files changed, 4 insertions, 4 deletions
@@ -380,7 +380,7 @@ class HostBuild(): 'enable_exceptions': os.environ.get('CXXEXCEPTIONS', 0) == '1', 'external_cflags': [], 'external_cxxflags': ["-DNDEBUG"], - 'enable_werror': False, + 'enable_werror': True, } if clang: diff --git a/system/btif/src/bluetooth.cc b/system/btif/src/bluetooth.cc index 6a9a5728b6..d46d594591 100644 --- a/system/btif/src/bluetooth.cc +++ b/system/btif/src/bluetooth.cc @@ -432,7 +432,7 @@ static bool is_profile(const char* p1, const char* p2) { #ifdef TARGET_FLOSS static int global_hci_adapter = 0; -static int set_adapter_index(int adapter) { global_hci_adapter = adapter; } +static void set_adapter_index(int adapter) { global_hci_adapter = adapter; } int GetAdapterIndex() { return global_hci_adapter; } #else int GetAdapterIndex() { return 0; } // Unsupported outside of FLOSS diff --git a/system/gd/rust/linux/service/src/main.rs b/system/gd/rust/linux/service/src/main.rs index e9700c6bb2..17a0fa1f3b 100644 --- a/system/gd/rust/linux/service/src/main.rs +++ b/system/gd/rust/linux/service/src/main.rs @@ -99,7 +99,7 @@ fn main() -> Result<(), Box<dyn Error>> { let hci_index = matches.value_of("hci").map_or(0, |idx| idx.parse::<i32>().unwrap_or(0)); // The remaining flags are passed down to Fluoride as is. - let mut init_flags: Vec<String> = match matches.values_of("init-flags") { + let init_flags: Vec<String> = match matches.values_of("init-flags") { Some(args) => args.map(String::from).collect(), None => vec![], }; diff --git a/system/include/hardware/bluetooth.h b/system/include/hardware/bluetooth.h index faf67a4bbf..5d7de41006 100644 --- a/system/include/hardware/bluetooth.h +++ b/system/include/hardware/bluetooth.h @@ -665,7 +665,7 @@ typedef struct { size_t size; #ifdef TARGET_FLOSS /** set index of the adapter to use */ - int (*set_adapter_index)(int adapter_index); + void (*set_adapter_index)(int adapter_index); #endif /** |