public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/tests/igt_audio: fix bad-function-cast warning
@ 2019-06-07 11:08 Simon Ser
  2019-06-07 11:44 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Simon Ser @ 2019-06-07 11:08 UTC (permalink / raw)
  To: igt-dev; +Cc: petri.latvala

Cast a variable instead of the return value of the function.

Signed-off-by: Simon Ser <simon.ser@intel.com>
---
 lib/tests/igt_audio.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/tests/igt_audio.c b/lib/tests/igt_audio.c
index 47e61adf74fe..eee4dd51f04c 100644
--- a/lib/tests/igt_audio.c
+++ b/lib/tests/igt_audio.c
@@ -65,11 +65,14 @@ static void test_signal_detect_noise(struct audio_signal *signal)
 	double buf[BUFFER_LEN];
 	bool ok;
 	size_t i;
+	long r;

 	/* Generate random samples between -1 and 1 */
 	srand(42);
-	for (i = 0; i < BUFFER_LEN; i++)
-		buf[i] = (double) random() / RAND_MAX * 2 - 1;
+	for (i = 0; i < BUFFER_LEN; i++) {
+		r = random();
+		buf[i] = (double) r / RAND_MAX * 2 - 1;
+	}

 	ok = audio_signal_detect(signal, SAMPLING_RATE, 0, buf, BUFFER_LEN);

--
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-06-12 10:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-07 11:08 [igt-dev] [PATCH i-g-t] lib/tests/igt_audio: fix bad-function-cast warning Simon Ser
2019-06-07 11:44 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-06-09 21:24 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-06-10  7:42   ` Ser, Simon
2019-06-10 10:15 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/tests/igt_audio: fix bad-function-cast warning (rev2) Patchwork
2019-06-10 22:15 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-06-12 10:53 ` [igt-dev] [PATCH i-g-t] lib/tests/igt_audio: fix bad-function-cast warning Martin Peres

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox