Provided POSIX-mandated RAND_MAX definition.
authorTomasz Wozniak <t.wozniak@samsung.com>
Mon, 10 Apr 2017 08:52:12 +0000 (10:52 +0200)
committersunghan <sh924.chang@samsung.com>
Fri, 2 Jun 2017 08:46:46 +0000 (17:46 +0900)
Change-Id: I77b0250cd4277154635232cdfd0fd1ab3458ec68
Signed-off-by: Tomasz Wozniak <t.wozniak@samsung.com>
apps/examples/testcase/le_tc/kernel/tc_libc_stdlib.c
framework/src/arastorage/random.c
framework/src/arastorage/random.h
os/include/stdlib.h

index 0488963..981434b 100644 (file)
@@ -203,15 +203,15 @@ static void tc_libc_stdlib_rand(void)
 
        ret_chk = rand();
        TC_ASSERT_GEQ("rand", ret_chk, 0);
-       TC_ASSERT_LT("rand", ret_chk, MAX_RAND);
+       TC_ASSERT_LT("rand", ret_chk, RAND_MAX);
 
        ret_chk = rand();
        TC_ASSERT_GEQ("rand", ret_chk, 0);
-       TC_ASSERT_LT("rand", ret_chk, MAX_RAND);
+       TC_ASSERT_LT("rand", ret_chk, RAND_MAX);
 
        ret_chk = rand();
        TC_ASSERT_GEQ("rand", ret_chk, 0);
-       TC_ASSERT_LT("rand", ret_chk, MAX_RAND);
+       TC_ASSERT_LT("rand", ret_chk, RAND_MAX);
 
        TC_SUCCESS_RESULT();
 }
index 418e204..5378c71 100644 (file)
@@ -64,8 +64,8 @@ void random_init(unsigned short seed)
 }
 unsigned short random_rand(void)
 {
-       /* In gcc int rand() uses MAX_RAND and long random() uses RANDOM_MAX=0x7FFFFFFF */
-       /* MAX_RAND varies depending on the architecture */
+       /* In gcc int rand() uses RAND_MAX and long random() uses RANDOM_MAX=0x7FFFFFFF */
+       /* RAND_MAX varies depending on the architecture */
 
        return (unsigned short)rand();
 }
index 420624b..2b05a53 100644 (file)
@@ -52,7 +52,7 @@
 /****************************************************************************
 * Pre-processor Definitions
 ****************************************************************************/
-/* In gcc int rand() uses MAX_RAND and long random() uses RANDOM_MAX */
+/* In gcc int rand() uses RAND_MAX and long random() uses RANDOM_MAX */
 /* Since random_rand casts to unsigned short, we'll use this maxmimum */
 #define RANDOM_RAND_MAX 65535U
 
index 91c2e7f..6f9d9d9 100644 (file)
@@ -89,7 +89,7 @@
 
 /* Maximum value returned by rand() */
 
-#define MAX_RAND 32767
+#define RAND_MAX 32767
 
 /* Integer expression whose value is the maximum number of bytes in a
  * character specified by the current locale.