mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
Rename lib_rand.c to lib_srand.c
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
|
||||
CSRCS += lib_abs.c lib_abort.c lib_div.c lib_ldiv.c lib_lldiv.c
|
||||
CSRCS += lib_imaxabs.c lib_itoa.c lib_labs.c lib_llabs.c
|
||||
CSRCS += lib_bsearch.c lib_rand.c lib_qsort.c
|
||||
CSRCS += lib_bsearch.c lib_srand.c lib_qsort.c
|
||||
CSRCS += lib_strtol.c lib_strtoll.c lib_strtoul.c lib_strtoull.c
|
||||
CSRCS += lib_strtod.c lib_checkbase.c
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* libc/stdlib/lib_rand.c
|
||||
* libc/stdlib/lib_srand.c
|
||||
*
|
||||
* Copyright (C) 2007, 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2011, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -70,7 +70,7 @@
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
static unsigned int nrand(unsigned int nLimit);
|
||||
static unsigned int nrand(unsigned int limit);
|
||||
|
||||
/* First order congruential generators */
|
||||
|
||||
@@ -111,7 +111,7 @@ static unsigned long g_randint3;
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
static unsigned int nrand(unsigned int nLimit)
|
||||
static unsigned int nrand(unsigned int limit)
|
||||
{
|
||||
unsigned long result;
|
||||
double_t ratio;
|
||||
@@ -132,9 +132,9 @@ static unsigned int nrand(unsigned int nLimit)
|
||||
|
||||
/* Then, produce the return-able value */
|
||||
|
||||
result = (unsigned long)(((double_t)nLimit) * ratio);
|
||||
result = (unsigned long)(((double_t)limit) * ratio);
|
||||
}
|
||||
while (result >= (unsigned long)nLimit);
|
||||
while (result >= (unsigned long)limit);
|
||||
|
||||
return (unsigned int)result;
|
||||
}
|
||||
Reference in New Issue
Block a user