summaryrefslogtreecommitdiff
path: root/lib/sdp.c
diff options
context:
space:
mode:
authorAnderson Lizardo <anderson.lizardo@openbossa.org>2013-01-07 07:56:34 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2013-01-07 14:16:45 +0200
commit31eac6652109ca51f0685712c71b1023f5e3832b (patch)
tree6d5b912632071a21263773397e146d416f93aadb /lib/sdp.c
parenta35f83e113c1c58dd1c6cf8bda2b1bf99d07a695 (diff)
downloadbluez-31eac6652109ca51f0685712c71b1023f5e3832b.tar.gz
lib: Use SDP_IS_TEXT_STR()/SDP_IS_SEQ() where possible
Diffstat (limited to 'lib/sdp.c')
-rw-r--r--lib/sdp.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/sdp.c b/lib/sdp.c
index 2dac6c7a8..ca474cd3b 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -570,7 +570,7 @@ static void extract_svclass_uuid(sdp_data_t *data, uuid_t *uuid)
{
sdp_data_t *d;
- if (!data || data->dtd < SDP_SEQ8 || data->dtd > SDP_SEQ32)
+ if (!data || !SDP_IS_SEQ(data->dtd))
return;
d = data->val.dataseq;
@@ -1912,7 +1912,7 @@ int sdp_get_uuidseq_attr(const sdp_record_t *rec, uint16_t attr,
sdp_data_t *sdpdata = sdp_data_get(rec, attr);
*seqp = NULL;
- if (sdpdata && sdpdata->dtd >= SDP_SEQ8 && sdpdata->dtd <= SDP_SEQ32) {
+ if (sdpdata && SDP_IS_SEQ(sdpdata->dtd)) {
sdp_data_t *d;
for (d = sdpdata->val.dataseq; d; d = d->next) {
uuid_t *u;
@@ -2128,9 +2128,7 @@ int sdp_get_string_attr(const sdp_record_t *rec, uint16_t attrid, char *value,
sdp_data_t *sdpdata = sdp_data_get(rec, attrid);
if (sdpdata)
/* Verify that it is what the caller expects */
- if (sdpdata->dtd == SDP_TEXT_STR8 ||
- sdpdata->dtd == SDP_TEXT_STR16 ||
- sdpdata->dtd == SDP_TEXT_STR32)
+ if (SDP_IS_TEXT_STR(sdpdata->dtd))
if ((int) strlen(sdpdata->val.str) < valuelen) {
strcpy(value, sdpdata->val.str);
return 0;
@@ -4744,7 +4742,7 @@ int sdp_get_supp_feat(const sdp_record_t *rec, sdp_list_t **seqp)
sdpdata = sdp_data_get(rec, SDP_ATTR_SUPPORTED_FEATURES_LIST);
- if (!sdpdata || sdpdata->dtd < SDP_SEQ8 || sdpdata->dtd > SDP_SEQ32)
+ if (!sdpdata || !SDP_IS_SEQ(sdpdata->dtd))
return sdp_get_uuidseq_attr(rec,
SDP_ATTR_SUPPORTED_FEATURES_LIST, seqp);
@@ -4752,7 +4750,7 @@ int sdp_get_supp_feat(const sdp_record_t *rec, sdp_list_t **seqp)
sdp_data_t *dd;
sdp_list_t *subseq;
- if (d->dtd < SDP_SEQ8 || d->dtd > SDP_SEQ32)
+ if (!SDP_IS_SEQ(d->dtd))
goto fail;
subseq = NULL;