ObjXMPP  Check-in [168813e54d]

Overview
Comment:Import <bsd/stdlib.h> if not on a BSD system. Still needs LIBS=-lbsd.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 168813e54d356a05d4b5504f5b751ddedbf968fe7de518aad5d199dab1bebe48
User & Date: js on 2011-03-29 01:51:11
Other Links: manifest | tags
Context
2011-03-30
11:26
Get rid of warnings. check-in: 7f2f895934 user: js tags: trunk
2011-03-29
01:51
Import <bsd/stdlib.h> if not on a BSD system. Still needs LIBS=-lbsd. check-in: 168813e54d user: js tags: trunk
01:46
Port to ObjC 1. check-in: 2f8a95152e user: js tags: trunk
Changes

Modified src/arc4random_uniform.m from [53e6e6a83f] to [6ccb87c794].

23
24
25
26
27
28
29


30




31
32
33
34
35
36
37
23
24
25
26
27
28
29
30
31

32
33
34
35
36
37
38
39
40
41
42







+
+
-
+
+
+
+







 * compatible with RSA Labs "RC4" cipher (the actual description of
 * which is a trade secret).  The same algorithm is used as a stream
 * cipher called "arcfour" in Tatu Ylonen's ssh package.
 *
 * RC4 is a registered trademark of RSA Laboratories.
 */

#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
    defined(__APPLE__)
#include <stdlib.h>
# include <stdlib.h>
#else
# include <bsd/stdlib.h>
#endif
#include <stdint.h>

/*
 * Calculate a uniformly distributed random number less than upper_bound
 * avoiding "modulo bias".
 *
 * Uniformity is achieved by generating new random numbers until the one