From 181e9c6d5d11cb1e5d36a2777eeb233ad8ed00e5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 9 Oct 2008 18:15:23 +0200 Subject: big pile of updates to match more what happened with libcanberra --- src/interleave.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'src/interleave.c') diff --git a/src/interleave.c b/src/interleave.c index 31d1a6b..d5d68d3 100644 --- a/src/interleave.c +++ b/src/interleave.c @@ -1,3 +1,23 @@ +/*** + This file is part of libsydney. + + Copyright 2007-2008 Lennart Poettering + + libsydney is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 2.1 of the + License, or (at your option) any later version. + + libsydney is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with libsydney. If not, see + . +***/ + #ifdef HAVE_CONFIG_H #include #endif @@ -18,7 +38,7 @@ static void interleave8(void *_dst, size_t dstr, const void *_src, size_t sstr, static void interleave16(void *_dst, size_t dstr, const void *_src, size_t sstr, size_t bytes) { uint16_t *dst = _dst; const uint16_t *src = _src; - unsigned n = bytes / sizeof(uint16_t); + size_t n = bytes / sizeof(uint16_t); for (; n > 0; n--, src += sstr/sizeof(uint16_t), dst += dstr/sizeof(uint16_t)) *dst = *src; @@ -27,7 +47,7 @@ static void interleave16(void *_dst, size_t dstr, const void *_src, size_t sstr, static void interleave24(void *_dst, size_t dstr, const void *_src, size_t sstr, size_t bytes) { uint8_t *dst = _dst; const uint8_t *src = _src; - unsigned n = bytes / 3; + size_t n = bytes / 3; for (; n > 0; n--, src += sstr/3, dst += dstr/3) { dst[0] = src[0]; @@ -39,7 +59,7 @@ static void interleave24(void *_dst, size_t dstr, const void *_src, size_t sstr, static void interleave32(void *_dst, size_t dstr, const void *_src, size_t sstr, size_t bytes) { uint32_t *dst = _dst; const uint32_t *src = _src; - unsigned n = bytes / sizeof(uint32_t); + size_t n = bytes / sizeof(uint32_t); for (; n > 0; n--, src += sstr/sizeof(uint32_t), dst += dstr/sizeof(uint32_t)) *dst = *src; -- cgit