[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-igt-dev
Subject:    [igt-dev] [PATCH i-g-t 3/4] tests: Make .seed unsigned
From:       Ville Syrjala <ville.syrjala () linux ! intel ! com>
Date:       2021-02-23 21:09:49
Message-ID: 20210223210950.13515-3-ville.syrjala () linux ! intel ! com
[Download RAW message or body]

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

srand() takes an unsigned int, so let's make our seed such.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_concurrent.c     | 4 ++--
 tests/kms_plane_multiple.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/kms_concurrent.c b/tests/kms_concurrent.c
index 1838a8ca5b47..5a269014e31c 100644
--- a/tests/kms_concurrent.c
+++ b/tests/kms_concurrent.c
@@ -41,8 +41,8 @@ typedef struct {
 /* Command line parameters. */
 struct {
 	int iterations;
+	unsigned int seed;
 	bool user_seed;
-	int seed;
 	bool run;
 } opt = {
 	.iterations = 1,
@@ -348,7 +348,7 @@ static int opt_handler(int option, int option_index, void *input)
 		break;
 	case 's':
 		opt.user_seed = true;
-		opt.seed = strtol(optarg, NULL, 0);
+		opt.seed = strtoul(optarg, NULL, 0);
 		break;
 	default:
 		return IGT_OPT_HANDLER_ERROR;
diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c
index 4202117eab81..93c6ea7d269d 100644
--- a/tests/kms_plane_multiple.c
+++ b/tests/kms_plane_multiple.c
@@ -54,8 +54,8 @@ typedef struct {
 /* Command line parameters. */
 struct {
 	int iterations;
+	unsigned int seed;
 	bool user_seed;
-	int seed;
 } opt = {
 	.iterations = 1,
 };
@@ -409,7 +409,7 @@ static int opt_handler(int option, int option_index, void *input)
 		break;
 	case 's':
 		opt.user_seed = true;
-		opt.seed = strtol(optarg, NULL, 0);
+		opt.seed = strtoul(optarg, NULL, 0);
 		break;
 	default:
 		return IGT_OPT_HANDLER_ERROR;
-- 
2.26.2

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic