/ Check-in [56f232d5]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Make the sqlite3IsNaN() function a macro that evaluates to FALSE when compiled with SQLITE_OMIT_FLOATING_POINT.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 56f232d562bc239103a5afd2e64c4b926a20de08
User & Date: drh 2010-01-13 17:39:54
Context
2010-01-14
00:39
Comment cleanup in sqliteInt.h. check-in: 67c3aea5 user: drh tags: trunk
2010-01-13
17:39
Make the sqlite3IsNaN() function a macro that evaluates to FALSE when compiled with SQLITE_OMIT_FLOATING_POINT. check-in: 56f232d5 user: drh tags: trunk
16:43
When SQLITE_OMIT_FLOATING_POINT is defined, the floating-point formats in the sqlite3_*printf() functions should pull an int64 off of the parameter list and ignore it. check-in: 3fd6f9ad user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/sqliteInt.h.

  2528   2528     int sqlite3MutexEnd(void);
  2529   2529   #endif
  2530   2530   
  2531   2531   int sqlite3StatusValue(int);
  2532   2532   void sqlite3StatusAdd(int, int);
  2533   2533   void sqlite3StatusSet(int, int);
  2534   2534   
  2535         -int sqlite3IsNaN(double);
         2535  +#ifndef SQLITE_OMIT_FLOATING_POINT
         2536  +  int sqlite3IsNaN(double);
         2537  +#else
         2538  +# define sqlite3IsNaN(X)  0
         2539  +#endif
  2536   2540   
  2537   2541   void sqlite3VXPrintf(StrAccum*, int, const char*, va_list);
  2538   2542   #ifndef SQLITE_OMIT_TRACE
  2539   2543   void sqlite3XPrintf(StrAccum*, const char*, ...);
  2540   2544   #endif
  2541   2545   char *sqlite3MPrintf(sqlite3*,const char*, ...);
  2542   2546   char *sqlite3VMPrintf(sqlite3*,const char*, va_list);

Changes to src/util.c.

    27     27   #ifdef SQLITE_COVERAGE_TEST
    28     28   void sqlite3Coverage(int x){
    29     29     static int dummy = 0;
    30     30     dummy += x;
    31     31   }
    32     32   #endif
    33     33   
           34  +#ifndef SQLITE_OMIT_FLOATING_POINT
    34     35   /*
    35     36   ** Return true if the floating point value is Not a Number (NaN).
    36     37   **
    37     38   ** Use the math library isnan() function if compiled with SQLITE_HAVE_ISNAN.
    38     39   ** Otherwise, we have our own implementation that works on most systems.
    39     40   */
    40     41   int sqlite3IsNaN(double x){
................................................................................
    71     72     rc = (y!=z);
    72     73   #else  /* if defined(SQLITE_HAVE_ISNAN) */
    73     74     rc = isnan(x);
    74     75   #endif /* SQLITE_HAVE_ISNAN */
    75     76     testcase( rc );
    76     77     return rc;
    77     78   }
           79  +#endif /* SQLITE_OMIT_FLOATING_POINT */
    78     80   
    79     81   /*
    80     82   ** Compute a string length that is limited to what can be stored in
    81     83   ** lower 30 bits of a 32-bit signed integer.
    82     84   **
    83     85   ** The value returned will never be negative.  Nor will it ever be greater
    84     86   ** than the actual length of the string.  For very long strings (greater