Bug 862669 - Fix some warnings in SIPCC Android code. r=jesup

This commit is contained in:
Chris Peterson 2013-04-16 22:15:15 -07:00
parent 48ec6342cc
commit ffc38f4471

View File

@ -179,6 +179,8 @@ cprCreateMessageQueue (const char *name, uint16_t depth)
static const char fname[] = "cprCreateMessageQueue";
cpr_msg_queue_t *msgq;
static int key_id = 100; /* arbitrary starting number */
pthread_cond_t _cond = PTHREAD_COND_INITIALIZER;
pthread_mutex_t _lock = PTHREAD_MUTEX_INITIALIZER;
msgq = cpr_calloc(1, sizeof(cpr_msg_queue_t));
if (msgq == NULL) {
@ -189,12 +191,9 @@ cprCreateMessageQueue (const char *name, uint16_t depth)
}
msgq->name = name ? name : unnamed_string;
msgq->queueId = key_id++;
pthread_cond_t _cond = PTHREAD_COND_INITIALIZER;
msgq->cond = _cond;
pthread_mutex_t _lock = PTHREAD_MUTEX_INITIALIZER;
msgq->mutex = _lock;
msgq->queueId = key_id++;
msgq->cond = _cond;
msgq->mutex = _lock;
/*
* Add message queue to list for statistics reporting
@ -321,7 +320,7 @@ cprGetMessage (cprMsgQueue_t msgQueue, boolean waitForever, void **ppUserData)
cpr_msgq_node_t *node;
struct timespec timeout;
struct timeval tv;
struct timezone *tz;
struct timezone tz;
/* Initialize ppUserData */
if (ppUserData) {
@ -339,7 +338,7 @@ cprGetMessage (cprMsgQueue_t msgQueue, boolean waitForever, void **ppUserData)
/*
* If waitForever is set, block on the message queue
* until a message is received, else return after
* 25msec of waiting
* 25msec of waiting
*/
pthread_mutex_lock(&msgq->mutex);
@ -351,7 +350,6 @@ cprGetMessage (cprMsgQueue_t msgQueue, boolean waitForever, void **ppUserData)
timeout.tv_sec = tv.tv_sec;
pthread_cond_timedwait(&msgq->cond, &msgq->mutex, &timeout);
}
else
{