(libretro-common) Rename fifo_buffer to fifo_queue

This commit is contained in:
twinaphex 2016-03-20 14:06:21 +01:00
parent 87840e5b6c
commit ef4a1a3c0f
15 changed files with 25 additions and 25 deletions

View File

@ -166,7 +166,7 @@ OBJ += frontend/frontend.o \
tasks/task_overlay.o \
input/input_overlay.o \
patch.o \
libretro-common/queues/fifo_buffer.o \
libretro-common/queues/fifo_queue.o \
core_options.o \
libretro-common/compat/compat_fnmatch.o \
libretro-common/compat/compat_posix_string.o \

View File

@ -17,7 +17,7 @@
#include <stdlib.h>
#include <string.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include <rthreads/rthreads.h>
#include "audio_thread_wrapper.h"

View File

@ -19,7 +19,7 @@
#include <alsa/asoundlib.h>
#include <rthreads/rthreads.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include "../audio_driver.h"
#include "../../configuration.h"

View File

@ -27,7 +27,7 @@
#include <AudioUnit/AUComponent.h>
#include <boolean.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include <rthreads/rthreads.h>
#include <retro_endianness.h>
#include <string/stdstring.h>

View File

@ -32,7 +32,7 @@
#include <retro_inline.h>
#include <retro_miscellaneous.h>
#include <rthreads/rthreads.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include "../audio_driver.h"
#include "../../configuration.h"

View File

@ -17,7 +17,7 @@
#include <stdlib.h>
#include <string.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include "../audio_driver.h"
#include "../../configuration.h"

View File

@ -17,7 +17,7 @@
#include <boolean.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include <rthreads/rthreads.h>
#include "../audio_driver.h"

View File

@ -32,7 +32,7 @@ extern "C" {
#include <stdint.h>
#include <stddef.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#ifdef _WIN32
#define RSD_DEFAULT_HOST "127.0.0.1" /* Stupid Windows. */

View File

@ -23,7 +23,7 @@
#include <boolean.h>
#include <rthreads/rthreads.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include <retro_inline.h>
#include "../audio_driver.h"

View File

@ -39,7 +39,7 @@ extern "C" {
#endif
#include <rthreads/rthreads.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include "libretro.h"
#ifdef RARCH_INTERNAL

View File

@ -479,7 +479,7 @@ STATE TRACKER
/*============================================================
FIFO BUFFER
============================================================ */
#include "../libretro-common/queues/fifo_buffer.c"
#include "../libretro-common/queues/fifo_queue.c"
/*============================================================
AUDIO RESAMPLER

View File

@ -20,7 +20,7 @@
#include <rthreads/rthreads.h>
#include <compat/strl.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include <string/stdstring.h>
#include "../connect/joypad_connection.h"

View File

@ -23,12 +23,12 @@
#include <stdlib.h>
#include <string.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
struct fifo_buffer
{
uint8_t *buffer;
size_t bufsize;
size_t size;
size_t first;
size_t end;
};
@ -46,7 +46,7 @@ fifo_buffer_t *fifo_new(size_t size)
free(buf);
return NULL;
}
buf->bufsize = size + 1;
buf->size = size + 1;
return buf;
}
@ -72,7 +72,7 @@ size_t fifo_read_avail(fifo_buffer_t *buffer)
size_t end = buffer->end;
if (end < first)
end += buffer->bufsize;
end += buffer->size;
return end - first;
}
@ -82,9 +82,9 @@ size_t fifo_write_avail(fifo_buffer_t *buffer)
size_t end = buffer->end;
if (end < first)
end += buffer->bufsize;
end += buffer->size;
return (buffer->bufsize - 1) - (end - first);
return (buffer->size - 1) - (end - first);
}
void fifo_write(fifo_buffer_t *buffer, const void *in_buf, size_t size)
@ -92,16 +92,16 @@ void fifo_write(fifo_buffer_t *buffer, const void *in_buf, size_t size)
size_t first_write = size;
size_t rest_write = 0;
if (buffer->end + size > buffer->bufsize)
if (buffer->end + size > buffer->size)
{
first_write = buffer->bufsize - buffer->end;
first_write = buffer->size - buffer->end;
rest_write = size - first_write;
}
memcpy(buffer->buffer + buffer->end, in_buf, first_write);
memcpy(buffer->buffer, (const uint8_t*)in_buf + first_write, rest_write);
buffer->end = (buffer->end + size) % buffer->bufsize;
buffer->end = (buffer->end + size) % buffer->size;
}
@ -110,15 +110,15 @@ void fifo_read(fifo_buffer_t *buffer, void *in_buf, size_t size)
size_t first_read = size;
size_t rest_read = 0;
if (buffer->first + size > buffer->bufsize)
if (buffer->first + size > buffer->size)
{
first_read = buffer->bufsize - buffer->first;
first_read = buffer->size - buffer->first;
rest_read = size - first_read;
}
memcpy(in_buf, (const uint8_t*)buffer->buffer + buffer->first, first_read);
memcpy((uint8_t*)in_buf + first_read, buffer->buffer, rest_read);
buffer->first = (buffer->first + size) % buffer->bufsize;
buffer->first = (buffer->first + size) % buffer->size;
}

View File

@ -54,7 +54,7 @@ extern "C" {
#include <compat/msvc.h>
#include <boolean.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include <rthreads/rthreads.h>
#include <gfx/scaler/scaler.h>
#include <file/config_file.h>