SQLite

Check-in [2b9340c868]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove a small amount of unnecessary #ifdeffery from random.c.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2b9340c8684bc382391e02813e960b3166f24daa
User & Date: drh 2014-10-27 20:14:02.021
Context
2014-10-27
22:06
Add special handling for static mutexes in sqlite3_mutex_alloc() when automatic calls to sqlite3_initialize() are enabled. (check-in: 7857d27caa user: mistachkin tags: trunk)
20:14
Remove a small amount of unnecessary #ifdeffery from random.c. (check-in: 2b9340c868 user: drh tags: trunk)
19:58
Fix compilation issue with MSVC due to a misplaced variable declaration. (check-in: 9588b345d0 user: mistachkin tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/random.c.
53
54
55
56
57
58
59
60
61
62

63
64
65
66
67
68
69
70
71
72
73
74
53
54
55
56
57
58
59

60
61
62
63
64

65

66
67
68
69
70
71
72







-


+


-

-








#ifndef SQLITE_OMIT_AUTOINIT
  if( sqlite3_initialize() ) return;
#endif

#if SQLITE_THREADSAFE
  mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_PRNG);
  sqlite3_mutex_enter(mutex);
#endif

  sqlite3_mutex_enter(mutex);
  if( N<=0 || pBuf==0 ){
    wsdPrng.isInit = 0;
#if SQLITE_THREADSAFE
    sqlite3_mutex_leave(mutex);
#endif
    return;
  }

  /* Initialize the state of the random number generator once,
  ** the first time this routine is called.  The seed value does
  ** not need to contain a lot of randomness since we are not
  ** trying to do secure encryption or anything like that...