From a385e8e47be52f67912e7090ec8eeb5cf0ffe5be Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 20 Jan 2022 09:19:39 +0100 Subject: [PATCH] testcard2: use rand() instead of rand_r() rand_r was marked obsolete in POSIX 2008 and it is POSIX-only. --- src/video_capture/testcard2.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/video_capture/testcard2.c b/src/video_capture/testcard2.c index cb87cfb57..948aa1a4d 100644 --- a/src/video_capture/testcard2.c +++ b/src/video_capture/testcard2.c @@ -310,13 +310,13 @@ void * vidcap_testcard2_thread(void *arg) s = (struct testcard_state2 *)arg; struct timeval curr_time; struct timeval next_frame_time; - unsigned int seed = time(NULL); - int prev_x1 = rand_r(&seed) % (s->tile->width - 300); - int prev_y1 = rand_r(&seed) % (s->tile->height - 300); - int down1 = rand_r(&seed) % 2, right1 = rand_r(&seed) % 2; - int prev_x2 = rand_r(&seed) % (s->tile->width - 100); - int prev_y2 = rand_r(&seed) % (s->tile->height - 100); - int down2 = rand_r(&seed) % 2, right2 = rand_r(&seed) % 2; + srand(time(NULL)); + int prev_x1 = rand() % (s->tile->width - 300); + int prev_y1 = rand() % (s->tile->height - 300); + int down1 = rand() % 2, right1 = rand() % 2; + int prev_x2 = rand() % (s->tile->width - 100); + int prev_y2 = rand() % (s->tile->height - 100); + int down2 = rand() % 2, right2 = rand() % 2; int stat_count_prev = 0;