All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/5] lib: Add SDP_IS_TEXT_STR() macro for SDP_TEXT_STR* checking
@ 2013-01-07 11:56 Anderson Lizardo
  2013-01-07 11:56 ` [PATCH BlueZ 2/5] lib: Trivial whitespace and line wrapping fix Anderson Lizardo
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Anderson Lizardo @ 2013-01-07 11:56 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo

This new macro avoids constructs like "if (d->dtd < SDP_TEXT_STR8 ||
d->dtd > SDP_TEXT_STR32)" which are harder to read.
---
 lib/sdp.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/sdp.h b/lib/sdp.h
index 4448805..42681a2 100644
--- a/lib/sdp.h
+++ b/lib/sdp.h
@@ -440,6 +440,8 @@ typedef struct {
 
 #define SDP_IS_UUID(x) ((x) == SDP_UUID16 || (x) == SDP_UUID32 || (x) ==SDP_UUID128)
 #define SDP_IS_SEQ(x)  ((x) == SDP_SEQ8 || (x) == SDP_SEQ16 || (x) == SDP_SEQ32)
+#define SDP_IS_TEXT_STR(x) ((x) == SDP_TEXT_STR8 || (x) == SDP_TEXT_STR16 || \
+							(x) == SDP_TEXT_STR32)
 
 typedef struct _sdp_list sdp_list_t;
 struct _sdp_list {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-01-08 10:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-07 11:56 [PATCH BlueZ 1/5] lib: Add SDP_IS_TEXT_STR() macro for SDP_TEXT_STR* checking Anderson Lizardo
2013-01-07 11:56 ` [PATCH BlueZ 2/5] lib: Trivial whitespace and line wrapping fix Anderson Lizardo
2013-01-07 11:56 ` [PATCH v2 BlueZ 3/5] input: Validate SDP HIDDescriptorList subattributes Anderson Lizardo
2013-01-07 11:56 ` [PATCH BlueZ 4/5] lib: Use SDP_IS_TEXT_STR()/SDP_IS_SEQ() where possible Anderson Lizardo
2013-01-07 11:56 ` [PATCH BlueZ 5/5] health: " Anderson Lizardo
2013-01-07 12:18 ` [PATCH BlueZ 1/5] lib: Add SDP_IS_TEXT_STR() macro for SDP_TEXT_STR* checking Johan Hedberg
2013-01-08  3:25 ` Marcel Holtmann
2013-01-08 10:52   ` Anderson Lizardo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.