HomeFreeBSD

MFC: r300953

Description

MFC: r300953

  1. Unifdef USE_WEAK_SEEDING it is too obsolete to support and makes reading

harder.

  1. ACM paper require seed to be in [1, 2^31-2] range, so use the same range

shifting as already done for rand(3). Also protect srandomdev() + TYPE_0 case
(non default) from negative seeds.

  1. Don't check for valid "type" range in setstate(), it is always valid as

calculated. Instead add a check that rear pointer not exceeed end pointer.

MFC: r300965

Micro optimize: C standard guarantees that right shift for unsigned value
fills left bits with zero, and we have exact 32bit unsigned value
(uint32_t), so there is no reason to add "& 0x7fffffff" here.

Details

Provenance
acheAuthored on
Parents
rS301442: Fix build with external gcc
Branches
Unknown
Tags
Unknown