diff options
author | tinyalsa <simonwilson@google.com> | 2012-02-10 14:48:21 -0800 |
---|---|---|
committer | tinyalsa <simonwilson@google.com> | 2012-02-10 14:48:21 -0800 |
commit | d88eedb72a6deea7d2751e4b80674607cccebdef (patch) | |
tree | fb5b3f5a9f8883b62476d11f5d2910e51949c0de /pcm.c | |
parent | 19eda2de961aced7365a31a02ec210a43f03efad (diff) | |
parent | 6bbe77a79ad7d82e11ab0e76fe14261573a10f71 (diff) |
Merge pull request #11 from broonie/const-write
pcm: Constify write buffers
Diffstat (limited to 'pcm.c')
-rw-r--r-- | pcm.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -295,7 +295,7 @@ static int pcm_areas_copy(struct pcm *pcm, unsigned int pcm_offset, 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 @@ int pcm_get_htimestamp(struct pcm *pcm, unsigned int *avail, 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 @@ int pcm_wait(struct pcm *pcm, int timeout) 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; |