From 98503a84b383539acb6c5ced694c175c0eb3f6f0 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 4 Jun 2021 13:38:49 +1000 Subject: [PATCH] spa: fix an C++ invalid type conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In file included from spa/tests/test-cpp.cpp:49: ../spa/include/spa/param/latency-utils.h: In function ‘int spa_latency_parse(const spa_pod*, spa_latency_info*)’: ../spa/include/spa/param/latency-utils.h:95:25: error: invalid conversion from ‘int’ to ‘spa_direction’ [-fpermissive] 95 | info->direction &= 1; | ~~~~~~~~~~~~~~~~^~~~ | | | int --- spa/include/spa/param/latency-utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/include/spa/param/latency-utils.h b/spa/include/spa/param/latency-utils.h index 8e67d3cfd..2a65a5469 100644 --- a/spa/include/spa/param/latency-utils.h +++ b/spa/include/spa/param/latency-utils.h @@ -92,7 +92,7 @@ spa_latency_parse(const struct spa_pod *latency, struct spa_latency_info *info) SPA_PARAM_LATENCY_minNs, SPA_POD_OPT_Long(&info->min_ns), SPA_PARAM_LATENCY_maxNs, SPA_POD_OPT_Long(&info->max_ns))) < 0) return res; - info->direction &= 1; + info->direction = (enum spa_direction)(info->direction & 1); return 0; }