diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2005-03-09 17:27:17 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2005-03-09 17:27:17 +0000 |
commit | cfb680f0660169fe231c575cb2a0c7f72826f4f4 (patch) | |
tree | 1c58d798e1bb56513c5fd40b90a264250a83e34c | |
parent | 210da6834b4b6f219b0331cddacdd6e915dbb8fe (diff) |
Use uint32_t instead of long
-rw-r--r-- | sdpd/cstate.c | 10 | ||||
-rw-r--r-- | sdpd/request.c | 4 | ||||
-rw-r--r-- | sdpd/sdpd.h | 6 | ||||
-rw-r--r-- | sdpd/servicedb.c | 4 |
4 files changed, 13 insertions, 11 deletions
diff --git a/sdpd/cstate.c b/sdpd/cstate.c index 735d5850..dd532943 100644 --- a/sdpd/cstate.c +++ b/sdpd/cstate.c @@ -36,7 +36,9 @@ #include <stdio.h> #include <malloc.h> #include <sys/time.h> +#include <sys/socket.h> +#include <bluetooth/bluetooth.h> #include <bluetooth/sdp.h> #include <bluetooth/sdp_lib.h> @@ -46,7 +48,7 @@ typedef struct _sdp_cstate_list sdp_cstate_list_t; struct _sdp_cstate_list { sdp_cstate_list_t *next; - long timestamp; + uint32_t timestamp; sdp_buf_t buf; }; @@ -63,7 +65,7 @@ sdp_buf_t *sdp_get_cached_rsp(sdp_cont_state_t *cstate) return 0; } -long sdp_cstate_alloc_buf(sdp_buf_t *buf) +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); @@ -84,7 +86,7 @@ long sdp_cstate_alloc_buf(sdp_buf_t *buf) * seconds. Used for updating the service db state * attribute of the service record of the SDP server */ -long sdp_get_time() +uint32_t sdp_get_time() { /* * To handle failure in gettimeofday, so an old @@ -93,5 +95,5 @@ long sdp_get_time() static struct timeval tm; gettimeofday(&tm, NULL); - return tm.tv_sec; + return (uint32_t) tm.tv_sec; } diff --git a/sdpd/request.c b/sdpd/request.c index dbb3ff37..6a62e55f 100644 --- a/sdpd/request.c +++ b/sdpd/request.c @@ -238,7 +238,7 @@ static int service_search_req(sdp_req_t *req, sdp_buf_t *buf) sdp_cont_state_t *cstate = NULL; char *pCacheBuffer = NULL; int handleSize = 0; - long cStateId = -1; + uint32_t cStateId = 0; short rsp_count = 0; short *pTotalRecordCount, *pCurrentRecordCount; int mtu; @@ -331,7 +331,7 @@ static int service_search_req(sdp_req_t *req, sdp_buf_t *buf) } /* under both the conditions below, the rsp buffer is not built yet */ - if (cstate || cStateId != -1) { + if (cstate || cStateId > 0) { short lastIndex = 0; if (cstate) { diff --git a/sdpd/sdpd.h b/sdpd/sdpd.h index bc085c83..6d9c856a 100644 --- a/sdpd/sdpd.h +++ b/sdpd/sdpd.h @@ -61,7 +61,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); typedef struct { - long timestamp; + uint32_t timestamp; union { uint16_t maxBytesSent; uint16_t lastIndexSent; @@ -73,7 +73,7 @@ typedef struct { sdp_buf_t *sdp_get_cached_rsp(sdp_cont_state_t *cstate); void sdp_cstate_cache_init(void); void sdp_cstate_clean_buf(void); -long sdp_cstate_alloc_buf(sdp_buf_t *buf); +uint32_t sdp_cstate_alloc_buf(sdp_buf_t *buf); void sdp_svcdb_reset(void); void sdp_svcdb_collect_all(int sock); @@ -85,6 +85,6 @@ int sdp_record_remove(uint32_t handle); sdp_list_t *sdp_get_record_list(); uint32_t sdp_next_handle(void); -long sdp_get_time(); +uint32_t sdp_get_time(); #endif diff --git a/sdpd/servicedb.c b/sdpd/servicedb.c index 5006fbb4..45f45b91 100644 --- a/sdpd/servicedb.c +++ b/sdpd/servicedb.c @@ -146,8 +146,8 @@ void sdp_svcdb_set_collectable(sdp_record_t *record, int sock) void sdp_record_add(sdp_record_t *rec) { #ifdef SDP_DEBUG - SDPDBG("Adding rec : 0x%lx\n", (long)rec); - SDPDBG("with handle : 0x%lx\n", (long)rec->handle); + SDPDBG("Adding rec : 0x%lx\n", (long) rec); + SDPDBG("with handle : 0x%x\n", rec->handle); #endif service_db = sdp_list_insert_sorted(service_db, rec, record_sort); } |