diff options
author | Colin Guthrie <pulse@colin.guthr.ie> | 2008-08-22 10:56:45 +0100 |
---|---|---|
committer | Colin Guthrie <pulse@colin.guthr.ie> | 2008-08-22 10:56:45 +0100 |
commit | 4282b726ee57ebae846ce400fd1cae43c4dfb2ae (patch) | |
tree | 2cb32c3bc52a9b9eab50a6195f3ccb190332f7d8 /src/pulsecore/shm.c | |
parent | bf17dbb101d509e885bf689f4f13f75e4b3ab58d (diff) | |
parent | dc9b8dce309728b47059b9b44fd3bbd3798667ae (diff) |
Merge branch 'master' of git://git.0pointer.de/pulseaudio
Diffstat (limited to 'src/pulsecore/shm.c')
-rw-r--r-- | src/pulsecore/shm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pulsecore/shm.c b/src/pulsecore/shm.c index 298bf716..b0870202 100644 --- a/src/pulsecore/shm.c +++ b/src/pulsecore/shm.c @@ -138,7 +138,7 @@ int pa_shm_create_rw(pa_shm *m, size_t size, pa_bool_t shared, mode_t mode) { m->size = size + PA_ALIGN(sizeof(struct shm_marker)); - if (ftruncate(fd, m->size) < 0) { + if (ftruncate(fd, (off_t) m->size) < 0) { pa_log("ftruncate() failed: %s", pa_cstrerror(errno)); goto fail; } @@ -235,7 +235,7 @@ void pa_shm_punch(pa_shm *m, size_t offset, size_t size) { /* Align this to multiples of the page size */ ptr = (uint8_t*) m->ptr + offset; - o = (uint8_t*) ptr - (uint8_t*) PA_PAGE_ALIGN_PTR(ptr); + o = (size_t) ((uint8_t*) ptr - (uint8_t*) PA_PAGE_ALIGN_PTR(ptr)); if (o > 0) { ps = PA_PAGE_SIZE; @@ -289,7 +289,7 @@ int pa_shm_attach_ro(pa_shm *m, unsigned id) { goto fail; } - m->size = st.st_size; + m->size = (size_t) st.st_size; if ((m->ptr = mmap(NULL, m->size, PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED) { pa_log("mmap() failed: %s", pa_cstrerror(errno)); |