summaryrefslogtreecommitdiffstats
path: root/sdpd
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-07-06 00:12:58 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-07-06 00:12:58 +0000
commite2a54220b404119a2516a3cac5edc5b2bcf6089a (patch)
tree82891ce4193f2570b6b06c180227c865611d1b75 /sdpd
parente063c0ede09c386be3a5fb579f3cdf75f5826493 (diff)
Fix more GCC 4.0 warnings
Diffstat (limited to 'sdpd')
-rw-r--r--sdpd/cstate.c2
-rw-r--r--sdpd/main.c4
-rw-r--r--sdpd/request.c30
-rw-r--r--sdpd/sdpd.h2
-rw-r--r--sdpd/service.c8
5 files changed, 23 insertions, 23 deletions
diff --git a/sdpd/cstate.c b/sdpd/cstate.c
index dd532943..c983ef74 100644
--- a/sdpd/cstate.c
+++ b/sdpd/cstate.c
@@ -68,7 +68,7 @@ sdp_buf_t *sdp_get_cached_rsp(sdp_cont_state_t *cstate)
uint32_t sdp_cstate_alloc_buf(sdp_buf_t *buf)
{
sdp_cstate_list_t *cstate = (sdp_cstate_list_t *)malloc(sizeof(sdp_cstate_list_t));
- char *data = (char *)malloc(buf->data_size);
+ uint8_t *data = malloc(buf->data_size);
memcpy(data, buf->data, buf->data_size);
memset((char *)cstate, 0, sizeof(sdp_cstate_list_t));
diff --git a/sdpd/main.c b/sdpd/main.c
index b80fc0bb..51accc9a 100644
--- a/sdpd/main.c
+++ b/sdpd/main.c
@@ -313,7 +313,7 @@ static int become_daemon(void)
return 1;
}
-static inline void handle_request(int sk, char *data, int len)
+static inline void handle_request(int sk, uint8_t *data, int len)
{
struct sockaddr_l2 sa;
socklen_t size;
@@ -357,7 +357,7 @@ static void check_active(fd_set *mask, int num)
{
sdp_pdu_hdr_t hdr;
int size, fd, count, r;
- char *buf;
+ uint8_t *buf;
for (fd = 0, count = 0; fd <= active_maxfd && count < num; fd++) {
if (fd == l2cap_sock || fd == unix_sock || !FD_ISSET(fd, mask))
diff --git a/sdpd/request.c b/sdpd/request.c
index 6a62e55f..356ce1d8 100644
--- a/sdpd/request.c
+++ b/sdpd/request.c
@@ -57,7 +57,7 @@
* sequence. The data type of elements found in the
* sequence is returned in the reference pDataType
*/
-static int extract_des(char *buf, sdp_list_t **svcReqSeq, uint8_t *pDataType, uint8_t expectedType)
+static int extract_des(uint8_t *buf, sdp_list_t **svcReqSeq, uint8_t *pDataType, uint8_t expectedType)
{
uint8_t seqType;
int data_size = 0;
@@ -67,7 +67,7 @@ static int extract_des(char *buf, sdp_list_t **svcReqSeq, uint8_t *pDataType, ui
sdp_list_t *pSeq = NULL;
uint8_t dataType;
int status = 0;
- const char *p;
+ const uint8_t *p;
SDPDBG("Seq type : %d\n", seqType);
if (!scanned || (seqType != SDP_SEQ8 && seqType != SDP_SEQ16)) {
@@ -142,7 +142,7 @@ static int extract_des(char *buf, sdp_list_t **svcReqSeq, uint8_t *pDataType, ui
static int sdp_set_cstate_pdu(sdp_buf_t *buf, sdp_cont_state_t *cstate)
{
- char *pdata = buf->data + buf->data_size;
+ uint8_t *pdata = buf->data + buf->data_size;
int length = 0;
if (cstate) {
@@ -162,9 +162,9 @@ static int sdp_set_cstate_pdu(sdp_buf_t *buf, sdp_cont_state_t *cstate)
return length;
}
-static sdp_cont_state_t *sdp_cstate_get(char *buffer)
+static sdp_cont_state_t *sdp_cstate_get(uint8_t *buffer)
{
- char *pdata = buffer;
+ uint8_t *pdata = buffer;
uint8_t cStateSize = *(uint8_t *)pdata;
/*
@@ -233,16 +233,16 @@ static int service_search_req(sdp_req_t *req, sdp_buf_t *buf)
{
int status = 0, i, plen, mlen;
sdp_list_t *pattern = NULL;
- int expected, actual;
+ uint16_t expected, actual;
uint8_t dtd;
sdp_cont_state_t *cstate = NULL;
- char *pCacheBuffer = NULL;
+ uint8_t *pCacheBuffer = NULL;
int handleSize = 0;
uint32_t cStateId = 0;
short rsp_count = 0;
short *pTotalRecordCount, *pCurrentRecordCount;
int mtu;
- char *pdata = req->buf + sizeof(sdp_pdu_hdr_t);
+ uint8_t *pdata = req->buf + sizeof(sdp_pdu_hdr_t);
int scanned = extract_des(pdata, &pattern, &dtd, SDP_TYPE_UUID);
SDPDBG("");
@@ -361,7 +361,7 @@ static int service_search_req(sdp_req_t *req, sdp_buf_t *buf)
* current record count and increment the cached
* buffer pointer to beyond the counters
*/
- pdata = (char *)pCurrentRecordCount + sizeof(uint16_t);
+ pdata = (uint8_t *) pCurrentRecordCount + sizeof(uint16_t);
/* increment beyond the totalCount and the currentCount */
pCacheBuffer += 2 * sizeof(uint16_t);
@@ -486,14 +486,14 @@ static int extract_attrs(sdp_record_t *rec, sdp_list_t *seq, uint8_t dtd, sdp_bu
static int service_attr_req(sdp_req_t *req, sdp_buf_t *buf)
{
sdp_cont_state_t *cstate = NULL;
- char *pResponse = NULL;
+ uint8_t *pResponse = NULL;
short cstate_size = 0;
sdp_list_t *seq = NULL;
uint8_t dtd = 0;
int scanned = 0;
int max_rsp_size;
int status = 0, plen, mlen;
- char *pdata = req->buf + sizeof(sdp_pdu_hdr_t);
+ uint8_t *pdata = req->buf + sizeof(sdp_pdu_hdr_t);
uint32_t handle = ntohl(sdp_get_unaligned((uint32_t *)pdata));
SDPDBG("");
@@ -605,7 +605,7 @@ done:
static int service_search_attr_req(sdp_req_t *req, sdp_buf_t *buf)
{
int status = 0, plen, totscanned;
- char *pdata, *pResponse = NULL;
+ uint8_t *pdata, *pResponse = NULL;
int scanned, max, rsp_count = 0;
sdp_list_t *pattern = NULL, *seq = NULL, *svcList;
sdp_cont_state_t *cstate = NULL;
@@ -653,7 +653,7 @@ static int service_search_attr_req(sdp_req_t *req, sdp_buf_t *buf)
svcList = sdp_get_record_list();
- tmpbuf.data = (char *)malloc(USHRT_MAX);
+ tmpbuf.data = malloc(USHRT_MAX);
tmpbuf.data_size = 0;
tmpbuf.buf_size = USHRT_MAX;
memset(tmpbuf.data, 0, USHRT_MAX);
@@ -765,13 +765,13 @@ void process_request(sdp_req_t *req)
sdp_pdu_hdr_t *reqhdr = (sdp_pdu_hdr_t *)req->buf;
sdp_pdu_hdr_t *rsphdr;
sdp_buf_t rsp;
- char *buf = (char *)malloc(USHRT_MAX);
+ uint8_t *buf = malloc(USHRT_MAX);
int sent = 0;
int status = SDP_INVALID_SYNTAX;
SDPDBG("");
- memset((void *)buf, 0, USHRT_MAX);
+ memset(buf, 0, USHRT_MAX);
rsp.data = buf + sizeof(sdp_pdu_hdr_t);
rsp.data_size = 0;
rsp.buf_size = USHRT_MAX - sizeof(sdp_pdu_hdr_t);
diff --git a/sdpd/sdpd.h b/sdpd/sdpd.h
index 6d9c856a..3df83fca 100644
--- a/sdpd/sdpd.h
+++ b/sdpd/sdpd.h
@@ -50,7 +50,7 @@ typedef struct request {
int sock;
int mtu;
int flags;
- char *buf;
+ uint8_t *buf;
int len;
} sdp_req_t;
diff --git a/sdpd/service.c b/sdpd/service.c
index f2457e1f..843371ea 100644
--- a/sdpd/service.c
+++ b/sdpd/service.c
@@ -46,7 +46,7 @@
extern void update_db_timestamp(void);
// FIXME: refactor for server-side
-static sdp_record_t *extract_pdu_server(char *p, uint32_t handleExpected, int *scanned)
+static sdp_record_t *extract_pdu_server(uint8_t *p, uint32_t handleExpected, int *scanned)
{
int extractStatus = -1, localExtractedLength = 0;
uint8_t dtd;
@@ -129,7 +129,7 @@ int service_register_req(sdp_req_t *req, sdp_buf_t *rsp)
{
int scanned = 0;
sdp_data_t *handle;
- char *p = req->buf + sizeof(sdp_pdu_hdr_t);
+ uint8_t *p = req->buf + sizeof(sdp_pdu_hdr_t);
sdp_record_t *rec;
req->flags = *p++;
@@ -175,7 +175,7 @@ int service_update_req(sdp_req_t *req, sdp_buf_t *rsp)
{
sdp_record_t *orec;
int status = 0, scanned = 0;
- char *p = req->buf + sizeof(sdp_pdu_hdr_t);
+ uint8_t *p = req->buf + sizeof(sdp_pdu_hdr_t);
uint32_t handle = ntohl(sdp_get_unaligned((uint32_t *)p));
SDPDBG("");
@@ -217,7 +217,7 @@ int service_update_req(sdp_req_t *req, sdp_buf_t *rsp)
*/
int service_remove_req(sdp_req_t *req, sdp_buf_t *rsp)
{
- char *p = req->buf + sizeof(sdp_pdu_hdr_t);
+ uint8_t *p = req->buf + sizeof(sdp_pdu_hdr_t);
uint32_t handle = ntohl(sdp_get_unaligned((uint32_t *)p));
sdp_record_t *rec;
int status = 0;