/ Check-in [f267a8a4]
Login

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

Overview
Comment:Fix another twos-complement negation error. Ticket #313. (CVS 973)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:f267a8a4ff52eb7ee3ac20a8e3a8ab5fe19e445d
User & Date: drh 2003-05-13 01:52:32
Context
2003-05-13
08:01
Removed 3rd (file) column from PRAGMA database_list until tests are fixed. (CVS 974) check-in: 4183cf97 user: jplyon tags: trunk
01:52
Fix another twos-complement negation error. Ticket #313. (CVS 973) check-in: f267a8a4 user: drh tags: trunk
00:34
A change to lemon related to ticket #313. (CVS 972) check-in: b59d9033 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/func.c.

    12     12   ** This file contains the C functions that implement various SQL
    13     13   ** functions of SQLite.  
    14     14   **
    15     15   ** There is only one exported symbol in this file - the function
    16     16   ** sqliteRegisterBuildinFunctions() found at the bottom of the file.
    17     17   ** All other code has file scope.
    18     18   **
    19         -** $Id: func.c,v 1.24 2003/03/27 12:51:25 drh Exp $
           19  +** $Id: func.c,v 1.25 2003/05/13 01:52:32 drh Exp $
    20     20   */
    21     21   #include <ctype.h>
    22     22   #include <math.h>
    23     23   #include <stdlib.h>
    24     24   #include <assert.h>
    25     25   #include "sqliteInt.h"
    26     26   
................................................................................
   320    320       if( iMax<iMin ) iMax = iMin;
   321    321       if( iMax>=sizeof(zBuf) ) iMax = sizeof(zBuf);
   322    322     }else{
   323    323       iMax = 50;
   324    324     }
   325    325     n = iMin;
   326    326     if( iMax>iMin ){
   327         -    r = sqliteRandomInteger();
   328         -    if( r<0 ) r = -r;
          327  +    r = sqliteRandomInteger() & 0x7fffffff;
   329    328       n += r%(iMax + 1 - iMin);
   330    329     }
   331    330     r = 0;
   332    331     for(i=0; i<n; i++){
   333    332       r = (r + sqliteRandomByte())% (sizeof(zSrc)-1);
   334    333       zBuf[i] = zSrc[r];
   335    334     }