diff --git a/meson.build b/meson.build index 276d21456..69ec8e633 100644 --- a/meson.build +++ b/meson.build @@ -97,7 +97,7 @@ have_cpp = add_languages('cpp', native: false, required : false) if have_cpp cxx = meson.get_compiler('cpp') - cxx_flags = common_flags + cxx_flags = common_flags + [ '-Wno-c99-designator' ] add_project_arguments(cxx.get_supported_arguments(cxx_flags), language: 'cpp') endif diff --git a/spa/plugins/alsa/alsa-udev.c b/spa/plugins/alsa/alsa-udev.c index 30975523f..c088fa95b 100644 --- a/spa/plugins/alsa/alsa-udev.c +++ b/spa/plugins/alsa/alsa-udev.c @@ -651,9 +651,9 @@ static void impl_on_notify_events(struct spa_source *source) { bool deleted = false; struct impl *this = source->data; - struct { + union { struct inotify_event e; - char name[NAME_MAX+1]; + char name[NAME_MAX+1+sizeof(struct inotify_event)]; } buf; while (true) { @@ -670,17 +670,20 @@ static void impl_on_notify_events(struct spa_source *source) e = SPA_PTROFF(&buf, len, void); for (p = &buf; p < e; - p = SPA_PTROFF(p, sizeof(struct inotify_event) + event->len, void)) { + p = SPA_PTROFF(p, sizeof(struct inotify_event) + event->len, void)) { unsigned int id; struct device *device; event = (const struct inotify_event *) p; + spa_assert_se(e - p >= (ptrdiff_t)sizeof(struct inotify_event) && + e - p - sizeof(struct inotify_event) >= event->len && + "bad event from kernel"); /* Device becomes accessible or not busy */ if ((event->mask & (IN_ATTRIB | IN_CLOSE_WRITE))) { bool access; if (sscanf(event->name, "controlC%u", &id) != 1 && - sscanf(event->name, "pcmC%uD", &id) != 1) + sscanf(event->name, "pcmC%uD", &id) != 1) continue; if ((device = find_device(this, id)) == NULL) continue; diff --git a/spa/plugins/audioconvert/resample-native.c b/spa/plugins/audioconvert/resample-native.c index fadd202a1..05ce54ba3 100644 --- a/spa/plugins/audioconvert/resample-native.c +++ b/spa/plugins/audioconvert/resample-native.c @@ -66,6 +66,7 @@ static inline double window_blackman(double x, double n_taps) (alpha / 2.0) * cos(2.0 * x); return r; } + static inline double window_cosh(double x, double n_taps) { double r; @@ -80,7 +81,7 @@ static inline double window_cosh(double x, double n_taps) return r; } -#define window window_cosh +#define window (1 ? window_cosh : window_blackman) static int build_filter(float *taps, uint32_t stride, uint32_t n_taps, uint32_t n_phases, double cutoff) { diff --git a/spa/plugins/audiomixer/mix-ops-avx.c b/spa/plugins/audiomixer/mix-ops-avx.c index a5e3b5b11..3c5aa6bf7 100644 --- a/spa/plugins/audiomixer/mix-ops-avx.c +++ b/spa/plugins/audiomixer/mix-ops-avx.c @@ -32,62 +32,6 @@ #include -static inline void mix_4(float * dst, - const float * SPA_RESTRICT src0, - const float * SPA_RESTRICT src1, - const float * SPA_RESTRICT src2, - uint32_t n_samples) -{ - uint32_t n, unrolled; - - if (SPA_IS_ALIGNED(src0, 32) && - SPA_IS_ALIGNED(src1, 32) && - SPA_IS_ALIGNED(src2, 32) && - SPA_IS_ALIGNED(dst, 32)) - unrolled = n_samples & ~15; - else - unrolled = 0; - - for (n = 0; n < unrolled; n += 16) { - __m256 in1[4], in2[4]; - - in1[0] = _mm256_load_ps(&dst[n + 0]); - in2[0] = _mm256_load_ps(&dst[n + 8]); - in1[1] = _mm256_load_ps(&src0[n + 0]); - in2[1] = _mm256_load_ps(&src0[n + 8]); - in1[2] = _mm256_load_ps(&src1[n + 0]); - in2[2] = _mm256_load_ps(&src1[n + 8]); - in1[3] = _mm256_load_ps(&src2[n + 0]); - in2[3] = _mm256_load_ps(&src2[n + 8]); - - in1[0] = _mm256_add_ps(in1[0], in1[1]); - in2[0] = _mm256_add_ps(in2[0], in2[1]); - in1[2] = _mm256_add_ps(in1[2], in1[3]); - in2[2] = _mm256_add_ps(in2[2], in2[3]); - in1[0] = _mm256_add_ps(in1[0], in1[2]); - in2[0] = _mm256_add_ps(in2[0], in2[2]); - - _mm256_store_ps(&dst[n + 0], in1[0]); - _mm256_store_ps(&dst[n + 8], in2[0]); - } - for (; n < n_samples; n++) { - __m128 in[4]; - in[0] = _mm_load_ss(&dst[n]), - in[1] = _mm_load_ss(&src0[n]), - in[2] = _mm_load_ss(&src1[n]), - in[3] = _mm_load_ss(&src2[n]), - in[0] = _mm_add_ss(in[0], in[1]); - in[2] = _mm_add_ss(in[2], in[3]); - in[0] = _mm_add_ss(in[0], in[2]); - _mm_store_ss(&dst[n], in[0]); - } -} - - -static inline void mix_2(float * dst, const float * SPA_RESTRICT src, uint32_t n_samples) -{ -} - void mix_f32_avx(struct mix_ops *ops, void * SPA_RESTRICT dst, const void * SPA_RESTRICT src[], uint32_t n_src, uint32_t n_samples) diff --git a/spa/plugins/support/cpu-x86.c b/spa/plugins/support/cpu-x86.c index ded9bfaa7..722f7c906 100644 --- a/spa/plugins/support/cpu-x86.c +++ b/spa/plugins/support/cpu-x86.c @@ -56,6 +56,7 @@ x86_init(struct impl *impl) } else if (family == 0x06) model += extended_model; } + (void)model; flags = 0; if (ecx & bit_SSE3) diff --git a/test/test-functional.c b/test/test-functional.c index 620ce3732..ae837b41c 100644 --- a/test/test-functional.c +++ b/test/test-functional.c @@ -29,10 +29,8 @@ PWTEST(openal_info_test) { - int status; - #ifdef OPENAL_INFO_PATH - status = pwtest_spawn(OPENAL_INFO_PATH, (char *[]){ "openal-info", NULL }); + int status = pwtest_spawn(OPENAL_INFO_PATH, (char *[]){ "openal-info", NULL }); pwtest_int_eq(WEXITSTATUS(status), 0); return PWTEST_PASS; #else @@ -42,10 +40,8 @@ PWTEST(openal_info_test) PWTEST(pactl_test) { - int status; - #ifdef PACTL_PATH - status = pwtest_spawn(PACTL_PATH, (char *[]){ "pactl", "info", NULL }); + int status = pwtest_spawn(PACTL_PATH, (char *[]){ "pactl", "info", NULL }); pwtest_int_eq(WEXITSTATUS(status), 0); return PWTEST_PASS; #else