Thread (4 messages) 4 messages, 2 authors, 2013-01-11
STALE4948d

[PATCH BlueZ 2/2] attrib: Fix compilation errors when compiled without optimization

From: Anderson Lizardo <hidden>
Date: 2013-01-08 15:46:27
Subsystem: the rest · Maintainer: Linus Torvalds

Fix these build errors:

attrib/att.c: In function ‘dec_read_by_grp_req’:
attrib/att.c:165:10: error: comparison between signed and unsigned
integer expressions [-Werror=sign-compare]
attrib/att.c:170:10: error: comparison between signed and unsigned
integer expressions [-Werror=sign-compare]
attrib/att.c: In function ‘dec_read_by_type_req’:
attrib/att.c:393:10: error: comparison between signed and unsigned
integer expressions [-Werror=sign-compare]
attrib/att.c:402:10: error: comparison between signed and unsigned
integer expressions [-Werror=sign-compare]
---
 attrib/att.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/attrib/att.c b/attrib/att.c
index de11811..fe66821 100644
--- a/attrib/att.c
+++ b/attrib/att.c
@@ -151,7 +151,7 @@ uint16_t enc_read_by_grp_req(uint16_t start, uint16_t end, bt_uuid_t *uuid,
 uint16_t dec_read_by_grp_req(const uint8_t *pdu, size_t len, uint16_t *start,
 						uint16_t *end, bt_uuid_t *uuid)
 {
-	const uint16_t min_len = sizeof(pdu[0]) + sizeof(*start) + sizeof(*end);
+	const size_t min_len = sizeof(pdu[0]) + sizeof(*start) + sizeof(*end);
 
 	if (pdu == NULL)
 		return 0;
@@ -382,7 +382,7 @@ uint16_t enc_read_by_type_req(uint16_t start, uint16_t end, bt_uuid_t *uuid,
 uint16_t dec_read_by_type_req(const uint8_t *pdu, size_t len, uint16_t *start,
 						uint16_t *end, bt_uuid_t *uuid)
 {
-	const uint16_t min_len = sizeof(pdu[0]) + sizeof(*start) + sizeof(*end);
+	const size_t min_len = sizeof(pdu[0]) + sizeof(*start) + sizeof(*end);
 
 	if (pdu == NULL)
 		return 0;
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help