From 17b16e7a8350db7d83cc94093b81c4240850140d Mon Sep 17 00:00:00 2001 From: Koop Mast Date: Wed, 6 Jan 2016 01:04:31 +0000 Subject: [PATCH] tests: audioconvert: fix test compilation with clang With clang 3.7.1 on FreeBSD: elements/audioconvert.c:650:12: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value] (-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15), ~~~ ^ https://bugzilla.gnome.org/show_bug.cgi?id=760134 --- tests/check/elements/audioconvert.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/check/elements/audioconvert.c b/tests/check/elements/audioconvert.c index aaaebe3369..1d1087dbad 100644 --- a/tests/check/elements/audioconvert.c +++ b/tests/check/elements/audioconvert.c @@ -647,9 +647,9 @@ GST_START_TEST (test_int_conversion) gint32 in[] = { 0, G_MININT32, G_MAXINT32, (32 << 16), (32 << 16) + (1 << 15), (32 << 16) - (1 << 15), (32 << 16) + (2 << 15), (32 << 16) - (2 << 15), - (-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15), - (-32 << 16) + (2 << 15), (-32 << 16) - (2 << 15), - (-32 << 16) + (-(32 << 16)) + (1 << 15), (-(32 << 16)) - (1 << 15), + (-(32 << 16)) + (2 << 15), (-(32 << 16)) - (2 << 15), + (-(32 << 16)) }; gint16 out[] = { 0, G_MININT16, G_MAXINT16, 32, 33, 32, @@ -670,9 +670,9 @@ GST_START_TEST (test_int_conversion) gint32 in[] = { 0, G_MININT32, G_MAXINT32, (32 << 16), (32 << 16) + (1 << 15), (32 << 16) - (1 << 15), (32 << 16) + (2 << 15), (32 << 16) - (2 << 15), - (-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15), - (-32 << 16) + (2 << 15), (-32 << 16) - (2 << 15), - (-32 << 16) + (-(32 << 16)) + (1 << 15), (-(32 << 16)) - (1 << 15), + (-(32 << 16)) + (2 << 15), (-(32 << 16)) - (2 << 15), + (-(32 << 16)) }; guint16 out[] = { (1 << 15), 0, G_MAXUINT16, (1 << 15) + 32, (1 << 15) + 33, (1 << 15) + 32, @@ -812,9 +812,9 @@ 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) (-(32768L << 16)) / 2147483648.0, /* ~ -1.0 */ (gdouble) (16384L << 16) / 2147483648.0, /* ~ 0.5 */ - (gdouble) (-16384L << 16) / 2147483648.0, /* ~ -0.5 */ + (gdouble) (-(16384L << 16)) / 2147483648.0, /* ~ -0.5 */ }; RUN_CONVERSION ("16 signed to 64 float", @@ -822,11 +822,11 @@ 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, (-(1L << 31)), (1L << 30), (-(1L << 30)) }; gdouble out[] = { 0.0, - (gdouble) (-1L << 31) / 2147483648.0, /* ~ -1.0 */ + (gdouble) (-(1L << 31)) / 2147483648.0, /* ~ -1.0 */ (gdouble) (1L << 30) / 2147483648.0, /* ~ 0.5 */ - (gdouble) (-1L << 30) / 2147483648.0, /* ~ -0.5 */ + (gdouble) (-(1L << 30)) / 2147483648.0, /* ~ -0.5 */ }; RUN_CONVERSION ("32 signed to 64 float", @@ -1067,9 +1067,9 @@ GST_START_TEST (test_passthrough) gint32 data[] = { 0, G_MININT32, G_MAXINT32, (32 << 16), (32 << 16) + (1 << 15), (32 << 16) - (1 << 15), (32 << 16) + (2 << 15), (32 << 16) - (2 << 15), - (-32 << 16) + (1 << 15), (-32 << 16) - (1 << 15), - (-32 << 16) + (2 << 15), (-32 << 16) - (2 << 15), - (-32 << 16) + (-(32 << 16)) + (1 << 15), (-(32 << 16)) - (1 << 15), + (-(32 << 16)) + (2 << 15), (-(32 << 16)) - (2 << 15), + (-(32 << 16)) }; RUN_CONVERSION ("int 32 bit signed passthrough", data, get_int_caps (1, G_BYTE_ORDER, 32, 32, TRUE),