mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
message_queue.c - Fix warnings
This commit is contained in:
parent
fe8f22b688
commit
034aa35a0c
@ -124,11 +124,21 @@ void msg_queue_clear(msg_queue_t *queue)
|
|||||||
|
|
||||||
const char *msg_queue_pull(msg_queue_t *queue)
|
const char *msg_queue_pull(msg_queue_t *queue)
|
||||||
{
|
{
|
||||||
|
struct queue_elem *front = NULL;
|
||||||
|
struct queue_elem *last = NULL;
|
||||||
|
struct queue_elem *parent = NULL;
|
||||||
|
struct queue_elem *child = NULL;
|
||||||
|
size_t tmp_ptr = 1;
|
||||||
|
|
||||||
|
(void)parent;
|
||||||
|
(void)child;
|
||||||
|
(void)tmp_ptr;
|
||||||
|
|
||||||
/* Nothing in queue. */
|
/* Nothing in queue. */
|
||||||
if (!queue || queue->ptr == 1)
|
if (!queue || queue->ptr == 1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
struct queue_elem *front = queue->elems[1];
|
front = (struct queue_elem*)queue->elems[1];
|
||||||
front->duration--;
|
front->duration--;
|
||||||
if (front->duration > 0)
|
if (front->duration > 0)
|
||||||
return front->msg;
|
return front->msg;
|
||||||
@ -138,12 +148,11 @@ const char *msg_queue_pull(msg_queue_t *queue)
|
|||||||
queue->tmp_msg = front->msg;
|
queue->tmp_msg = front->msg;
|
||||||
front->msg = NULL;
|
front->msg = NULL;
|
||||||
|
|
||||||
struct queue_elem *front = queue->elems[1];
|
front = (struct queue_elem*)queue->elems[1];
|
||||||
struct queue_elem *last = queue->elems[--queue->ptr];
|
last = (struct queue_elem*)queue->elems[--queue->ptr];
|
||||||
queue->elems[1] = last;
|
queue->elems[1] = last;
|
||||||
free(front);
|
free(front);
|
||||||
|
|
||||||
size_t tmp_ptr = 1;
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
bool left = (tmp_ptr * 2 <= queue->ptr)
|
bool left = (tmp_ptr * 2 <= queue->ptr)
|
||||||
@ -167,8 +176,9 @@ const char *msg_queue_pull(msg_queue_t *queue)
|
|||||||
else
|
else
|
||||||
switch_index += switch_index + 1;
|
switch_index += switch_index + 1;
|
||||||
}
|
}
|
||||||
struct queue_elem *parent = queue->elems[tmp_ptr];
|
|
||||||
struct queue_elem *child = queue->elems[switch_index];
|
parent = (struct queue_elem*)queue->elems[tmp_ptr];
|
||||||
|
child = (struct queue_elem*)queue->elems[switch_index];
|
||||||
queue->elems[tmp_ptr] = child;
|
queue->elems[tmp_ptr] = child;
|
||||||
queue->elems[switch_index] = parent;
|
queue->elems[switch_index] = parent;
|
||||||
tmp_ptr = switch_index;
|
tmp_ptr = switch_index;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user