/ Check-in [69d11447]
Login

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

Overview
Comment:Renumber internal constants in the printf() implemention for a small performance improvement.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 69d11447f4b1a8c536c3b6573d2a3419da870412
User & Date: drh 2016-05-05 11:53:12
Context
2016-05-06
15:16
Fix a bug in sqlite_analyzer causing it report (slightly) incorrect values for the number of entries in indexes or WITHOUT ROWID tables. check-in: dc37750d user: dan tags: trunk
11:31
Do not scan indexes that have the integer primary key as their left-most column. This fixes the crash of ticket [16c9801ceba] but it seems like the wrong fix. More investigation needed. check-in: 50312273 user: drh tags: ticket-16c9801ce
2016-05-05
17:15
Initial check-in of the "scrub.exe" utility program prototype. Not yet fully functional. In particular, no scrubbing is done. check-in: bdf2ec77 user: drh tags: scrub-backup
11:53
Renumber internal constants in the printf() implemention for a small performance improvement. check-in: 69d11447 user: drh tags: trunk
2016-05-04
21:06
Disable the session extension API if SQLITE_ENABLE_SESSION is not defined. check-in: 71af9ac1 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/printf.c.

    11     11   */
    12     12   #include "sqliteInt.h"
    13     13   
    14     14   /*
    15     15   ** Conversion types fall into various categories as defined by the
    16     16   ** following enumeration.
    17     17   */
    18         -#define etRADIX       1 /* Integer types.  %d, %x, %o, and so forth */
    19         -#define etFLOAT       2 /* Floating point.  %f */
    20         -#define etEXP         3 /* Exponentional notation. %e and %E */
    21         -#define etGENERIC     4 /* Floating or exponential, depending on exponent. %g */
    22         -#define etSIZE        5 /* Return number of characters processed so far. %n */
    23         -#define etSTRING      6 /* Strings. %s */
    24         -#define etDYNSTRING   7 /* Dynamically allocated strings. %z */
    25         -#define etPERCENT     8 /* Percent symbol. %% */
    26         -#define etCHARX       9 /* Characters. %c */
           18  +#define etRADIX       0 /* Integer types.  %d, %x, %o, and so forth */
           19  +#define etFLOAT       1 /* Floating point.  %f */
           20  +#define etEXP         2 /* Exponentional notation. %e and %E */
           21  +#define etGENERIC     3 /* Floating or exponential, depending on exponent. %g */
           22  +#define etSIZE        4 /* Return number of characters processed so far. %n */
           23  +#define etSTRING      5 /* Strings. %s */
           24  +#define etDYNSTRING   6 /* Dynamically allocated strings. %z */
           25  +#define etPERCENT     7 /* Percent symbol. %% */
           26  +#define etCHARX       8 /* Characters. %c */
    27     27   /* The rest are extensions, not normally found in printf() */
    28         -#define etSQLESCAPE  10 /* Strings with '\'' doubled.  %q */
    29         -#define etSQLESCAPE2 11 /* Strings with '\'' doubled and enclosed in '',
           28  +#define etSQLESCAPE   9 /* Strings with '\'' doubled.  %q */
           29  +#define etSQLESCAPE2 10 /* Strings with '\'' doubled and enclosed in '',
    30     30                             NULL pointers replaced by SQL NULL.  %Q */
    31         -#define etTOKEN      12 /* a pointer to a Token structure */
    32         -#define etSRCLIST    13 /* a pointer to a SrcList */
    33         -#define etPOINTER    14 /* The %p conversion */
    34         -#define etSQLESCAPE3 15 /* %w -> Strings with '\"' doubled */
    35         -#define etORDINAL    16 /* %r -> 1st, 2nd, 3rd, 4th, etc.  English only */
           31  +#define etTOKEN      11 /* a pointer to a Token structure */
           32  +#define etSRCLIST    12 /* a pointer to a SrcList */
           33  +#define etPOINTER    13 /* The %p conversion */
           34  +#define etSQLESCAPE3 14 /* %w -> Strings with '\"' doubled */
           35  +#define etORDINAL    15 /* %r -> 1st, 2nd, 3rd, 4th, etc.  English only */
    36     36   
    37         -#define etINVALID     0 /* Any unrecognized conversion type */
           37  +#define etINVALID    16 /* Any unrecognized conversion type */
    38     38   
    39     39   
    40     40   /*
    41     41   ** An "etByte" is an 8-bit unsigned value.
    42     42   */
    43     43   typedef unsigned char etByte;
    44     44   
................................................................................
   185    185     etByte flag_blanksign;     /* True if " " flag is present */
   186    186     etByte flag_alternateform; /* True if "#" flag is present */
   187    187     etByte flag_altform2;      /* True if "!" flag is present */
   188    188     etByte flag_zeropad;       /* True if field width constant starts with zero */
   189    189     etByte flag_long;          /* True if "l" flag is present */
   190    190     etByte flag_longlong;      /* True if the "ll" flag is present */
   191    191     etByte done;               /* Loop termination flag */
   192         -  etByte xtype = 0;          /* Conversion paradigm */
          192  +  etByte xtype = etINVALID;  /* Conversion paradigm */
   193    193     u8 bArgList;               /* True for SQLITE_PRINTF_SQLFUNC */
   194    194     u8 useIntern;              /* Ok to use internal conversions (ex: %T) */
   195    195     char prefix;               /* Prefix character.  "+" or "-" or " " or '\0'. */
   196    196     sqlite_uint64 longvalue;   /* Value for integer types */
   197    197     LONGDOUBLE_TYPE realvalue; /* Value for real types */
   198    198     const et_info *infop;      /* Pointer to the appropriate info structure */
   199    199     char *zOut;                /* Rendering buffer */