This is Refactoring / code cleanup.
See:
* https://refactoring.com/catalog/extractMethod.html
* https://en.wikipedia.org/wiki/Code_refactoring
* https://www.refactoring.com/
* https://www.joelonsoftware.com/2002/01/23/rub-a-dub-dub/
Some small optimisations may have slipped in as well.
}
else
{
- srandom((unsigned int)(time((time_t *)NULL) + getpid()));
+ call_srandom();
do
{
get_fort();
#endif /* MAXPATHLEN */
#include <rinutils/count.h>
#include <rinutils/unused.h>
+static void call_srandom(void)
+{
+ srandom((unsigned)(time((time_t *)NULL) + getpid()));
+}
tbl.str_shortlen = ntohl(tbl.str_shortlen);
tbl.str_flags = ntohl(tbl.str_flags);
- srandom((int)(time((time_t *)NULL) + getpid()));
+ call_srandom();
get_fort(tbl);
display(Inf, tbl);
*/
static void randomize(void)
{
- srandom((unsigned int)(time((time_t *)NULL) + getpid()));
-
+ call_srandom();
Tbl.str_flags |= STR_RANDOM;
/* cnt = Tbl.str_numstr;
* See comment above. Isn't this stuff distributed worldwide? How