pcm: Constify write buffers
Mark the write buffers as const - they won't be modified and this is
friendlier to applications.
diff --git a/pcm.c b/pcm.c
index 2ef7075..d7f1614 100644
--- a/pcm.c
+++ b/pcm.c
@@ -295,7 +295,7 @@
return 0;
}
-static int pcm_mmap_write_areas(struct pcm *pcm, char *src,
+static int pcm_mmap_write_areas(struct pcm *pcm, const char *src,
unsigned int offset, unsigned int size)
{
void *pcm_areas;
@@ -355,14 +355,14 @@
return 0;
}
-int pcm_write(struct pcm *pcm, void *data, unsigned int count)
+int pcm_write(struct pcm *pcm, const void *data, unsigned int count)
{
struct snd_xferi x;
if (pcm->flags & PCM_IN)
return -EINVAL;
- x.buf = data;
+ x.buf = (void*)data;
x.frames = count / (pcm->config.channels *
pcm_format_to_bits(pcm->config.format) / 8);
@@ -748,7 +748,7 @@
return 1;
}
-int pcm_mmap_write(struct pcm *pcm, void *buffer, unsigned int bytes)
+int pcm_mmap_write(struct pcm *pcm, const void *buffer, unsigned int bytes)
{
int err = 0, frames, avail;
unsigned int offset = 0, count;