/ Check-in [637ee587]
Login

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

Overview
Comment:Fix a compiler warning. (CVS 604)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:637ee587b5438c54ba2d8bd8fc15e584abb70946
User & Date: drh 2002-06-02 18:22:06
Context
2002-06-06
18:54
Added the %fallback directive to the lemon parser generator and used this in the parser to make the parse tables much smaller. This reduced the size of the library by 15K. (CVS 605) check-in: 7ac5bd29 user: drh tags: trunk
2002-06-02
18:22
Fix a compiler warning. (CVS 604) check-in: 637ee587 user: drh tags: trunk
18:19
Add the ability to parse FOREIGN KEYs. Foreign keys are still ignored, but at least they now do not cause a syntax error. (CVS 603) check-in: 6fdcee3c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/expr.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains routines used for analyzing expressions and
    13     13   ** for generating VDBE code that evaluates expressions in SQLite.
    14     14   **
    15         -** $Id: expr.c,v 1.68 2002/06/02 18:19:00 drh Exp $
           15  +** $Id: expr.c,v 1.69 2002/06/02 18:22:06 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #include <ctype.h>
    19     19   
    20     20   /*
    21     21   ** Construct a new expression node and return a pointer to it.  Memory
    22     22   ** for this node is obtained from sqliteMalloc().  The calling function
................................................................................
   343    343   int sqliteExprIsInteger(Expr *p, int *pValue){
   344    344     switch( p->op ){
   345    345       case TK_INTEGER: {
   346    346         *pValue = atoi(p->token.z);
   347    347         return 1;
   348    348       }
   349    349       case TK_STRING: {
   350         -      char *z = p->token.z;
          350  +      const char *z = p->token.z;
   351    351         int n = p->token.n;
   352         -      if( n>0 && z=='-' ){ z++; n--; }
          352  +      if( n>0 && z[0]=='-' ){ z++; n--; }
   353    353         while( n>0 && *z && isdigit(*z) ){ z++; n--; }
   354    354         if( n==0 ){
   355    355           *pValue = atoi(p->token.z);
   356    356           return 1;
   357    357         }
   358    358         break;
   359    359       }