From: Marcel Holtmann Date: Sun, 8 Nov 2015 13:57:40 +0000 (+0100) Subject: core: Use local assert function where possible X-Git-Tag: android-x86-6.0-r1~274 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=70960a142a307b1fdfcefdf716956a753cb38de8;p=android-x86%2Fexternal-bluetooth-bluez.git core: Use local assert function where possible --- diff --git a/src/attrib-server.c b/src/attrib-server.c index 0f2cced03..4439c27ab 100644 --- a/src/attrib-server.c +++ b/src/attrib-server.c @@ -41,6 +41,7 @@ #include "btio/btio.h" #include "log.h" +#include "backtrace.h" #include "adapter.h" #include "device.h" #include "src/shared/util.h" @@ -1521,7 +1522,7 @@ static uint16_t find_uuid128_avail(struct btd_adapter *adapter, uint16_t nitems) uint16_t attrib_db_find_avail(struct btd_adapter *adapter, bt_uuid_t *svc_uuid, uint16_t nitems) { - g_assert(nitems > 0); + btd_assert(nitems > 0); if (svc_uuid->type == BT_UUID16) return find_uuid16_avail(adapter, nitems); diff --git a/src/service.c b/src/service.c index 7da922cde..3d07744e2 100644 --- a/src/service.c +++ b/src/service.c @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -41,6 +40,7 @@ #include "lib/sdp.h" #include "log.h" +#include "backtrace.h" #include "adapter.h" #include "device.h" @@ -92,8 +92,8 @@ static void change_state(struct btd_service *service, btd_service_state_t state, if (state == old) return; - assert(service->device != NULL); - assert(service->profile != NULL); + btd_assert(service->device != NULL); + btd_assert(service->profile != NULL); service->state = state; service->err = err; @@ -155,7 +155,7 @@ int service_probe(struct btd_service *service) char addr[18]; int err; - assert(service->state == BTD_SERVICE_STATE_UNAVAILABLE); + btd_assert(service->state == BTD_SERVICE_STATE_UNAVAILABLE); err = service->profile->device_probe(service); if (err == 0) { @@ -299,7 +299,7 @@ struct btd_profile *btd_service_get_profile(const struct btd_service *service) void btd_service_set_user_data(struct btd_service *service, void *user_data) { - assert(service->state == BTD_SERVICE_STATE_UNAVAILABLE); + btd_assert(service->state == BTD_SERVICE_STATE_UNAVAILABLE); service->user_data = user_data; }