diff --git a/src/adapter.c b/src/adapter.c
index 7e25700..374c718 100644
--- a/src/adapter.c
+++ b/src/adapter.c
{
int err;
- if (adapter->powered == powered)
- return g_dbus_pending_property_success(id);
+ if (adapter->powered == powered) {
+ g_dbus_pending_property_success(id);
+ return;
+ }
err = mgmt_set_powered(adapter->dev_id, powered);
- if (err < 0)
- return g_dbus_pending_property_error(id,
- ERROR_INTERFACE ".Failed",
- strerror(-err));
+ if (err < 0) {
+ g_dbus_pending_property_error(id, ERROR_INTERFACE ".Failed",
+ strerror(-err));
+ return;
+ }
if (powered == FALSE)
adapter->off_requested = TRUE;
{
DBusConnection *conn = btd_get_dbus_connection();
- if (adapter->discov_timeout == timeout && timeout == 0)
- return g_dbus_pending_property_success(id);
+ if (adapter->discov_timeout == timeout && timeout == 0) {
+ g_dbus_pending_property_success(id);
+ return;
+ }
if (adapter->discoverable)
mgmt_set_discoverable(adapter->dev_id, TRUE, timeout);
{
DBusConnection *conn = btd_get_dbus_connection();
- if (adapter->pairable_timeout == timeout && timeout == 0)
- return g_dbus_pending_property_success(id);
+ if (adapter->pairable_timeout == timeout && timeout == 0) {
+ g_dbus_pending_property_success(id);
+ return;
+ }
if (adapter->pairable)
adapter_set_pairable_timeout(adapter, timeout);
{
dbus_bool_t powered;
- if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_BOOLEAN)
- return g_dbus_pending_property_error(id,
+ if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_BOOLEAN) {
+ g_dbus_pending_property_error(id,
ERROR_INTERFACE ".InvalidArguments",
"Invalid arguments in method call");
+ return;
+ }
dbus_message_iter_get_basic(value, &powered);
{
dbus_bool_t discoverable;
- if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_BOOLEAN)
- return g_dbus_pending_property_error(id,
+ if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_BOOLEAN) {
+ g_dbus_pending_property_error(id,
ERROR_INTERFACE ".InvalidArguments",
"Invalid arguments in method call");
+ return;
+ }
dbus_message_iter_get_basic(value, &discoverable);
{
dbus_bool_t pairable;
- if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_BOOLEAN)
- return g_dbus_pending_property_error(id,
+ if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_BOOLEAN) {
+ g_dbus_pending_property_error(id,
ERROR_INTERFACE ".InvalidArguments",
"Invalid arguments in method call");
+ return;
+ }
dbus_message_iter_get_basic(value, &pairable);
{
uint32_t timeout;
- if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_UINT32)
- return g_dbus_pending_property_error(id,
+ if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_UINT32) {
+ g_dbus_pending_property_error(id,
ERROR_INTERFACE ".InvalidArguments",
"Invalid arguments in method call");
+ return;
+ }
dbus_message_iter_get_basic(value, &timeout);
set_discoverable_timeout(data, timeout, id);
{
uint32_t timeout;
- if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_UINT32)
- return g_dbus_pending_property_error(id,
+ if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_UINT32) {
+ g_dbus_pending_property_error(id,
ERROR_INTERFACE ".InvalidArguments",
"Invalid arguments in method call");
+ return;
+ }
dbus_message_iter_get_basic(value, &timeout);
set_pairable_timeout(data, timeout, id);
diff --git a/src/device.c b/src/device.c
index b0d0252..6a40131 100644
--- a/src/device.c
+++ b/src/device.c
/* No change */
if ((device->alias == NULL && g_str_equal(alias, "")) ||
- g_strcmp0(device->alias, alias) == 0)
- return g_dbus_pending_property_success(id);
+ g_strcmp0(device->alias, alias) == 0) {
+ g_dbus_pending_property_success(id);
+ return;
+ }
g_free(device->alias);
device->alias = g_str_equal(alias, "") ? NULL : g_strdup(alias);
{
const char *alias;
- if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_STRING)
- return g_dbus_pending_property_error(id,
+ if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_STRING) {
+ g_dbus_pending_property_error(id,
ERROR_INTERFACE ".InvalidArguments",
"Invalid arguments in method call");
+ return;
+ }
dbus_message_iter_get_basic(value, &alias);
{
struct btd_device *device = data;
- if (device->trusted == value)
- return g_dbus_pending_property_success(id);
+ if (device->trusted == value) {
+ g_dbus_pending_property_success(id);
+ return;
+ }
device->trusted = value;
{
dbus_bool_t b;
- if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_BOOLEAN)
- return g_dbus_pending_property_error(id,
+ if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_BOOLEAN) {
+ g_dbus_pending_property_error(id,
ERROR_INTERFACE ".InvalidArguments",
"Invalid arguments in method call");
+ return;
+ }
dbus_message_iter_get_basic(value, &b);
{
dbus_bool_t b;
- if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_BOOLEAN)
- return g_dbus_pending_property_error(id,
+ if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_BOOLEAN) {
+ g_dbus_pending_property_error(id,
ERROR_INTERFACE ".InvalidArguments",
"Invalid arguments in method call");
+ return;
+ }
dbus_message_iter_get_basic(value, &b);