Bluetooth: GATT: Change attribute count from u16_t to size_t

The change changes the type of the attribute count in the
bt_gatt_service struct to size_t.

The background for the change is that with this variable being a
u16_t, we assign something that has been cast to an unsigned long
(from "ARRAY_SIZE") to an u16_t variable, and that Lint complains
about a loss of information (27 bits to 16 bits in the case I found).

(The issue seems to be not only about the cast, but about what is
casted. I suspect that Lint may be confused by the magic of
ZERO_OR_COMPILE_ERROR.)

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
This commit is contained in:
Asbjørn Sæbø 2018-05-16 13:26:38 +02:00 committed by Anas Nashif
commit f7a1ffe614

View file

@ -144,7 +144,7 @@ struct bt_gatt_service {
/** Service Attributes */
struct bt_gatt_attr *attrs;
/** Service Attribute count */
u16_t attr_count;
size_t attr_count;
sys_snode_t node;
};