summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--audio/gstpragma.h2
-rw-r--r--audio/pcm_bluetooth.c2
-rw-r--r--compat/fakehid.c7
-rw-r--r--lib/sdp.c77
-rw-r--r--lib/sdp_lib.h2
-rw-r--r--src/sdpd-request.c18
-rw-r--r--src/sdpd-service.c2
7 files changed, 57 insertions, 53 deletions
diff --git a/audio/gstpragma.h b/audio/gstpragma.h
index 626311c12..0cb08d277 100644
--- a/audio/gstpragma.h
+++ b/audio/gstpragma.h
@@ -21,4 +21,4 @@
*
*/
-//#pragma GCC diagnostic warning "-Wmissing-declarations"
+/* #pragma GCC diagnostic warning "-Wmissing-declarations" */
diff --git a/audio/pcm_bluetooth.c b/audio/pcm_bluetooth.c
index 799f17f9f..2c21e058c 100644
--- a/audio/pcm_bluetooth.c
+++ b/audio/pcm_bluetooth.c
@@ -44,7 +44,7 @@
#include "sbc.h"
#include "rtp.h"
-//#define ENABLE_DEBUG
+/* #define ENABLE_DEBUG */
#define UINT_SECS_MAX (UINT_MAX / 1000000 - 1)
diff --git a/compat/fakehid.c b/compat/fakehid.c
index b996d1010..f0d88931c 100644
--- a/compat/fakehid.c
+++ b/compat/fakehid.c
@@ -125,9 +125,10 @@ static int uinput_create(char *name, int keyboard, int mouse)
for (aux = KEY_RESERVED; aux <= KEY_UNKNOWN; aux++)
ioctl(fd, UI_SET_KEYBIT, aux);
-
- //for (aux = LED_NUML; aux <= LED_MISC; aux++)
- // ioctl(fd, UI_SET_LEDBIT, aux);
+ /*
+ *for (aux = LED_NUML; aux <= LED_MISC; aux++)
+ * ioctl(fd, UI_SET_LEDBIT, aux);
+ */
}
if (mouse) {
diff --git a/lib/sdp.c b/lib/sdp.c
index d24d1e289..dd6a62a56 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -1798,7 +1798,7 @@ sdp_list_t *sdp_list_insert_sorted(sdp_list_t *list, void *d,
for (q = 0, p = list; p; q = p, p = p->next)
if (f(p->data, d) >= 0)
break;
- // insert between q and p; if !q insert at head
+ /* insert between q and p; if !q insert at head */
if (q)
q->next = n;
else
@@ -3196,7 +3196,7 @@ static int gen_dataseq_pdu(uint8_t *dst, const sdp_list_t *seq, uint8_t dtd)
sdp_buf_t buf;
int i, seqlen = sdp_list_len(seq);
- // Fill up the value and the dtd arrays
+ /* Fill up the value and the dtd arrays */
SDPDBG("");
SDPDBG("Seq length : %d\n", seqlen);
@@ -3338,16 +3338,16 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search,
pdata = reqbuf + sizeof(sdp_pdu_hdr_t);
reqsize = sizeof(sdp_pdu_hdr_t);
- // add service class IDs for search
+ /* add service class IDs for search */
seqlen = gen_searchseq_pdu(pdata, search);
SDPDBG("Data seq added : %d\n", seqlen);
- // set the length and increment the pointer
+ /* set the length and increment the pointer */
reqsize += seqlen;
pdata += seqlen;
- // specify the maximum svc rec count that client expects
+ /* specify the maximum svc rec count that client expects */
bt_put_unaligned(htons(max_rec_num), (uint16_t *) pdata);
reqsize += sizeof(uint16_t);
pdata += sizeof(uint16_t);
@@ -3357,11 +3357,11 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search,
*rsp = NULL;
do {
- // Add continuation state or NULL (first time)
+ /* Add continuation state or NULL (first time) */
reqsize = _reqsize + copy_cstate(_pdata,
SDP_REQ_BUFFER_SIZE - _reqsize, cstate);
- // Set the request header's param length
+ /* Set the request header's param length */
reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t));
reqhdr->tid = htons(sdp_gen_tid(session));
@@ -3397,7 +3397,7 @@ int sdp_service_search_req(sdp_session_t *session, const sdp_list_t *search,
goto end;
}
- // net service record match count
+ /* net service record match count */
total_rec_count = ntohs(bt_get_unaligned((uint16_t *) pdata));
pdata += sizeof(uint16_t);
scanned += sizeof(uint16_t);
@@ -3511,17 +3511,17 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle,
pdata = reqbuf + sizeof(sdp_pdu_hdr_t);
reqsize = sizeof(sdp_pdu_hdr_t);
- // add the service record handle
+ /* add the service record handle */
bt_put_unaligned(htonl(handle), (uint32_t *) pdata);
reqsize += sizeof(uint32_t);
pdata += sizeof(uint32_t);
- // specify the response limit
+ /* specify the response limit */
bt_put_unaligned(htons(65535), (uint16_t *) pdata);
reqsize += sizeof(uint16_t);
pdata += sizeof(uint16_t);
- // get attr seq PDU form
+ /* get attr seq PDU form */
seqlen = gen_attridseq_pdu(pdata, attrids,
reqtype == SDP_ATTR_REQ_INDIVIDUAL? SDP_UINT16 : SDP_UINT32);
if (seqlen == -1) {
@@ -3532,18 +3532,18 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle,
reqsize += seqlen;
SDPDBG("Attr list length : %d\n", seqlen);
- // save before Continuation State
+ /* save before Continuation State */
_pdata = pdata;
_reqsize = reqsize;
do {
int status;
- // add NULL continuation state
+ /* add NULL continuation state */
reqsize = _reqsize + copy_cstate(_pdata,
SDP_REQ_BUFFER_SIZE - _reqsize, cstate);
- // set the request header's param length
+ /* set the request header's param length */
reqhdr->tid = htons(sdp_gen_tid(session));
reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t));
@@ -3574,7 +3574,10 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle,
pdata += sizeof(uint16_t);
pdata_len -= sizeof(uint16_t);
- // if continuation state set need to re-issue request before parsing
+ /*
+ * if continuation state set need to re-issue request before
+ * parsing
+ */
if (pdata_len < rsp_count + sizeof(uint8_t)) {
SDPERR("Unexpected end of packet: continuation state data missing");
goto end;
@@ -3594,7 +3597,7 @@ sdp_record_t *sdp_service_attr_req(sdp_session_t *session, uint32_t handle,
cstate = cstate_len > 0 ? (sdp_cstate_t *) (pdata + rsp_count) : 0;
- // build concatenated response buffer
+ /* build concatenated response buffer */
rsp_concat_buf.data = realloc(rsp_concat_buf.data, rsp_concat_buf.data_size + rsp_count);
rsp_concat_buf.buf_size = rsp_concat_buf.data_size + rsp_count;
targetPtr = rsp_concat_buf.data + rsp_concat_buf.data_size;
@@ -3755,16 +3758,16 @@ int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, u
reqhdr->tid = htons(sdp_gen_tid(session));
reqhdr->pdu_id = SDP_SVC_SEARCH_REQ;
- // generate PDU
+ /* generate PDU */
pdata = t->reqbuf + sizeof(sdp_pdu_hdr_t);
t->reqsize = sizeof(sdp_pdu_hdr_t);
- // add service class IDs for search
+ /* add service class IDs for search */
seqlen = gen_searchseq_pdu(pdata, search);
SDPDBG("Data seq added : %d\n", seqlen);
- // now set the length and increment the pointer
+ /* now set the length and increment the pointer */
t->reqsize += seqlen;
pdata += seqlen;
@@ -3772,7 +3775,7 @@ int sdp_service_search_async(sdp_session_t *session, const sdp_list_t *search, u
t->reqsize += sizeof(uint16_t);
pdata += sizeof(uint16_t);
- // set the request header's param length
+ /* set the request header's param length */
cstate_len = copy_cstate(pdata, SDP_REQ_BUFFER_SIZE - t->reqsize, NULL);
reqhdr->plen = htons((t->reqsize + cstate_len) - sizeof(sdp_pdu_hdr_t));
@@ -3856,21 +3859,21 @@ int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_
reqhdr->tid = htons(sdp_gen_tid(session));
reqhdr->pdu_id = SDP_SVC_ATTR_REQ;
- // generate PDU
+ /* generate PDU */
pdata = t->reqbuf + sizeof(sdp_pdu_hdr_t);
t->reqsize = sizeof(sdp_pdu_hdr_t);
- // add the service record handle
+ /* add the service record handle */
bt_put_unaligned(htonl(handle), (uint32_t *) pdata);
t->reqsize += sizeof(uint32_t);
pdata += sizeof(uint32_t);
- // specify the response limit
+ /* specify the response limit */
bt_put_unaligned(htons(65535), (uint16_t *) pdata);
t->reqsize += sizeof(uint16_t);
pdata += sizeof(uint16_t);
- // get attr seq PDU form
+ /* get attr seq PDU form */
seqlen = gen_attridseq_pdu(pdata, attrid_list,
reqtype == SDP_ATTR_REQ_INDIVIDUAL? SDP_UINT16 : SDP_UINT32);
if (seqlen == -1) {
@@ -3878,12 +3881,12 @@ int sdp_service_attr_async(sdp_session_t *session, uint32_t handle, sdp_attrreq_
goto end;
}
- // now set the length and increment the pointer
+ /* now set the length and increment the pointer */
t->reqsize += seqlen;
pdata += seqlen;
SDPDBG("Attr list length : %d\n", seqlen);
- // set the request header's param length
+ /* set the request header's param length */
cstate_len = copy_cstate(pdata, SDP_REQ_BUFFER_SIZE - t->reqsize, NULL);
reqhdr->plen = htons((t->reqsize + cstate_len) - sizeof(sdp_pdu_hdr_t));
@@ -3968,16 +3971,16 @@ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *sear
reqhdr->tid = htons(sdp_gen_tid(session));
reqhdr->pdu_id = SDP_SVC_SEARCH_ATTR_REQ;
- // generate PDU
+ /* generate PDU */
pdata = t->reqbuf + sizeof(sdp_pdu_hdr_t);
t->reqsize = sizeof(sdp_pdu_hdr_t);
- // add service class IDs for search
+ /* add service class IDs for search */
seqlen = gen_searchseq_pdu(pdata, search);
SDPDBG("Data seq added : %d\n", seqlen);
- // now set the length and increment the pointer
+ /* now set the length and increment the pointer */
t->reqsize += seqlen;
pdata += seqlen;
@@ -3987,7 +3990,7 @@ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *sear
SDPDBG("Max attr byte count : %d\n", SDP_MAX_ATTR_LEN);
- // get attr seq PDU form
+ /* get attr seq PDU form */
seqlen = gen_attridseq_pdu(pdata, attrid_list,
reqtype == SDP_ATTR_REQ_INDIVIDUAL ? SDP_UINT16 : SDP_UINT32);
if (seqlen == -1) {
@@ -3999,7 +4002,7 @@ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *sear
SDPDBG("Attr list length : %d\n", seqlen);
t->reqsize += seqlen;
- // set the request header's param length
+ /* set the request header's param length */
cstate_len = copy_cstate(pdata, SDP_REQ_BUFFER_SIZE - t->reqsize, NULL);
reqhdr->plen = htons((t->reqsize + cstate_len) - sizeof(sdp_pdu_hdr_t));
@@ -4164,7 +4167,7 @@ int sdp_process(sdp_session_t *session)
*/
plen = sizeof(uint16_t) + rsp_count;
- pdata += sizeof(uint16_t); // points to attribute list
+ pdata += sizeof(uint16_t); /* points to attribute list */
status = 0x0000;
break;
case SDP_ERROR_RSP:
@@ -4210,13 +4213,13 @@ int sdp_process(sdp_session_t *session)
reqhdr->tid = htons(sdp_gen_tid(session));
- // add continuation state
+ /* add continuation state */
cstate_len = copy_cstate(t->reqbuf + t->reqsize,
SDP_REQ_BUFFER_SIZE - t->reqsize, pcstate);
reqsize = t->reqsize + cstate_len;
- // set the request header's param length
+ /* set the request header's param length */
reqhdr->plen = htons(reqsize - sizeof(sdp_pdu_hdr_t));
if (sdp_send_req(session, t->reqbuf, reqsize) < 0) {
@@ -4318,11 +4321,11 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search
reqhdr = (sdp_pdu_hdr_t *) reqbuf;
reqhdr->pdu_id = SDP_SVC_SEARCH_ATTR_REQ;
- // generate PDU
+ /* generate PDU */
pdata = reqbuf + sizeof(sdp_pdu_hdr_t);
reqsize = sizeof(sdp_pdu_hdr_t);
- // add service class IDs for search
+ /* add service class IDs for search */
seqlen = gen_searchseq_pdu(pdata, search);
SDPDBG("Data seq added : %d\n", seqlen);
@@ -4391,7 +4394,7 @@ int sdp_service_search_attr_req(sdp_session_t *session, const sdp_list_t *search
rsp_count = ntohs(bt_get_unaligned((uint16_t *) pdata));
attr_list_len += rsp_count;
- pdata += sizeof(uint16_t); // pdata points to attribute list
+ pdata += sizeof(uint16_t); /* pdata points to attribute list */
pdata_len -= sizeof(uint16_t);
if (pdata_len < rsp_count + sizeof(uint8_t)) {
diff --git a/lib/sdp_lib.h b/lib/sdp_lib.h
index e506ac15a..433e9effb 100644
--- a/lib/sdp_lib.h
+++ b/lib/sdp_lib.h
@@ -90,7 +90,7 @@ typedef struct {
int state;
int local;
int flags;
- uint16_t tid; // Current transaction ID
+ uint16_t tid; /* Current transaction ID */
void *priv;
} sdp_session_t;
diff --git a/src/sdpd-request.c b/src/sdpd-request.c
index cff2a32c8..d24a0da51 100644
--- a/src/sdpd-request.c
+++ b/src/sdpd-request.c
@@ -67,7 +67,7 @@ struct _sdp_cstate_list {
static sdp_cstate_list_t *cstates;
-// FIXME: should probably remove it when it's found
+/* FIXME: should probably remove it when it's found */
static sdp_buf_t *sdp_get_cached_rsp(sdp_cont_state_t *cstate)
{
sdp_cstate_list_t *p;
@@ -262,7 +262,7 @@ static int sdp_set_cstate_pdu(sdp_buf_t *buf, sdp_cont_state_t *cstate)
memcpy(pdata, cstate, sizeof(sdp_cont_state_t));
length += sizeof(sdp_cont_state_t);
} else {
- // set "null" continuation state
+ /* set "null" continuation state */
*pdata = 0;
pdata += sizeof(uint8_t);
length += sizeof(uint8_t);
@@ -335,7 +335,7 @@ static int sdp_match_uuid(sdp_list_t *search, sdp_list_t *pattern)
if (data == NULL)
return -1;
- // create 128-bit form of the search UUID
+ /* create 128-bit form of the search UUID */
uuid128 = sdp_uuid_to_uuid128((uuid_t *)data);
list = sdp_list_find(pattern, uuid128, sdp_uuid128_cmp);
bt_free(uuid128);
@@ -375,7 +375,7 @@ static int service_search_req(sdp_req_t *req, sdp_buf_t *buf)
plen = ntohs(((sdp_pdu_hdr_t *)(req->buf))->plen);
mlen = scanned + sizeof(uint16_t) + 1;
- // ensure we don't read past buffer
+ /* ensure we don't read past buffer */
if (plen < mlen || plen != mlen + *(uint8_t *)(pdata+sizeof(uint16_t))) {
status = SDP_INVALID_SYNTAX;
goto done;
@@ -671,7 +671,7 @@ static int service_attr_req(sdp_req_t *req, sdp_buf_t *buf)
plen = ntohs(((sdp_pdu_hdr_t *)(req->buf))->plen);
mlen = scanned + sizeof(uint32_t) + sizeof(uint16_t) + 1;
- // ensure we don't read past buffer
+ /* ensure we don't read past buffer */
if (plen < mlen || plen != mlen + *(uint8_t *)pdata) {
status = SDP_INVALID_PDU_SIZE;
goto done;
@@ -754,7 +754,7 @@ static int service_attr_req(sdp_req_t *req, sdp_buf_t *buf)
}
}
- // push header
+ /* push header */
buf->data -= sizeof(uint16_t);
buf->buf_size += sizeof(uint16_t);
@@ -880,7 +880,7 @@ static int service_search_attr_req(sdp_req_t *req, sdp_buf_t *buf)
break;
}
if (buf->data_size + tmpbuf.data_size < buf->buf_size) {
- // to be sure no relocations
+ /* to be sure no relocations */
sdp_append_to_buf(buf, tmpbuf.data, tmpbuf.data_size);
tmpbuf.data_size = 0;
memset(tmpbuf.data, 0, USHRT_MAX);
@@ -925,13 +925,13 @@ static int service_search_attr_req(sdp_req_t *req, sdp_buf_t *buf)
}
if (!rsp_count && !cstate) {
- // found nothing
+ /* found nothing */
buf->data_size = 0;
sdp_append_to_buf(buf, tmpbuf.data, tmpbuf.data_size);
sdp_set_cstate_pdu(buf, NULL);
}
- // push header
+ /* push header */
buf->data -= sizeof(uint16_t);
buf->buf_size += sizeof(uint16_t);
diff --git a/src/sdpd-service.c b/src/sdpd-service.c
index 0d6722ac1..fe4de6a29 100644
--- a/src/sdpd-service.c
+++ b/src/sdpd-service.c
@@ -411,7 +411,7 @@ int service_register_req(sdp_req_t *req, sdp_buf_t *rsp)
bufsize -= sizeof(bdaddr_t);
}
- // save image of PDU: we need it when clients request this attribute
+ /* save image of PDU: we need it when clients request this attribute */
rec = extract_pdu_server(&req->device, p, bufsize, 0xffffffff, &scanned);
if (!rec)
goto invalid;