Skip to content

Commit

Permalink
Fix macOS issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanBertrand committed Apr 9, 2024
1 parent 3c2103d commit 402053f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Os/MacOs/IPCQueueStub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace Os {
(void) pthread_mutex_destroy(&this->queueLock);
}
bool create(NATIVE_INT_TYPE depth, NATIVE_INT_TYPE msgSize) {
return queue.create(depth, msgSize);
return queue.create(static_cast<NATIVE_UINT_TYPE>(depth), msgSize);
}
BufferQueue queue;
pthread_cond_t queueNotEmpty;
Expand Down Expand Up @@ -107,7 +107,7 @@ namespace Os {
///////////////////////////////

// Push item onto queue:
bool pushSucceeded = queue->push(buffer, size, priority);
bool pushSucceeded = queue->push(buffer, static_cast<NATIVE_UINT_TYPE>(size), priority);

if(pushSucceeded) {
// Push worked - wake up a thread that might be waiting on
Expand Down Expand Up @@ -151,7 +151,7 @@ namespace Os {
}

// Push item onto queue:
bool pushSucceeded = queue->push(buffer, size, priority);
bool pushSucceeded = queue->push(buffer, static_cast<NATIVE_UINT_TYPE>(size), priority);

// The only reason push would not succeed is if the queue
// was full. Since we waited for the queue to NOT be full
Expand Down Expand Up @@ -262,7 +262,7 @@ namespace Os {
pthread_mutex_t* queueLock = &queueHandle->queueLock;
NATIVE_INT_TYPE ret;

NATIVE_UINT_TYPE size = capacity;
NATIVE_UINT_TYPE size = static_cast<NATIVE_UINT_TYPE>(capacity);
NATIVE_INT_TYPE pri = 0;
Queue::QueueStatus status = Queue::QUEUE_OK;

Expand Down Expand Up @@ -346,7 +346,7 @@ namespace Os {
return 0;
}
BufferQueue* queue = &queueHandle->queue;
return queue->getCount();
return static_cast<NATIVE_INT_TYPE>(queue->getCount());
}

NATIVE_INT_TYPE IPCQueue::getMaxMsgs() const {
Expand All @@ -355,7 +355,7 @@ namespace Os {
return 0;
}
BufferQueue* queue = &queueHandle->queue;
return queue->getMaxCount();
return static_cast<NATIVE_INT_TYPE>(queue->getMaxCount());
}

NATIVE_INT_TYPE IPCQueue::getQueueSize() const {
Expand All @@ -364,7 +364,7 @@ namespace Os {
return 0;
}
BufferQueue* queue = &queueHandle->queue;
return queue->getDepth();
return static_cast<NATIVE_INT_TYPE>(queue->getDepth());
}

NATIVE_INT_TYPE IPCQueue::getMsgSize() const {
Expand All @@ -373,7 +373,7 @@ namespace Os {
return 0;
}
BufferQueue* queue = &queueHandle->queue;
return queue->getMsgSize();
return static_cast<NATIVE_INT_TYPE>(queue->getMsgSize());
}

}

0 comments on commit 402053f

Please sign in to comment.