Changeset c718bda in mainline for uspace/lib/c/generic


Ignore:
Timestamp:
2018-01-15T21:40:49Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dbbbe75b
Parents:
ba29018
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-15 21:20:07)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-15 21:40:49)
Message:

Use standard names for rand() and srand().

Location:
uspace/lib/c/generic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/stdlib.c

    rba29018 rc718bda  
    3535#include <stdlib.h>
    3636
    37 static long glbl_seed = 1;
     37static int glbl_seed = 1;
    3838
    39 long int random(void)
     39int rand(void)
    4040{
    4141        return glbl_seed = ((1366 * glbl_seed + 150889) % RAND_MAX);
    4242}
    4343
    44 void srandom(unsigned int seed)
     44void srand(unsigned int seed)
    4545{
    4646        glbl_seed = seed % RAND_MAX;
  • uspace/lib/c/generic/uuid.c

    rba29018 rc718bda  
    5252        /* XXX This is a rather poor way of generating random numbers */
    5353        gettimeofday(&tv, NULL);
    54         srandom(tv.tv_sec ^ tv.tv_usec);
     54        srand(tv.tv_sec ^ tv.tv_usec);
    5555
    5656        for (i = 0; i < uuid_bytes; i++)
    57                 uuid->b[i] = random();
     57                uuid->b[i] = rand();
    5858
    5959        /* Version 4 UUID from random or pseudo-random numbers */
Note: See TracChangeset for help on using the changeset viewer.