summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/mcalign.c
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2007-01-04 13:43:45 +0000
committerPierre Ossman <ossman@cendio.se>2007-01-04 13:43:45 +0000
commit521daf6f0ac4fa6a2fbfb5d523c0c743342dca2b (patch)
treeb4ae535c62dd1fd31c23eb2734aeaab8686a0fa4 /src/pulsecore/mcalign.c
parent1a460ee40ab19e354402f6c9346591b554471f03 (diff)
Huge trailing whitespace cleanup. Let's keep the tree pure from here on,
mmmkay? git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1418 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulsecore/mcalign.c')
-rw-r--r--src/pulsecore/mcalign.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/pulsecore/mcalign.c b/src/pulsecore/mcalign.c
index 9ede610d..baf36784 100644
--- a/src/pulsecore/mcalign.c
+++ b/src/pulsecore/mcalign.c
@@ -2,17 +2,17 @@
/***
This file is part of PulseAudio.
-
+
PulseAudio 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.
-
+
PulseAudio 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 PulseAudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -42,11 +42,11 @@ pa_mcalign *pa_mcalign_new(size_t base) {
assert(base);
m = pa_xnew(pa_mcalign, 1);
-
+
m->base = base;
pa_memchunk_reset(&m->leftover);
pa_memchunk_reset(&m->current);
-
+
return m;
}
@@ -58,22 +58,22 @@ void pa_mcalign_free(pa_mcalign *m) {
if (m->current.memblock)
pa_memblock_unref(m->current.memblock);
-
+
pa_xfree(m);
}
void pa_mcalign_push(pa_mcalign *m, const pa_memchunk *c) {
assert(m);
assert(c);
-
+
assert(c->memblock);
assert(c->length > 0);
assert(!m->current.memblock);
-
+
/* Append to the leftover memory block */
if (m->leftover.memblock) {
-
+
/* Try to merge */
if (m->leftover.memblock == c->memblock &&
m->leftover.index + m->leftover.length == c->index) {
@@ -85,7 +85,7 @@ void pa_mcalign_push(pa_mcalign *m, const pa_memchunk *c) {
if (m->leftover.length >= m->base) {
m->current = m->leftover;
pa_memchunk_reset(&m->leftover);
- }
+ }
} else {
size_t l;
@@ -93,7 +93,7 @@ void pa_mcalign_push(pa_mcalign *m, const pa_memchunk *c) {
/* We have to copy */
assert(m->leftover.length < m->base);
l = m->base - m->leftover.length;
-
+
if (l > c->length)
l = c->length;
@@ -115,7 +115,7 @@ void pa_mcalign_push(pa_mcalign *m, const pa_memchunk *c) {
}
} else {
/* Nothing to merge or copy, just store it */
-
+
if (c->length >= m->base)
m->current = *c;
else
@@ -146,7 +146,7 @@ int pa_mcalign_pop(pa_mcalign *m, pa_memchunk *c) {
m->leftover = m->current;
pa_memchunk_reset(&m->current);
}
-
+
return 0;
}
@@ -182,13 +182,13 @@ int pa_mcalign_pop(pa_mcalign *m, pa_memchunk *c) {
}
pa_memchunk_reset(&m->current);
-
+
return 0;
}
/* There's simply nothing */
return -1;
-
+
}
size_t pa_mcalign_csize(pa_mcalign *m, size_t l) {
@@ -196,9 +196,9 @@ size_t pa_mcalign_csize(pa_mcalign *m, size_t l) {
assert(l > 0);
assert(!m->current.memblock);
-
+
if (m->leftover.memblock)
l += m->leftover.length;
-
+
return (l/m->base)*m->base;
}