From 2aabbc2163336f738d9ee3cbb32e5b5604a95676 Mon Sep 17 00:00:00 2001 From: Vineeth TM Date: Mon, 18 Jan 2016 11:40:36 +0900 Subject: [PATCH] tests:audioconvert: Fix integer overflow build error value of 32768L << 16 and 1L << 31 is 2147483648 but it exceeds the positive range of int which is 2147483647 resulting in integer overflow error. Use G_GINT64_CONSTANT instead of L. https://bugzilla.gnome.org/show_bug.cgi?id=760769 --- tests/check/elements/audioconvert.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/check/elements/audioconvert.c b/tests/check/elements/audioconvert.c index 1d1087dbad..05c9d12d8a 100644 --- a/tests/check/elements/audioconvert.c +++ b/tests/check/elements/audioconvert.c @@ -812,7 +812,7 @@ GST_START_TEST (test_int_float_conversion) { gint16 in[] = { 0, -32768, 16384, -16384 }; gdouble out[] = { 0.0, - (gdouble) (-(32768L << 16)) / 2147483648.0, /* ~ -1.0 */ + (gdouble) (-(G_GINT64_CONSTANT (32768) << 16)) / 2147483648.0, /* ~ -1.0 */ (gdouble) (16384L << 16) / 2147483648.0, /* ~ 0.5 */ (gdouble) (-(16384L << 16)) / 2147483648.0, /* ~ -0.5 */ }; @@ -822,9 +822,10 @@ GST_START_TEST (test_int_float_conversion) out, get_float_caps (1, G_BYTE_ORDER, 64)); } { - gint32 in[] = { 0, (-(1L << 31)), (1L << 30), (-(1L << 30)) }; + gint32 in[] = + { 0, (-(G_GINT64_CONSTANT (1) << 31)), (1L << 30), (-(1L << 30)) }; gdouble out[] = { 0.0, - (gdouble) (-(1L << 31)) / 2147483648.0, /* ~ -1.0 */ + (gdouble) (-(G_GINT64_CONSTANT (1) << 31)) / 2147483648.0, /* ~ -1.0 */ (gdouble) (1L << 30) / 2147483648.0, /* ~ 0.5 */ (gdouble) (-(1L << 30)) / 2147483648.0, /* ~ -0.5 */ };