summaryrefslogtreecommitdiffstats
path: root/src/pulsecore
diff options
context:
space:
mode:
authorMaarten Bosmans <mkbosmans@gmail.com>2011-03-02 12:41:26 +0100
committerColin Guthrie <cguthrie@mandriva.org>2011-03-11 11:49:35 +0000
commitecf09f2cd6bf2f46b0d2402c700ab618c090bd4c (patch)
treefa04aff3a62debf23ab4416fcc56e1e739512a7e /src/pulsecore
parent5715b2af3091f9be9a656dfa9b8cb778caf1c03e (diff)
Fix up according to Coding Style
Only whitespace changes in here
Diffstat (limited to 'src/pulsecore')
-rw-r--r--src/pulsecore/core-util.c13
-rw-r--r--src/pulsecore/cpu-arm.c36
-rw-r--r--src/pulsecore/cpu-x86.c26
-rw-r--r--src/pulsecore/database-simple.c2
-rw-r--r--src/pulsecore/ipacl.c2
-rw-r--r--src/pulsecore/memblock.c8
-rw-r--r--src/pulsecore/memblockq.c4
-rw-r--r--src/pulsecore/poll.c4
-rw-r--r--src/pulsecore/poll.h7
-rw-r--r--src/pulsecore/protocol-native.c8
-rw-r--r--src/pulsecore/remap.c18
-rw-r--r--src/pulsecore/remap_mmx.c8
-rw-r--r--src/pulsecore/remap_sse.c6
-rw-r--r--src/pulsecore/resampler.c6
-rw-r--r--src/pulsecore/sample-util.c2
-rw-r--r--src/pulsecore/sconv_sse.c26
-rw-r--r--src/pulsecore/semaphore-osx.c3
-rw-r--r--src/pulsecore/semaphore-win32.c3
-rw-r--r--src/pulsecore/sink-input.c8
-rw-r--r--src/pulsecore/sink.c32
-rw-r--r--src/pulsecore/sndfile-util.c11
-rw-r--r--src/pulsecore/sound-file-stream.c2
-rw-r--r--src/pulsecore/source.c32
-rw-r--r--src/pulsecore/source.h2
-rw-r--r--src/pulsecore/strbuf.c2
-rw-r--r--src/pulsecore/svolume_arm.c34
-rw-r--r--src/pulsecore/svolume_c.c71
-rw-r--r--src/pulsecore/svolume_mmx.c42
-rw-r--r--src/pulsecore/svolume_sse.c40
-rw-r--r--src/pulsecore/usergroup.c16
-rw-r--r--src/pulsecore/x11prop.c3
31 files changed, 209 insertions, 268 deletions
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 02e9bf63..bb0f5601 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -217,12 +217,12 @@ int pa_make_secure_dir(const char* dir, mode_t m, uid_t uid, gid_t gid) {
#ifdef OS_IS_WIN32
r = mkdir(dir);
#else
- {
+{
mode_t u;
u = umask((~m) & 0777);
r = mkdir(dir, m);
umask(u);
- }
+}
#endif
if (r < 0 && errno != EEXIST)
@@ -1043,8 +1043,7 @@ static int is_group(gid_t gid, const char *name) {
int r = -1;
errno = 0;
- if (!(group = pa_getgrgid_malloc(gid)))
- {
+ if (!(group = pa_getgrgid_malloc(gid))) {
if (!errno)
errno = ENOENT;
@@ -1110,8 +1109,7 @@ int pa_uid_in_group(uid_t uid, const char *name) {
int r = -1;
errno = 0;
- if (!(group = pa_getgrnam_malloc(name)))
- {
+ if (!(group = pa_getgrnam_malloc(name))) {
if (!errno)
errno = ENOENT;
goto finish;
@@ -1146,8 +1144,7 @@ gid_t pa_get_gid_of_group(const char *name) {
struct group *gr = NULL;
errno = 0;
- if (!(gr = pa_getgrnam_malloc(name)))
- {
+ if (!(gr = pa_getgrnam_malloc(name))) {
if (!errno)
errno = ENOENT;
goto finish;
diff --git a/src/pulsecore/cpu-arm.c b/src/pulsecore/cpu-arm.c
index 1d0d7651..781ad37a 100644
--- a/src/pulsecore/cpu-arm.c
+++ b/src/pulsecore/cpu-arm.c
@@ -39,22 +39,22 @@
#define MAX_BUFFER 4096
static char *
-get_cpuinfo_line (char *cpuinfo, const char *tag) {
+get_cpuinfo_line(char *cpuinfo, const char *tag) {
char *line, *end, *colon;
- if (!(line = strstr (cpuinfo, tag)))
+ if (!(line = strstr(cpuinfo, tag)))
return NULL;
- if (!(end = strchr (line, '\n')))
+ if (!(end = strchr(line, '\n')))
return NULL;
- if (!(colon = strchr (line, ':')))
+ if (!(colon = strchr(line, ':')))
return NULL;
if (++colon >= end)
return NULL;
- return pa_xstrndup (colon, end - colon);
+ return pa_xstrndup(colon, end - colon);
}
static char *get_cpuinfo(void) {
@@ -80,7 +80,7 @@ static char *get_cpuinfo(void) {
}
#endif /* defined (__arm__) && defined (__linux__) */
-pa_bool_t pa_cpu_init_arm (pa_cpu_arm_flag_t *flags) {
+pa_bool_t pa_cpu_init_arm(pa_cpu_arm_flag_t *flags) {
#if defined (__arm__)
#if defined (__linux__)
char *cpuinfo, *line;
@@ -88,16 +88,16 @@ pa_bool_t pa_cpu_init_arm (pa_cpu_arm_flag_t *flags) {
/* We need to read the CPU flags from /proc/cpuinfo because there is no user
* space support to get the CPU features. This only works on linux AFAIK. */
- if (!(cpuinfo = get_cpuinfo ())) {
- pa_log ("Can't read cpuinfo");
+ if (!(cpuinfo = get_cpuinfo())) {
+ pa_log("Can't read cpuinfo");
return;
}
*flags = 0;
/* get the CPU architecture */
- if ((line = get_cpuinfo_line (cpuinfo, "CPU architecture"))) {
- arch = strtoul (line, NULL, 0);
+ if ((line = get_cpuinfo_line(cpuinfo, "CPU architecture"))) {
+ arch = strtoul(line, NULL, 0);
if (arch >= 6)
*flags |= PA_CPU_ARM_V6;
if (arch >= 7)
@@ -106,18 +106,18 @@ pa_bool_t pa_cpu_init_arm (pa_cpu_arm_flag_t *flags) {
pa_xfree(line);
}
/* get the CPU features */
- if ((line = get_cpuinfo_line (cpuinfo, "Features"))) {
+ if ((line = get_cpuinfo_line(cpuinfo, "Features"))) {
const char *state = NULL;
char *current;
- while ((current = pa_split_spaces (line, &state))) {
- if (!strcmp (current, "vfp"))
+ while ((current = pa_split_spaces(line, &state))) {
+ if (!strcmp(current, "vfp"))
*flags |= PA_CPU_ARM_VFP;
- else if (!strcmp (current, "edsp"))
+ else if (!strcmp(current, "edsp"))
*flags |= PA_CPU_ARM_EDSP;
- else if (!strcmp (current, "neon"))
+ else if (!strcmp(current, "neon"))
*flags |= PA_CPU_ARM_NEON;
- else if (!strcmp (current, "vfpv3"))
+ else if (!strcmp(current, "vfpv3"))
*flags |= PA_CPU_ARM_VFPV3;
pa_xfree(current);
@@ -125,7 +125,7 @@ pa_bool_t pa_cpu_init_arm (pa_cpu_arm_flag_t *flags) {
}
pa_xfree(cpuinfo);
- pa_log_info ("CPU flags: %s%s%s%s%s%s",
+ pa_log_info("CPU flags: %s%s%s%s%s%s",
(*flags & PA_CPU_ARM_V6) ? "V6 " : "",
(*flags & PA_CPU_ARM_V7) ? "V7 " : "",
(*flags & PA_CPU_ARM_VFP) ? "VFP " : "",
@@ -134,7 +134,7 @@ pa_bool_t pa_cpu_init_arm (pa_cpu_arm_flag_t *flags) {
(*flags & PA_CPU_ARM_VFPV3) ? "VFPV3 " : "");
if (*flags & PA_CPU_ARM_V6)
- pa_volume_func_init_arm (*flags);
+ pa_volume_func_init_arm(*flags);
return TRUE;
diff --git a/src/pulsecore/cpu-x86.c b/src/pulsecore/cpu-x86.c
index 062a4c1b..05a4b2f0 100644
--- a/src/pulsecore/cpu-x86.c
+++ b/src/pulsecore/cpu-x86.c
@@ -31,9 +31,7 @@
#include "cpu-x86.h"
#if defined (__i386__) || defined (__amd64__)
-static void
-get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
-{
+static void get_cpuid(uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d) {
__asm__ __volatile__ (
" push %%"PA_REG_b" \n\t"
" cpuid \n\t"
@@ -46,7 +44,7 @@ get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
}
#endif
-pa_bool_t pa_cpu_init_x86 (pa_cpu_x86_flag_t *flags) {
+pa_bool_t pa_cpu_init_x86(pa_cpu_x86_flag_t *flags) {
#if defined (__i386__) || defined (__amd64__)
uint32_t eax, ebx, ecx, edx;
uint32_t level;
@@ -54,9 +52,9 @@ pa_bool_t pa_cpu_init_x86 (pa_cpu_x86_flag_t *flags) {
*flags = 0;
/* get standard level */
- get_cpuid (0x00000000, &level, &ebx, &ecx, &edx);
+ get_cpuid(0x00000000, &level, &ebx, &ecx, &edx);
if (level >= 1) {
- get_cpuid (0x00000001, &eax, &ebx, &ecx, &edx);
+ get_cpuid(0x00000001, &eax, &ebx, &ecx, &edx);
if (edx & (1<<15))
*flags |= PA_CPU_X86_CMOV;
@@ -84,9 +82,9 @@ pa_bool_t pa_cpu_init_x86 (pa_cpu_x86_flag_t *flags) {
}
/* get extended level */
- get_cpuid (0x80000000, &level, &ebx, &ecx, &edx);
+ get_cpuid(0x80000000, &level, &ebx, &ecx, &edx);
if (level >= 0x80000001) {
- get_cpuid (0x80000001, &eax, &ebx, &ecx, &edx);
+ get_cpuid(0x80000001, &eax, &ebx, &ecx, &edx);
if (edx & (1<<22))
*flags |= PA_CPU_X86_MMXEXT;
@@ -101,7 +99,7 @@ pa_bool_t pa_cpu_init_x86 (pa_cpu_x86_flag_t *flags) {
*flags |= PA_CPU_X86_3DNOW;
}
- pa_log_info ("CPU flags: %s%s%s%s%s%s%s%s%s%s%s",
+ pa_log_info("CPU flags: %s%s%s%s%s%s%s%s%s%s%s",
(*flags & PA_CPU_X86_CMOV) ? "CMOV " : "",
(*flags & PA_CPU_X86_MMX) ? "MMX " : "",
(*flags & PA_CPU_X86_SSE) ? "SSE " : "",
@@ -116,14 +114,14 @@ pa_bool_t pa_cpu_init_x86 (pa_cpu_x86_flag_t *flags) {
/* activate various optimisations */
if (*flags & PA_CPU_X86_MMX) {
- pa_volume_func_init_mmx (*flags);
- pa_remap_func_init_mmx (*flags);
+ pa_volume_func_init_mmx(*flags);
+ pa_remap_func_init_mmx(*flags);
}
if (*flags & (PA_CPU_X86_SSE | PA_CPU_X86_SSE2)) {
- pa_volume_func_init_sse (*flags);
- pa_remap_func_init_sse (*flags);
- pa_convert_func_init_sse (*flags);
+ pa_volume_func_init_sse(*flags);
+ pa_remap_func_init_sse(*flags);
+ pa_convert_func_init_sse(*flags);
}
return TRUE;
diff --git a/src/pulsecore/database-simple.c b/src/pulsecore/database-simple.c
index 754930db..237d0bdd 100644
--- a/src/pulsecore/database-simple.c
+++ b/src/pulsecore/database-simple.c
@@ -429,7 +429,7 @@ static int write_uint(FILE *f, const uint32_t num) {
errno = 0;
for (i = 0; i < 4; i++)
- values[i] = (num >> (i*8)) & 0xFF;
+ values[i] = (num >> (i*8)) & 0xFF;
items = fwrite(&values, sizeof(values), sizeof(uint8_t), f);
diff --git a/src/pulsecore/ipacl.c b/src/pulsecore/ipacl.c
index 0cbe34af..ba35640d 100644
--- a/src/pulsecore/ipacl.c
+++ b/src/pulsecore/ipacl.c
@@ -212,7 +212,7 @@ int pa_ip_acl_check(pa_ip_acl *acl, int fd) {
return 1;
#ifdef HAVE_IPV6
} else if (e->family == AF_INET6) {
- int i, bits ;
+ int i, bits;
struct sockaddr_in6 *sai = (struct sockaddr_in6*) &sa;
if (e->bits == 128)
diff --git a/src/pulsecore/memblock.c b/src/pulsecore/memblock.c
index 454900d1..ce8b2540 100644
--- a/src/pulsecore/memblock.c
+++ b/src/pulsecore/memblock.c
@@ -531,9 +531,7 @@ static void memblock_free(pa_memblock *b) {
pa_mutex_lock(import->mutex);
- pa_assert_se(pa_hashmap_remove(
- import->blocks,
- PA_UINT32_TO_PTR(b->per_type.imported.id)));
+ pa_assert_se(pa_hashmap_remove(import->blocks, PA_UINT32_TO_PTR(b->per_type.imported.id)));
pa_assert(segment->n_blocks >= 1);
if (-- segment->n_blocks <= 0)
@@ -693,9 +691,7 @@ static void memblock_replace_import(pa_memblock *b) {
pa_mutex_lock(import->mutex);
- pa_assert_se(pa_hashmap_remove(
- import->blocks,
- PA_UINT32_TO_PTR(b->per_type.imported.id)));
+ pa_assert_se(pa_hashmap_remove(import->blocks, PA_UINT32_TO_PTR(b->per_type.imported.id)));
memblock_make_local(b);
diff --git a/src/pulsecore/memblockq.c b/src/pulsecore/memblockq.c
index 11faedac..c76ca841 100644
--- a/src/pulsecore/memblockq.c
+++ b/src/pulsecore/memblockq.c
@@ -376,8 +376,8 @@ int pa_memblockq_push(pa_memblockq* bq, const pa_memchunk *uchunk) {
size_t d;
pa_assert(bq->write_index + (int64_t)chunk.length > q->index &&
- bq->write_index + (int64_t)chunk.length < q->index + (int64_t)q->chunk.length &&
- bq->write_index < q->index);
+ bq->write_index + (int64_t)chunk.length < q->index + (int64_t)q->chunk.length &&
+ bq->write_index < q->index);
/* The job overwrites the current entry at the end, so let's drop the beginning of this entry */
diff --git a/src/pulsecore/poll.c b/src/pulsecore/poll.c
index b993c478..df4feb01 100644
--- a/src/pulsecore/poll.c
+++ b/src/pulsecore/poll.c
@@ -105,7 +105,7 @@ int pa_poll (struct pollfd *fds, unsigned long int nfds, int timeout) {
tv.tv_sec = timeout / 1000;
tv.tv_usec = (timeout % 1000) * 1000;
- ready = select ((SELECT_TYPE_ARG1) maxfd + 1, SELECT_TYPE_ARG234 &rset,
+ ready = select((SELECT_TYPE_ARG1) maxfd + 1, SELECT_TYPE_ARG234 &rset,
SELECT_TYPE_ARG234 &wset, SELECT_TYPE_ARG234 &xset,
SELECT_TYPE_ARG5 (timeout == -1 ? NULL : &tv));
@@ -160,7 +160,7 @@ int pa_poll (struct pollfd *fds, unsigned long int nfds, int timeout) {
/* Linux alters the tv struct... but it shouldn't matter here ...
* as we're going to be a little bit out anyway as we've just eaten
* more than a couple of cpu cycles above */
- ready = select ((SELECT_TYPE_ARG1) maxfd + 1, SELECT_TYPE_ARG234 &rset,
+ ready = select((SELECT_TYPE_ARG1) maxfd + 1, SELECT_TYPE_ARG234 &rset,
SELECT_TYPE_ARG234 &wset, SELECT_TYPE_ARG234 &xset,
SELECT_TYPE_ARG5 (timeout == -1 ? NULL : &tv));
}
diff --git a/src/pulsecore/poll.h b/src/pulsecore/poll.h
index a137d974..dc741e5e 100644
--- a/src/pulsecore/poll.h
+++ b/src/pulsecore/poll.h
@@ -43,12 +43,11 @@
#define POLLNVAL 0x020 /* Invalid polling request. */
/* Data structure describing a polling request. */
-struct pollfd
- {
+struct pollfd {
int fd; /* File descriptor to poll. */
short int events; /* Types of events poller cares about. */
short int revents; /* Types of events that actually occurred. */
- };
+};
/* Poll the file descriptors described by the NFDS structures starting at
@@ -62,5 +61,5 @@ struct pollfd
#if defined(HAVE_POLL_H) && !defined(OS_IS_DARWIN)
#define pa_poll(fds,nfds,timeout) poll((fds),(nfds),(timeout))
#else
-int pa_poll (struct pollfd *fds, unsigned long nfds, int timeout);
+int pa_poll(struct pollfd *fds, unsigned long nfds, int timeout);
#endif
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index c812a3e1..82007e83 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -1387,7 +1387,7 @@ static int sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int
/* If more data is in queue, we rewind later instead. */
if (s->seek_windex != -1)
- windex = PA_MIN(windex, s->seek_windex);
+ windex = PA_MIN(windex, s->seek_windex);
if (pa_atomic_dec(&s->seek_or_post_in_queue) > 1)
s->seek_windex = windex;
else {
@@ -1406,7 +1406,7 @@ static int sink_input_process_msg(pa_msgobject *o, int code, void *userdata, int
pa_sink_input *isync;
void (*func)(pa_memblockq *bq);
- switch (code) {
+ switch (code) {
case SINK_INPUT_MESSAGE_FLUSH:
func = flush_write_no_account;
break;
@@ -4939,7 +4939,7 @@ pa_pstream* pa_native_connection_get_pstream(pa_native_connection *c) {
}
pa_client* pa_native_connection_get_client(pa_native_connection *c) {
- pa_native_connection_assert_ref(c);
+ pa_native_connection_assert_ref(c);
- return c->client;
+ return c->client;
}
diff --git a/src/pulsecore/remap.c b/src/pulsecore/remap.c
index a0fc85b9..b831f78c 100644
--- a/src/pulsecore/remap.c
+++ b/src/pulsecore/remap.c
@@ -32,7 +32,7 @@
#include "remap.h"
-static void remap_mono_to_stereo_c (pa_remap_t *m, void *dst, const void *src, unsigned n) {
+static void remap_mono_to_stereo_c(pa_remap_t *m, void *dst, const void *src, unsigned n) {
unsigned i;
switch (*m->format) {
@@ -85,7 +85,7 @@ static void remap_mono_to_stereo_c (pa_remap_t *m, void *dst, const void *src, u
}
}
-static void remap_channels_matrix_c (pa_remap_t *m, void *dst, const void *src, unsigned n) {
+static void remap_channels_matrix_c(pa_remap_t *m, void *dst, const void *src, unsigned n) {
unsigned oc, ic, i;
unsigned n_ic, n_oc;
@@ -97,7 +97,7 @@ static void remap_channels_matrix_c (pa_remap_t *m, void *dst, const void *src,
{
float *d, *s;
- memset(dst, 0, n * sizeof (float) * n_oc);
+ memset(dst, 0, n * sizeof(float) * n_oc);
for (oc = 0; oc < n_oc; oc++) {
@@ -128,7 +128,7 @@ static void remap_channels_matrix_c (pa_remap_t *m, void *dst, const void *src,
{
int16_t *d, *s;
- memset(dst, 0, n * sizeof (int16_t) * n_oc);
+ memset(dst, 0, n * sizeof(int16_t) * n_oc);
for (oc = 0; oc < n_oc; oc++) {
@@ -160,7 +160,7 @@ static void remap_channels_matrix_c (pa_remap_t *m, void *dst, const void *src,
}
/* set the function that will execute the remapping based on the matrices */
-static void init_remap_c (pa_remap_t *m) {
+static void init_remap_c(pa_remap_t *m) {
unsigned n_oc, n_ic;
n_oc = m->o_ss->channels;
@@ -181,17 +181,17 @@ static void init_remap_c (pa_remap_t *m) {
/* default C implementation */
static pa_init_remap_func_t remap_func = init_remap_c;
-void pa_init_remap (pa_remap_t *m) {
- pa_assert (remap_func);
+void pa_init_remap(pa_remap_t *m) {
+ pa_assert(remap_func);
m->do_remap = NULL;
/* call the installed remap init function */
- remap_func (m);
+ remap_func(m);
if (m->do_remap == NULL) {
/* nothing was installed, fallback to C version */
- init_remap_c (m);
+ init_remap_c(m);
}
}
diff --git a/src/pulsecore/remap_mmx.c b/src/pulsecore/remap_mmx.c
index d358a58b..37d72da7 100644
--- a/src/pulsecore/remap_mmx.c
+++ b/src/pulsecore/remap_mmx.c
@@ -103,7 +103,7 @@
" emms \n\t"
#if defined (__i386__) || defined (__amd64__)
-static void remap_mono_to_stereo_mmx (pa_remap_t *m, void *dst, const void *src, unsigned n) {
+static void remap_mono_to_stereo_mmx(pa_remap_t *m, void *dst, const void *src, unsigned n) {
pa_reg_x86 temp, temp2;
switch (*m->format) {
@@ -133,7 +133,7 @@ static void remap_mono_to_stereo_mmx (pa_remap_t *m, void *dst, const void *src,
}
/* set the function that will execute the remapping based on the matrices */
-static void init_remap_mmx (pa_remap_t *m) {
+static void init_remap_mmx(pa_remap_t *m) {
unsigned n_oc, n_ic;
n_oc = m->o_ss->channels;
@@ -148,13 +148,13 @@ static void init_remap_mmx (pa_remap_t *m) {
}
#endif /* defined (__i386__) || defined (__amd64__) */
-void pa_remap_func_init_mmx (pa_cpu_x86_flag_t flags) {
+void pa_remap_func_init_mmx(pa_cpu_x86_flag_t flags) {
#if defined (__i386__) || defined (__amd64__)
if (flags & PA_CPU_X86_MMX) {
pa_log_info("Initialising MMX optimized remappers.");
- pa_set_init_remap_func ((pa_init_remap_func_t) init_remap_mmx);
+ pa_set_init_remap_func((pa_init_remap_func_t) init_remap_mmx);
}
#endif /* defined (__i386__) || defined (__amd64__) */
diff --git a/src/pulsecore/remap_sse.c b/src/pulsecore/remap_sse.c
index 0ccf3161..e1cb161d 100644
--- a/src/pulsecore/remap_sse.c
+++ b/src/pulsecore/remap_sse.c
@@ -102,7 +102,7 @@
"4: \n\t"
#if defined (__i386__) || defined (__amd64__)
-static void remap_mono_to_stereo_sse2 (pa_remap_t *m, void *dst, const void *src, unsigned n) {
+static void remap_mono_to_stereo_sse2(pa_remap_t *m, void *dst, const void *src, unsigned n) {
pa_reg_x86 temp, temp2;
switch (*m->format) {
@@ -132,7 +132,7 @@ static void remap_mono_to_stereo_sse2 (pa_remap_t *m, void *dst, const void *src
}
/* set the function that will execute the remapping based on the matrices */
-static void init_remap_sse2 (pa_remap_t *m) {
+static void init_remap_sse2(pa_remap_t *m) {
unsigned n_oc, n_ic;
n_oc = m->o_ss->channels;
@@ -147,7 +147,7 @@ static void init_remap_sse2 (pa_remap_t *m) {
}
#endif /* defined (__i386__) || defined (__amd64__) */
-void pa_remap_func_init_sse (pa_cpu_x86_flag_t flags) {
+void pa_remap_func_init_sse(pa_cpu_x86_flag_t flags) {
#if defined (__i386__) || defined (__amd64__)
if (flags & PA_CPU_X86_SSE2) {
diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index bed5a20d..e5202212 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -1022,7 +1022,7 @@ static void calc_map_table(pa_resampler *r) {
pa_xfree(t);
/* initialize the remapping function */
- pa_init_remap (m);
+ pa_init_remap(m);
}
static pa_memchunk* convert_to_work_format(pa_resampler *r, pa_memchunk *input) {
@@ -1096,8 +1096,8 @@ static pa_memchunk *remap_channels(pa_resampler *r, pa_memchunk *input) {
remap = &r->remap;
- pa_assert (remap->do_remap);
- remap->do_remap (remap, dst, src, n_frames);
+ pa_assert(remap->do_remap);
+ remap->do_remap(remap, dst, src, n_frames);
pa_memblock_release(input->memblock);
pa_memblock_release(r->buf2.memblock);
diff --git a/src/pulsecore/sample-util.c b/src/pulsecore/sample-util.c
index 74600dec..ee1da60a 100644
--- a/src/pulsecore/sample-util.c
+++ b/src/pulsecore/sample-util.c
@@ -752,7 +752,7 @@ void pa_volume_memchunk(
return;
}
- do_volume = pa_get_volume_func (spec->format);
+ do_volume = pa_get_volume_func(spec->format);
pa_assert(do_volume);
calc_volume_table[spec->format] ((void *)linear, volume);
diff --git a/src/pulsecore/sconv_sse.c b/src/pulsecore/sconv_sse.c
index 2e74d744..ac57f01e 100644
--- a/src/pulsecore/sconv_sse.c
+++ b/src/pulsecore/sconv_sse.c
@@ -170,7 +170,7 @@ static void pa_sconv_s16le_from_f32ne_sse2(unsigned n, const float *a, int16_t *
#define SAMPLES 1019
#define TIMES 1000
-static void run_test (void) {
+static void run_test(void) {
int16_t samples[SAMPLES];
int16_t samples_ref[SAMPLES];
float floats[SAMPLES];
@@ -178,18 +178,18 @@ static void run_test (void) {
pa_usec_t start, stop;
pa_convert_func_t func;
- printf ("checking SSE %zd\n", sizeof (samples));
+ printf("checking SSE %zd\n", sizeof(samples));
- memset (samples_ref, 0, sizeof (samples_ref));
- memset (samples, 0, sizeof (samples));
+ memset(samples_ref, 0, sizeof(samples_ref));
+ memset(samples, 0, sizeof(samples));
for (i = 0; i < SAMPLES; i++) {
floats[i] = (rand()/(RAND_MAX+2.2)) - 1.1;
}
- func = pa_get_convert_from_float32ne_function (PA_SAMPLE_S16LE);
- func (SAMPLES, floats, samples_ref);
- pa_sconv_s16le_from_f32ne_sse2 (SAMPLES, floats, samples);
+ func = pa_get_convert_from_float32ne_function(PA_SAMPLE_S16LE);
+ func(SAMPLES, floats, samples_ref);
+ pa_sconv_s16le_from_f32ne_sse2(SAMPLES, floats, samples);
for (i = 0; i < SAMPLES; i++) {
if (samples[i] != samples_ref[i]) {
@@ -200,14 +200,14 @@ static void run_test (void) {
start = pa_rtclock_now();
for (i = 0; i < TIMES; i++) {
- pa_sconv_s16le_from_f32ne_sse2 (SAMPLES, floats, samples);
+ pa_sconv_s16le_from_f32ne_sse2(SAMPLES, floats, samples);
}
stop = pa_rtclock_now();
pa_log_info("SSE: %llu usec.", (long long unsigned int)(stop - start));
start = pa_rtclock_now();
for (i = 0; i < TIMES; i++) {
- func (SAMPLES, floats, samples_ref);
+ func(SAMPLES, floats, samples_ref);
}
stop = pa_rtclock_now();
pa_log_info("ref: %llu usec.", (long long unsigned int)(stop - start));
@@ -216,19 +216,19 @@ static void run_test (void) {
#endif /* defined (__i386__) || defined (__amd64__) */
-void pa_convert_func_init_sse (pa_cpu_x86_flag_t flags) {
+void pa_convert_func_init_sse(pa_cpu_x86_flag_t flags) {
#if !defined(__APPLE__) && defined (__i386__) || defined (__amd64__)
#ifdef RUN_TEST
- run_test ();
+ run_test();
#endif
if (flags & PA_CPU_X86_SSE2) {
pa_log_info("Initialising SSE2 optimized conversions.");
- pa_set_convert_from_float32ne_function (PA_SAMPLE_S16LE, (pa_convert_func_t) pa_sconv_s16le_from_f32ne_sse2);
+ pa_set_convert_from_float32ne_function(PA_SAMPLE_S16LE, (pa_convert_func_t) pa_sconv_s16le_from_f32ne_sse2);
} else {
pa_log_info("Initialising SSE optimized conversions.");
- pa_set_convert_from_float32ne_function (PA_SAMPLE_S16LE, (pa_convert_func_t) pa_sconv_s16le_from_f32ne_sse);
+ pa_set_convert_from_float32ne_function(PA_SAMPLE_S16LE, (pa_convert_func_t) pa_sconv_s16le_from_f32ne_sse);
}
#endif /* defined (__i386__) || defined (__amd64__) */
diff --git a/src/pulsecore/semaphore-osx.c b/src/pulsecore/semaphore-osx.c
index 73f43559..42afd154 100644
--- a/src/pulsecore/semaphore-osx.c
+++ b/src/pulsecore/semaphore-osx.c
@@ -30,8 +30,7 @@
#include "semaphore.h"
-struct pa_semaphore
-{
+struct pa_semaphore {
MPSemaphoreID sema;
};
diff --git a/src/pulsecore/semaphore-win32.c b/src/pulsecore/semaphore-win32.c
index 9ffbde66..c2e00c63 100644
--- a/src/pulsecore/semaphore-win32.c
+++ b/src/pulsecore/semaphore-win32.c
@@ -30,8 +30,7 @@
#include "semaphore.h"
-struct pa_semaphore
-{
+struct pa_semaphore {
HANDLE sema;
};
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index e0831f65..2bcf112e 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -74,10 +74,10 @@ static int check_passthrough_connection(pa_sink_input_flags_t flags, pa_sink *de
}
} else {
- if (flags & PA_SINK_INPUT_PASSTHROUGH) {
- pa_log_warn("Cannot connect PASSTHROUGH sink input to sink without PASSTHROUGH capabilities");
- return -PA_ERR_INVALID;
- }
+ if (flags & PA_SINK_INPUT_PASSTHROUGH) {
+ pa_log_warn("Cannot connect PASSTHROUGH sink input to sink without PASSTHROUGH capabilities");
+ return -PA_ERR_INVALID;
+ }
}
return PA_OK;
}
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 43cd0d15..839b7d44 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -2732,22 +2732,22 @@ void pa_sink_set_latency_range(pa_sink *s, pa_usec_t min_latency, pa_usec_t max_
/* Called from main thread */
void pa_sink_get_latency_range(pa_sink *s, pa_usec_t *min_latency, pa_usec_t *max_latency) {
- pa_sink_assert_ref(s);
- pa_assert_ctl_context();
- pa_assert(min_latency);
- pa_assert(max_latency);
-
- if (PA_SINK_IS_LINKED(s->state)) {
- pa_usec_t r[2] = { 0, 0 };
-
- pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_GET_LATENCY_RANGE, r, 0, NULL) == 0);
-
- *min_latency = r[0];
- *max_latency = r[1];
- } else {
- *min_latency = s->thread_info.min_latency;
- *max_latency = s->thread_info.max_latency;
- }
+ pa_sink_assert_ref(s);
+ pa_assert_ctl_context();
+ pa_assert(min_latency);
+ pa_assert(max_latency);
+
+ if (PA_SINK_IS_LINKED(s->state)) {
+ pa_usec_t r[2] = { 0, 0 };
+
+ pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SINK_MESSAGE_GET_LATENCY_RANGE, r, 0, NULL) == 0);
+
+ *min_latency = r[0];
+ *max_latency = r[1];
+ } else {
+ *min_latency = s->thread_info.min_latency;
+ *max_latency = s->thread_info.max_latency;
+ }
}
/* Called from IO thread */
diff --git a/src/pulsecore/sndfile-util.c b/src/pulsecore/sndfile-util.c
index cadda931..292eb6e8 100644
--- a/src/pulsecore/sndfile-util.c
+++ b/src/pulsecore/sndfile-util.c
@@ -52,7 +52,7 @@ int pa_sndfile_read_sample_spec(SNDFILE *sf, pa_sample_spec *ss) {
case SF_FORMAT_PCM_24:
ss->format = PA_SAMPLE_S24NE;
- break;
+ break;
case SF_FORMAT_PCM_32:
ss->format = PA_SAMPLE_S32NE;
@@ -109,9 +109,9 @@ int pa_sndfile_write_sample_spec(SF_INFO *sfi, pa_sample_spec *ss) {
case PA_SAMPLE_S24LE:
case PA_SAMPLE_S24BE:
- ss->format = PA_SAMPLE_S24NE;
- sfi->format |= SF_FORMAT_PCM_24;
- break;
+ ss->format = PA_SAMPLE_S24NE;
+ sfi->format |= SF_FORMAT_PCM_24;
+ break;
case PA_SAMPLE_S24_32LE:
case PA_SAMPLE_S24_32BE:
@@ -304,8 +304,7 @@ int pa_sndfile_write_channel_map(SNDFILE *sf, pa_channel_map *cm) {
channels[c] = table[cm->map[c]];
}
- if (!sf_command(sf, SFC_SET_CHANNEL_MAP_INFO,
- channels, sizeof(channels[0]) * cm->channels)) {
+ if (!sf_command(sf, SFC_SET_CHANNEL_MAP_INFO, channels, sizeof(channels[0]) * cm->channels)) {
pa_xfree(channels);
return -1;
}
diff --git a/src/pulsecore/sound-file-stream.c b/src/pulsecore/sound-file-stream.c
index 4037dca8..1ec19425 100644
--- a/src/pulsecore/sound-file-stream.c
+++ b/src/pulsecore/sound-file-stream.c
@@ -200,7 +200,7 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t length, pa_memchunk *chunk
}
return -1;
- }
+}
static void sink_input_process_rewind_cb(pa_sink_input *i, size_t nbytes) {
file_stream *u;
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index a5536629..92fb80e0 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -1402,22 +1402,22 @@ void pa_source_set_latency_range(pa_source *s, pa_usec_t min_latency, pa_usec_t
/* Called from main thread */
void pa_source_get_latency_range(pa_source *s, pa_usec_t *min_latency, pa_usec_t *max_latency) {
- pa_source_assert_ref(s);
- pa_assert_ctl_context();
- pa_assert(min_latency);
- pa_assert(max_latency);
-
- if (PA_SOURCE_IS_LINKED(s->state)) {
- pa_usec_t r[2] = { 0, 0 };
-
- pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_GET_LATENCY_RANGE, r, 0, NULL) == 0);
-
- *min_latency = r[0];
- *max_latency = r[1];
- } else {
- *min_latency = s->thread_info.min_latency;
- *max_latency = s->thread_info.max_latency;
- }
+ pa_source_assert_ref(s);
+ pa_assert_ctl_context();
+ pa_assert(min_latency);
+ pa_assert(max_latency);
+
+ if (PA_SOURCE_IS_LINKED(s->state)) {
+ pa_usec_t r[2] = { 0, 0 };
+
+ pa_assert_se(pa_asyncmsgq_send(s->asyncmsgq, PA_MSGOBJECT(s), PA_SOURCE_MESSAGE_GET_LATENCY_RANGE, r, 0, NULL) == 0);
+
+ *min_latency = r[0];
+ *max_latency = r[1];
+ } else {
+ *min_latency = s->thread_info.min_latency;
+ *max_latency = s->thread_info.max_latency;
+ }
}
/* Called from IO thread, and from main thread before pa_source_put() is called */
diff --git a/src/pulsecore/source.h b/src/pulsecore/source.h
index f3af159e..9e8e2ada 100644
--- a/src/pulsecore/source.h
+++ b/src/pulsecore/source.h
@@ -156,7 +156,7 @@ struct pa_source {
pa_usec_t max_latency; /* An upper limit for the latencies */
pa_usec_t fixed_latency; /* for sources with PA_SOURCE_DYNAMIC_LATENCY this is 0 */
- } thread_info;
+} thread_info;
void *userdata;
};
diff --git a/src/pulsecore/strbuf.c b/src/pulsecore/strbuf.c
index 4fc82ded..f131d5cd 100644
--- a/src/pulsecore/strbuf.c
+++ b/src/pulsecore/strbuf.c
@@ -146,7 +146,7 @@ void pa_strbuf_putsn(pa_strbuf *sb, const char *t, size_t l) {
pa_assert(t);
if (!l)
- return;
+ return;
c = pa_xmalloc(PA_ALIGN(sizeof(struct chunk)) + l);
c->length = l;
diff --git a/src/pulsecore/svolume_arm.c b/src/pulsecore/svolume_arm.c
index a028b827..71113060 100644
--- a/src/pulsecore/svolume_arm.c
+++ b/src/pulsecore/svolume_arm.c
@@ -43,9 +43,7 @@
" addcs r0, %1 \n\t" \
" movcs r6, r0 \n\t"
-static void
-pa_volume_s16ne_arm (int16_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_s16ne_arm(int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
int32_t *ve;
/* Channels must be at least 4, and always a multiple of the original number.
@@ -134,7 +132,7 @@ pa_volume_s16ne_arm (int16_t *samples, int32_t *volumes, unsigned channels, unsi
#define TIMES 1000
#define PADDING 16
-static void run_test (void) {
+static void run_test(void) {
int16_t samples[SAMPLES];
int16_t samples_ref[SAMPLES];
int16_t samples_orig[SAMPLES];
@@ -143,21 +141,21 @@ static void run_test (void) {
pa_do_volume_func_t func;
pa_usec_t start, stop;
- func = pa_get_volume_func (PA_SAMPLE_S16NE);
+ func = pa_get_volume_func(PA_SAMPLE_S16NE);
- printf ("checking ARM %zd\n", sizeof (samples));
+ printf("checking ARM %zd\n", sizeof(samples));
- pa_random (samples, sizeof (samples));
- memcpy (samples_ref, samples, sizeof (samples));
- memcpy (samples_orig, samples, sizeof (samples));
+ pa_random(samples, sizeof(samples));
+ memcpy(samples_ref, samples, sizeof(samples));
+ memcpy(samples_orig, samples, sizeof(samples));
for (i = 0; i < CHANNELS; i++)
volumes[i] = PA_CLAMP_VOLUME(rand() >> 1);
for (padding = 0; padding < PADDING; padding++, i++)
volumes[i] = volumes[padding];
- func (samples_ref, volumes, CHANNELS, sizeof (samples));
- pa_volume_s16ne_arm (samples, volumes, CHANNELS, sizeof (samples));
+ func(samples_ref, volumes, CHANNELS, sizeof(samples));
+ pa_volume_s16ne_arm(samples, volumes, CHANNELS, sizeof(samples));
for (i = 0; i < SAMPLES; i++) {
if (samples[i] != samples_ref[i]) {
printf ("%d: %04x != %04x (%04x * %04x)\n", i, samples[i], samples_ref[i],
@@ -167,16 +165,16 @@ static void run_test (void) {
start = pa_rtclock_now();
for (j = 0; j < TIMES; j++) {
- memcpy (samples, samples_orig, sizeof (samples));
- pa_volume_s16ne_arm (samples, volumes, CHANNELS, sizeof (samples));
+ memcpy(samples, samples_orig, sizeof(samples));
+ pa_volume_s16ne_arm(samples, volumes, CHANNELS, sizeof(samples));
}
stop = pa_rtclock_now();
pa_log_info("ARM: %llu usec.", (long long unsigned int) (stop - start));
start = pa_rtclock_now();
for (j = 0; j < TIMES; j++) {
- memcpy (samples_ref, samples_orig, sizeof (samples));
- func (samples_ref, volumes, CHANNELS, sizeof (samples));
+ memcpy(samples_ref, samples_orig, sizeof(samples));
+ func(samples_ref, volumes, CHANNELS, sizeof(samples));
}
stop = pa_rtclock_now();
pa_log_info("ref: %llu usec.", (long long unsigned int) (stop - start));
@@ -186,14 +184,14 @@ static void run_test (void) {
#endif /* defined (__arm__) && defined (HAVE_ARMV6) */
-void pa_volume_func_init_arm (pa_cpu_arm_flag_t flags) {
+void pa_volume_func_init_arm(pa_cpu_arm_flag_t flags) {
#if defined (__arm__) && defined (HAVE_ARMV6)
pa_log_info("Initialising ARM optimized functions.");
#ifdef RUN_TEST
- run_test ();
+ run_test();
#endif
- pa_set_volume_func (PA_SAMPLE_S16NE, (pa_do_volume_func_t) pa_volume_s16ne_arm);
+ pa_set_volume_func(PA_SAMPLE_S16NE, (pa_do_volume_func_t) pa_volume_s16ne_arm);
#endif /* defined (__arm__) && defined (HAVE_ARMV6) */
}
diff --git a/src/pulsecore/svolume_c.c b/src/pulsecore/svolume_c.c
index 5fc052b8..dfe7ccb0 100644
--- a/src/pulsecore/svolume_c.c
+++ b/src/pulsecore/svolume_c.c
@@ -32,9 +32,7 @@
#include "sample-util.h"
#include "endianmacros.h"
-static void
-pa_volume_u8_c (uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_u8_c(uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
unsigned channel;
for (channel = 0; length; length--) {
@@ -53,9 +51,7 @@ pa_volume_u8_c (uint8_t *samples, int32_t *volumes, unsigned channels, unsigned
}
}
-static void
-pa_volume_alaw_c (uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_alaw_c(uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
unsigned channel;
for (channel = 0; length; length--) {
@@ -74,9 +70,7 @@ pa_volume_alaw_c (uint8_t *samples, int32_t *volumes, unsigned channels, unsigne
}
}
-static void
-pa_volume_ulaw_c (uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_ulaw_c(uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
unsigned channel;
for (channel = 0; length; length--) {
@@ -95,12 +89,10 @@ pa_volume_ulaw_c (uint8_t *samples, int32_t *volumes, unsigned channels, unsigne
}
}
-static void
-pa_volume_s16ne_c (int16_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_s16ne_c(int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
unsigned channel;
- length /= sizeof (int16_t);
+ length /= sizeof(int16_t);
for (channel = 0; length; length--) {
int32_t t, hi, lo;
@@ -124,12 +116,10 @@ pa_volume_s16ne_c (int16_t *samples, int32_t *volumes, unsigned channels, unsign
}
}
-static void
-pa_volume_s16re_c (int16_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_s16re_c(int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
unsigned channel;
- length /= sizeof (int16_t);
+ length /= sizeof(int16_t);
for (channel = 0; length; length--) {
int32_t t, hi, lo;
@@ -147,12 +137,10 @@ pa_volume_s16re_c (int16_t *samples, int32_t *volumes, unsigned channels, unsign
}
}
-static void
-pa_volume_float32ne_c (float *samples, float *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_float32ne_c(float *samples, float *volumes, unsigned channels, unsigned length) {
unsigned channel;
- length /= sizeof (float);
+ length /= sizeof(float);
for (channel = 0; length; length--) {
*samples++ *= volumes[channel];
@@ -162,12 +150,10 @@ pa_volume_float32ne_c (float *samples, float *volumes, unsigned channels, unsign
}
}
-static void
-pa_volume_float32re_c (float *samples, float *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_float32re_c(float *samples, float *volumes, unsigned channels, unsigned length) {
unsigned channel;
- length /= sizeof (float);
+ length /= sizeof(float);
for (channel = 0; length; length--) {
float t;
@@ -181,12 +167,10 @@ pa_volume_float32re_c (float *samples, float *volumes, unsigned channels, unsign
}
}
-static void
-pa_volume_s32ne_c (int32_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_s32ne_c(int32_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
unsigned channel;
- length /= sizeof (int32_t);
+ length /= sizeof(int32_t);
for (channel = 0; length; length--) {
int64_t t;
@@ -201,12 +185,10 @@ pa_volume_s32ne_c (int32_t *samples, int32_t *volumes, unsigned channels, unsign
}
}
-static void
-pa_volume_s32re_c (int32_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_s32re_c(int32_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
unsigned channel;
- length /= sizeof (int32_t);
+ length /= sizeof(int32_t);
for (channel = 0; length; length--) {
int64_t t;
@@ -221,9 +203,7 @@ pa_volume_s32re_c (int32_t *samples, int32_t *volumes, unsigned channels, unsign
}
}
-static void
-pa_volume_s24ne_c (uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_s24ne_c(uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
unsigned channel;
uint8_t *e;
@@ -242,9 +222,7 @@ pa_volume_s24ne_c (uint8_t *samples, int32_t *volumes, unsigned channels, unsign
}
}
-static void
-pa_volume_s24re_c (uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_s24re_c(uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
unsigned channel;
uint8_t *e;
@@ -263,12 +241,10 @@ pa_volume_s24re_c (uint8_t *samples, int32_t *volumes, unsigned channels, unsign
}
}
-static void
-pa_volume_s24_32ne_c (uint32_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_s24_32ne_c(uint32_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
unsigned channel;
- length /= sizeof (uint32_t);
+ length /= sizeof(uint32_t);
for (channel = 0; length; length--) {
int64_t t;
@@ -283,12 +259,10 @@ pa_volume_s24_32ne_c (uint32_t *samples, int32_t *volumes, unsigned channels, un
}
}
-static void
-pa_volume_s24_32re_c (uint32_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_s24_32re_c(uint32_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
unsigned channel;
- length /= sizeof (uint32_t);
+ length /= sizeof(uint32_t);
for (channel = 0; length; length--) {
int64_t t;
@@ -303,8 +277,7 @@ pa_volume_s24_32re_c (uint32_t *samples, int32_t *volumes, unsigned channels, un
}
}
-static pa_do_volume_func_t do_volume_table[] =
-{
+static pa_do_volume_func_t do_volume_table[] = {
[PA_SAMPLE_U8] = (pa_do_volume_func_t) pa_volume_u8_c,
[PA_SAMPLE_ALAW] = (pa_do_volume_func_t) pa_volume_alaw_c,
[PA_SAMPLE_ULAW] = (pa_do_volume_func_t) pa_volume_ulaw_c,
diff --git a/src/pulsecore/svolume_mmx.c b/src/pulsecore/svolume_mmx.c
index 2ffd608b..263790d9 100644
--- a/src/pulsecore/svolume_mmx.c
+++ b/src/pulsecore/svolume_mmx.c
@@ -95,9 +95,7 @@
" por %%mm4, "#s1" \n\t" /* .. | l h | */ \
" por %%mm5, "#s2" \n\t"
-static void
-pa_volume_s16ne_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_s16ne_mmx(int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
pa_reg_x86 channel, temp;
/* Channels must be at least 4, and always a multiple of the original number.
@@ -162,9 +160,7 @@ pa_volume_s16ne_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsi
);
}
-static void
-pa_volume_s16re_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_s16re_mmx(int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
pa_reg_x86 channel, temp;
/* Channels must be at least 4, and always a multiple of the original number.
@@ -247,7 +243,7 @@ pa_volume_s16re_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsi
#define TIMES 1000
#define PADDING 16
-static void run_test (void) {
+static void run_test(void) {
int16_t samples[SAMPLES];
int16_t samples_ref[SAMPLES];
int16_t samples_orig[SAMPLES];
@@ -256,15 +252,15 @@ static void run_test (void) {
pa_do_volume_func_t func;
pa_usec_t start, stop;
- func = pa_get_volume_func (PA_SAMPLE_S16NE);
+ func = pa_get_volume_func(PA_SAMPLE_S16NE);
- printf ("checking MMX %zd\n", sizeof (samples));
+ printf("checking MMX %zd\n", sizeof(samples));
- pa_random (samples, sizeof (samples));
+ pa_random(samples, sizeof(samples));
/* for (i = 0; i < SAMPLES; i++)
samples[i] = -1; */
- memcpy (samples_ref, samples, sizeof (samples));
- memcpy (samples_orig, samples, sizeof (samples));
+ memcpy(samples_ref, samples, sizeof(samples));
+ memcpy(samples_orig, samples, sizeof(samples));
for (i = 0; i < CHANNELS; i++)
volumes[i] = PA_CLAMP_VOLUME(rand() >> 1);
@@ -272,27 +268,27 @@ static void run_test (void) {
for (padding = 0; padding < PADDING; padding++, i++)
volumes[i] = volumes[padding];
- func (samples_ref, volumes, CHANNELS, sizeof (samples));
- pa_volume_s16ne_mmx (samples, volumes, CHANNELS, sizeof (samples));
+ func(samples_ref, volumes, CHANNELS, sizeof(samples));
+ pa_volume_s16ne_mmx(samples, volumes, CHANNELS, sizeof(samples));
for (i = 0; i < SAMPLES; i++) {
if (samples[i] != samples_ref[i]) {
- printf ("%d: %04x != %04x (%04x * %08x)\n", i, samples[i], samples_ref[i],
+ printf("%d: %04x != %04x (%04x * %08x)\n", i, samples[i], samples_ref[i],
samples_orig[i], volumes[i % CHANNELS]);
}
}
start = pa_rtclock_now();
for (j = 0; j < TIMES; j++) {
- memcpy (samples, samples_orig, sizeof (samples));
- pa_volume_s16ne_mmx (samples, volumes, CHANNELS, sizeof (samples));
+ memcpy(samples, samples_orig, sizeof(samples));
+ pa_volume_s16ne_mmx(samples, volumes, CHANNELS, sizeof(samples));
}
stop = pa_rtclock_now();
pa_log_info("MMX: %llu usec.", (long long unsigned int)(stop - start));
start = pa_rtclock_now();
for (j = 0; j < TIMES; j++) {
- memcpy (samples_ref, samples_orig, sizeof (samples));
- func (samples_ref, volumes, CHANNELS, sizeof (samples));
+ memcpy(samples_ref, samples_orig, sizeof(samples));
+ func(samples_ref, volumes, CHANNELS, sizeof(samples));
}
stop = pa_rtclock_now();
pa_log_info("ref: %llu usec.", (long long unsigned int)(stop - start));
@@ -304,18 +300,18 @@ static void run_test (void) {
#endif /* defined (__i386__) || defined (__amd64__) */
-void pa_volume_func_init_mmx (pa_cpu_x86_flag_t flags) {
+void pa_volume_func_init_mmx(pa_cpu_x86_flag_t flags) {
#if defined (__i386__) || defined (__amd64__)
#ifdef RUN_TEST
- run_test ();
+ run_test();
#endif
if ((flags & PA_CPU_X86_MMX) && (flags & PA_CPU_X86_CMOV)) {
pa_log_info("Initialising MMX optimized functions.");
- pa_set_volume_func (PA_SAMPLE_S16NE, (pa_do_volume_func_t) pa_volume_s16ne_mmx);
- pa_set_volume_func (PA_SAMPLE_S16RE, (pa_do_volume_func_t) pa_volume_s16re_mmx);
+ pa_set_volume_func(PA_SAMPLE_S16NE, (pa_do_volume_func_t) pa_volume_s16ne_mmx);
+ pa_set_volume_func(PA_SAMPLE_S16RE, (pa_do_volume_func_t) pa_volume_s16re_mmx);
}
#endif /* defined (__i386__) || defined (__amd64__) */
}
diff --git a/src/pulsecore/svolume_sse.c b/src/pulsecore/svolume_sse.c
index ff2a12ee..86828072 100644
--- a/src/pulsecore/svolume_sse.c
+++ b/src/pulsecore/svolume_sse.c
@@ -79,9 +79,7 @@
static int channel_overread_table[8] = {8,8,8,12,8,10,12,14};
-static void
-pa_volume_s16ne_sse2 (int16_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_s16ne_sse2(int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
pa_reg_x86 channel, temp;
/* Channels must be at least 8 and always a multiple of the original number.
@@ -161,9 +159,7 @@ pa_volume_s16ne_sse2 (int16_t *samples, int32_t *volumes, unsigned channels, uns
);
}
-static void
-pa_volume_s16re_sse2 (int16_t *samples, int32_t *volumes, unsigned channels, unsigned length)
-{
+static void pa_volume_s16re_sse2(int16_t *samples, int32_t *volumes, unsigned channels, unsigned length) {
pa_reg_x86 channel, temp;
/* Channels must be at least 8 and always a multiple of the original number.
@@ -259,7 +255,7 @@ pa_volume_s16re_sse2 (int16_t *samples, int32_t *volumes, unsigned channels, uns
#define TIMES 1000
#define PADDING 16
-static void run_test (void) {
+static void run_test(void) {
int16_t samples[SAMPLES];
int16_t samples_ref[SAMPLES];
int16_t samples_orig[SAMPLES];
@@ -268,21 +264,21 @@ static void run_test (void) {
pa_do_volume_func_t func;
pa_usec_t start, stop;
- func = pa_get_volume_func (PA_SAMPLE_S16NE);
+ func = pa_get_volume_func(PA_SAMPLE_S16NE);
- printf ("checking SSE2 %zd\n", sizeof (samples));
+ printf("checking SSE2 %zd\n", sizeof(samples));
- pa_random (samples, sizeof (samples));
- memcpy (samples_ref, samples, sizeof (samples));
- memcpy (samples_orig, samples, sizeof (samples));
+ pa_random(samples, sizeof(samples));
+ memcpy(samples_ref, samples, sizeof(samples));
+ memcpy(samples_orig, samples, sizeof(samples));
for (i = 0; i < CHANNELS; i++)
volumes[i] = PA_CLAMP_VOLUME(rand() >> 1);
for (padding = 0; padding < PADDING; padding++, i++)
volumes[i] = volumes[padding];
- func (samples_ref, volumes, CHANNELS, sizeof (samples));
- pa_volume_s16ne_sse2 (samples, volumes, CHANNELS, sizeof (samples));
+ func(samples_ref, volumes, CHANNELS, sizeof(samples));
+ pa_volume_s16ne_sse2(samples, volumes, CHANNELS, sizeof(samples));
for (i = 0; i < SAMPLES; i++) {
if (samples[i] != samples_ref[i]) {
printf ("%d: %04x != %04x (%04x * %04x)\n", i, samples[i], samples_ref[i],
@@ -292,16 +288,16 @@ static void run_test (void) {
start = pa_rtclock_now();
for (j = 0; j < TIMES; j++) {
- memcpy (samples, samples_orig, sizeof (samples));
- pa_volume_s16ne_sse2 (samples, volumes, CHANNELS, sizeof (samples));
+ memcpy(samples, samples_orig, sizeof(samples));
+ pa_volume_s16ne_sse2(samples, volumes, CHANNELS, sizeof(samples));
}
stop = pa_rtclock_now();
pa_log_info("SSE: %llu usec.", (long long unsigned int)(stop - start));
start = pa_rtclock_now();
for (j = 0; j < TIMES; j++) {
- memcpy (samples_ref, samples_orig, sizeof (samples));
- func (samples_ref, volumes, CHANNELS, sizeof (samples));
+ memcpy(samples_ref, samples_orig, sizeof(samples));
+ func(samples_ref, volumes, CHANNELS, sizeof (samples));
}
stop = pa_rtclock_now();
pa_log_info("ref: %llu usec.", (long long unsigned int)(stop - start));
@@ -311,18 +307,18 @@ static void run_test (void) {
#endif
#endif /* defined (__i386__) || defined (__amd64__) */
-void pa_volume_func_init_sse (pa_cpu_x86_flag_t flags) {
+void pa_volume_func_init_sse(pa_cpu_x86_flag_t flags) {
#if defined (__i386__) || defined (__amd64__)
#ifdef RUN_TEST
- run_test ();
+ run_test();
#endif
if (flags & PA_CPU_X86_SSE2) {
pa_log_info("Initialising SSE2 optimized functions.");
- pa_set_volume_func (PA_SAMPLE_S16NE, (pa_do_volume_func_t) pa_volume_s16ne_sse2);
- pa_set_volume_func (PA_SAMPLE_S16RE, (pa_do_volume_func_t) pa_volume_s16re_sse2);
+ pa_set_volume_func(PA_SAMPLE_S16NE, (pa_do_volume_func_t) pa_volume_s16ne_sse2);
+ pa_set_volume_func(PA_SAMPLE_S16RE, (pa_do_volume_func_t) pa_volume_s16re_sse2);
}
#endif /* defined (__i386__) || defined (__amd64__) */
}
diff --git a/src/pulsecore/usergroup.c b/src/pulsecore/usergroup.c
index 71b13bca..c244865e 100644
--- a/src/pulsecore/usergroup.c
+++ b/src/pulsecore/usergroup.c
@@ -142,9 +142,7 @@ struct group *pa_getgrgid_malloc(gid_t gid) {
getgr_buflen = buflen - sizeof(struct group);
getgr_buf = (char *)buf + sizeof(struct group);
- while ((err = getgrgid_r(gid, (struct group *)buf, getgr_buf,
- getgr_buflen, &result)) == ERANGE)
- {
+ while ((err = getgrgid_r(gid, (struct group *)buf, getgr_buf, getgr_buflen, &result)) == ERANGE) {
if (expand_buffer_trashcontents(&buf, &buflen))
break;
@@ -203,9 +201,7 @@ struct group *pa_getgrnam_malloc(const char *name) {
getgr_buflen = buflen - sizeof(struct group);
getgr_buf = (char *)buf + sizeof(struct group);
- while ((err = getgrnam_r(name, (struct group *)buf, getgr_buf,
- getgr_buflen, &result)) == ERANGE)
- {
+ while ((err = getgrnam_r(name, (struct group *)buf, getgr_buf, getgr_buflen, &result)) == ERANGE) {
if (expand_buffer_trashcontents(&buf, &buflen))
break;
@@ -268,9 +264,7 @@ struct passwd *pa_getpwnam_malloc(const char *name) {
getpw_buflen = buflen - sizeof(struct passwd);
getpw_buf = (char *)buf + sizeof(struct passwd);
- while ((err = getpwnam_r(name, (struct passwd *)buf, getpw_buf,
- getpw_buflen, &result)) == ERANGE)
- {
+ while ((err = getpwnam_r(name, (struct passwd *)buf, getpw_buf, getpw_buflen, &result)) == ERANGE) {
if (expand_buffer_trashcontents(&buf, &buflen))
break;
@@ -329,9 +323,7 @@ struct passwd *pa_getpwuid_malloc(uid_t uid) {
getpw_buflen = buflen - sizeof(struct passwd);
getpw_buf = (char *)buf + sizeof(struct passwd);
- while ((err = getpwuid_r(uid, (struct passwd *)buf, getpw_buf,
- getpw_buflen, &result)) == ERANGE)
- {
+ while ((err = getpwuid_r(uid, (struct passwd *)buf, getpw_buf, getpw_buflen, &result)) == ERANGE) {
if (expand_buffer_trashcontents(&buf, &buflen))
break;
diff --git a/src/pulsecore/x11prop.c b/src/pulsecore/x11prop.c
index 4cb21daa..8df32788 100644
--- a/src/pulsecore/x11prop.c
+++ b/src/pulsecore/x11prop.c
@@ -34,8 +34,7 @@
#define PA_XCB_FORMAT 8
-static xcb_screen_t *screen_of_display(xcb_connection_t *xcb, int screen)
-{
+static xcb_screen_t *screen_of_display(xcb_connection_t *xcb, int screen) {
const xcb_setup_t *s;
xcb_screen_iterator_t iter;