Fix up some more type stuff in pcmbuf.c.
(Never seem to find it all at once :-)
Change-Id: I4b3d145c6d90be13f9afc8a72d8d87a92de88d88
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index 7ba4eee..d36883f 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -91,8 +91,8 @@
/* General PCM buffer data */
#define INVALID_BUF_INDEX ((size_t)0 - (size_t)1)
-static unsigned char *pcmbuf_buffer;
-static unsigned char *pcmbuf_guardbuf;
+static void *pcmbuf_buffer;
+static void *pcmbuf_guardbuf;
static size_t pcmbuf_size;
static struct chunkdesc *pcmbuf_descriptors;
static unsigned int pcmbuf_desc_count;
@@ -126,7 +126,7 @@
#ifdef HAVE_CROSSFADE
/* Crossfade buffer */
-static unsigned char *crossfade_buffer;
+static void *crossfade_buffer;
/* Crossfade related state */
static int crossfade_setting;
@@ -496,9 +496,9 @@
/* Initialize the PCM buffer. The structure looks like this:
* ...[|FADEBUF]|---------PCMBUF---------|GUARDBUF|DESCS| */
-size_t pcmbuf_init(unsigned char *bufend)
+size_t pcmbuf_init(void *bufend)
{
- unsigned char *bufstart;
+ void *bufstart;
/* Set up the buffers */
pcmbuf_desc_count = get_next_required_pcmbuf_chunks();
@@ -844,7 +844,7 @@
return size;
const int16_t *input_buf = buf;
- int16_t *output_buf = (int16_t *)index_buffer(index);
+ int16_t *output_buf = index_buffer(index);
while (size)
{
@@ -912,7 +912,7 @@
return size;
}
- output_buf = (int16_t *)index_buffer(index);
+ output_buf = index_buffer(index);
}
}
@@ -1042,7 +1042,7 @@
/* Perform fade-in of new track */
static void write_to_crossfade(size_t size, unsigned long elapsed, off_t offset)
{
- unsigned char *buf = crossfade_buffer;
+ void *buf = crossfade_buffer;
if (crossfade_fade_in_rem)
{
@@ -1072,7 +1072,7 @@
/* Fade remaining samples in place */
int samples = fade_rem / 4;
- int16_t *input_buf = (int16_t *)buf;
+ int16_t *input_buf = buf;
while (samples--)
{
@@ -1102,7 +1102,7 @@
while (size > 0)
{
size_t copy_n = size;
- unsigned char *outbuf = get_write_buffer(©_n);
+ void *outbuf = get_write_buffer(©_n);
memcpy(outbuf, buf, copy_n);
commit_write_buffer(copy_n, elapsed, offset);
buf += copy_n;
diff --git a/apps/pcmbuf.h b/apps/pcmbuf.h
index 9010fcc..7fa3563 100644
--- a/apps/pcmbuf.h
+++ b/apps/pcmbuf.h
@@ -28,7 +28,7 @@
void pcmbuf_write_complete(int count, unsigned long elapsed, off_t offset);
/* Init */
-size_t pcmbuf_init(unsigned char *bufend);
+size_t pcmbuf_init(void *bufend);
/* Playback */
void pcmbuf_play_start(void);