1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Refactor the interface to the randomness generator. (CVS 1224)

FossilOrigin-Name: f2bdccf4bb2f796aafb64c33e55f62a1794d750c
This commit is contained in:
drh
2004-02-11 09:46:30 +00:00
parent 9eb9e26b82
commit bbd82df617
10 changed files with 73 additions and 80 deletions

View File

@@ -43,7 +43,7 @@
** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
** $Id: vdbe.c,v 1.258 2004/02/10 13:41:52 drh Exp $
** $Id: vdbe.c,v 1.259 2004/02/11 09:46:33 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -2893,10 +2893,12 @@ case OP_NewRecno: {
cnt = 0;
do{
if( v==0 || cnt>2 ){
v = sqliteRandomInteger();
sqliteRandomness(sizeof(v), &v);
if( cnt<5 ) v &= 0xffffff;
}else{
v += sqliteRandomByte() + 1;
unsigned char r;
sqliteRandomness(1, &r);
v += r + 1;
}
if( v==0 ) continue;
x = intToKey(v);