mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
nuttx/sched/mqueue: Change 'int prio' to 'unsigned int prio'. According to open group specification, priority field in mq_* functions should have unsigned type: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/mqueue.h.html
This commit is contained in:
committed by
Gregory Nutt
parent
41a4a40879
commit
626afb015b
@@ -260,7 +260,7 @@ int nxmq_wait_receive(mqd_t mqdes, FAR struct mqueue_msg_s **rcvmsg)
|
||||
****************************************************************************/
|
||||
|
||||
ssize_t nxmq_do_receive(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg,
|
||||
FAR char *ubuffer, int *prio)
|
||||
FAR char *ubuffer, unsigned int *prio)
|
||||
{
|
||||
FAR struct tcb_s *btcb;
|
||||
irqstate_t flags;
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
ssize_t nxmq_receive(mqd_t mqdes, FAR char *msg, size_t msglen,
|
||||
FAR int *prio)
|
||||
FAR unsigned int *prio)
|
||||
{
|
||||
FAR struct mqueue_msg_s *mqmsg;
|
||||
irqstate_t flags;
|
||||
@@ -179,7 +179,7 @@ ssize_t nxmq_receive(mqd_t mqdes, FAR char *msg, size_t msglen,
|
||||
****************************************************************************/
|
||||
|
||||
ssize_t mq_receive(mqd_t mqdes, FAR char *msg, size_t msglen,
|
||||
FAR int *prio)
|
||||
FAR unsigned int *prio)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -82,7 +82,8 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int nxmq_send(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio)
|
||||
int nxmq_send(mqd_t mqdes, FAR const char *msg, size_t msglen,
|
||||
unsigned int prio)
|
||||
{
|
||||
FAR struct mqueue_inode_s *msgq;
|
||||
FAR struct mqueue_msg_s *mqmsg = NULL;
|
||||
@@ -207,7 +208,7 @@ int nxmq_send(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int mq_send(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio)
|
||||
int mq_send(mqd_t mqdes, FAR const char *msg, size_t msglen, unsigned int prio)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -87,11 +87,11 @@
|
||||
****************************************************************************/
|
||||
|
||||
int nxmq_verify_send(mqd_t mqdes, FAR const char *msg, size_t msglen,
|
||||
int prio)
|
||||
unsigned int prio)
|
||||
{
|
||||
/* Verify the input parameters */
|
||||
|
||||
if (!msg || !mqdes || prio < 0 || prio > MQ_PRIO_MAX)
|
||||
if (msg == NULL || mqdes == NULL || prio > MQ_PRIO_MAX)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -339,7 +339,7 @@ int nxmq_wait_send(mqd_t mqdes)
|
||||
****************************************************************************/
|
||||
|
||||
int nxmq_do_send(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg,
|
||||
FAR const char *msg, size_t msglen, int prio)
|
||||
FAR const char *msg, size_t msglen, unsigned int prio)
|
||||
{
|
||||
FAR struct tcb_s *btcb;
|
||||
FAR struct mqueue_inode_s *msgq;
|
||||
|
||||
@@ -151,7 +151,8 @@ static void nxmq_rcvtimeout(int argc, wdparm_t pid)
|
||||
****************************************************************************/
|
||||
|
||||
ssize_t nxmq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen,
|
||||
FAR int *prio, FAR const struct timespec *abstime)
|
||||
FAR unsigned int *prio,
|
||||
FAR const struct timespec *abstime)
|
||||
{
|
||||
FAR struct tcb_s *rtcb = this_task();
|
||||
FAR struct mqueue_msg_s *mqmsg;
|
||||
@@ -326,7 +327,8 @@ ssize_t nxmq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen,
|
||||
****************************************************************************/
|
||||
|
||||
ssize_t mq_timedreceive(mqd_t mqdes, FAR char *msg, size_t msglen,
|
||||
FAR int *prio, FAR const struct timespec *abstime)
|
||||
FAR unsigned int *prio,
|
||||
FAR const struct timespec *abstime)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -157,8 +157,8 @@ static void nxmq_sndtimeout(int argc, wdparm_t pid)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int nxmq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio,
|
||||
FAR const struct timespec *abstime)
|
||||
int nxmq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen,
|
||||
unsigned int prio, FAR const struct timespec *abstime)
|
||||
{
|
||||
FAR struct tcb_s *rtcb = this_task();
|
||||
FAR struct mqueue_inode_s *msgq;
|
||||
@@ -382,8 +382,8 @@ errout_with_mqmsg:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio,
|
||||
FAR const struct timespec *abstime)
|
||||
int mq_timedsend(mqd_t mqdes, FAR const char *msg, size_t msglen,
|
||||
unsigned int prio, FAR const struct timespec *abstime)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
||||
@@ -153,15 +153,16 @@ void nxmq_wait_irq(FAR struct tcb_s *wtcb, int errcode);
|
||||
int nxmq_verify_receive(mqd_t mqdes, FAR char *msg, size_t msglen);
|
||||
int nxmq_wait_receive(mqd_t mqdes, FAR struct mqueue_msg_s **rcvmsg);
|
||||
ssize_t nxmq_do_receive(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg,
|
||||
FAR char *ubuffer, FAR int *prio);
|
||||
FAR char *ubuffer, FAR unsigned int *prio);
|
||||
|
||||
/* mq_sndinternal.c ********************************************************/
|
||||
|
||||
int nxmq_verify_send(mqd_t mqdes, FAR const char *msg, size_t msglen, int prio);
|
||||
int nxmq_verify_send(mqd_t mqdes, FAR const char *msg, size_t msglen,
|
||||
unsigned int prio);
|
||||
FAR struct mqueue_msg_s *nxmq_alloc_msg(void);
|
||||
int nxmq_wait_send(mqd_t mqdes);
|
||||
int nxmq_do_send(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg,
|
||||
FAR const char *msg, size_t msglen, int prio);
|
||||
FAR const char *msg, size_t msglen, unsigned int prio);
|
||||
|
||||
/* mq_release.c ************************************************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user