summaryrefslogtreecommitdiff
path: root/code/ecp/msgq.c
diff options
context:
space:
mode:
Diffstat (limited to 'code/ecp/msgq.c')
-rw-r--r--code/ecp/msgq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/code/ecp/msgq.c b/code/ecp/msgq.c
index b928a2d..201af4a 100644
--- a/code/ecp/msgq.c
+++ b/code/ecp/msgq.c
@@ -76,7 +76,7 @@ int ecp_conn_msgq_push(ECPConnection *conn, ecp_seq_t seq, unsigned char mtype)
if (msgq == NULL) return ECP_ERR;
if (mtype >= ECP_MAX_MTYPE) return ECP_ERR_MAX_MTYPE;
- if (msgq->idx_w[mtype] - msgq->idx_r[mtype] == ECP_MSGQ_MAX_MSG) return ECP_MSGQ_ERR_MAX_MSG;
+ if ((unsigned short)(msgq->idx_w[mtype] - msgq->idx_r[mtype]) == ECP_MSGQ_MAX_MSG) return ECP_MSGQ_ERR_MAX_MSG;
if (msgq->idx_w[mtype] == msgq->idx_r[mtype]) pthread_cond_signal(&msgq->cond[mtype]);
msgq->seq_msg[mtype][MSG_IDX_MASK(msgq->idx_w[mtype])] = seq;