[oe,meta-oe,1/2] jack2: Fix build errors found with gcc7

Message ID 20170422000015.27420-1-raj.khem@gmail.com
State New
Headers show
Series
  • [oe,meta-oe,1/2] jack2: Fix build errors found with gcc7
Related show

Commit Message

Khem Raj April 22, 2017, midnight
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 ...1-typecast-input-parameter-to-int-for-abs.patch | 32 ++++++++++++++++++++++
 meta-oe/recipes-multimedia/jack/jack_git.bb        |  4 ++-
 2 files changed, 35 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-multimedia/jack/jack/0001-typecast-input-parameter-to-int-for-abs.patch

-- 
2.12.2

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Patch hide | download patch | download mbox

diff --git a/meta-oe/recipes-multimedia/jack/jack/0001-typecast-input-parameter-to-int-for-abs.patch b/meta-oe/recipes-multimedia/jack/jack/0001-typecast-input-parameter-to-int-for-abs.patch
new file mode 100644
index 000000000..c119f1981
--- /dev/null
+++ b/meta-oe/recipes-multimedia/jack/jack/0001-typecast-input-parameter-to-int-for-abs.patch
@@ -0,0 +1,32 @@ 
+From 8ec6f75bf7a318a3a1e352df7c97630cfaba537a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Apr 2017 16:18:39 -0700
+Subject: [PATCH] typecast input parameter to int for abs()
+
+Fixes
+../tests/test.cpp:482:73: error: call of overloaded 'abs(jack_nframes_t)' is ambiguous
+
+because the signature is int abs(int) and its passing
+unsigned int to it.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tests/test.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test.cpp b/tests/test.cpp
+index 8a8a8117..9655742e 100644
+--- a/tests/test.cpp
++++ b/tests/test.cpp
+@@ -479,7 +479,7 @@ int process4(jack_nframes_t nframes, void *arg)
+ 	jack_nframes_t delta_time = cur_time - last_time;
+ 
+ 	Log("calling process4 callback : jack_frame_time = %ld delta_time = %ld\n", cur_time, delta_time);
+-	if (delta_time > 0  && (jack_nframes_t)abs(delta_time - cur_buffer_size) > tolerance) {
++	if (delta_time > 0  && (jack_nframes_t)abs(int(delta_time - cur_buffer_size)) > tolerance) {
+ 		printf("!!! ERROR !!! jack_frame_time seems to return incorrect values cur_buffer_size = %d, delta_time = %d tolerance %d\n", cur_buffer_size, delta_time, tolerance);
+ 	}
+ 
+-- 
+2.12.2
+
diff --git a/meta-oe/recipes-multimedia/jack/jack_git.bb b/meta-oe/recipes-multimedia/jack/jack_git.bb
index ba52691d3..b85ba8a02 100644
--- a/meta-oe/recipes-multimedia/jack/jack_git.bb
+++ b/meta-oe/recipes-multimedia/jack/jack_git.bb
@@ -14,7 +14,9 @@  LIC_FILES_CHKSUM = " \
 
 DEPENDS = "libsamplerate0 libsndfile1 readline"
 
-SRC_URI = "git://github.com/jackaudio/jack2.git"
+SRC_URI = "git://github.com/jackaudio/jack2.git \
+           file://0001-typecast-input-parameter-to-int-for-abs.patch \
+          "
 SRCREV = "2d1d323505585d406a7e64fb932953baefc5945e"
 PV = "1.9.10+git${SRCPV}"
 S = "${WORKDIR}/git"