/ Changes On Branch lemon-update-2010
Login

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

Changes In Branch lemon-update-2010 Excluding Merge-Ins

This is equivalent to a diff from 0354ab27 to 892c5f37

2010-11-19
04:22
Lemon: Fixed compiler warning on Visual C++. Closed-Leaf check-in: 892c5f37 user: icculus tags: lemon-update-2010
04:19
Lemon: correcting previous win32 access() fix.    The previous fix caused link errors when compiled as C++. check-in: bd03d333 user: icculus tags: lemon-update-2010
2010-03-03
22:25
Modify the sqlite3_log() interface and implementation so that it never uses dynamic memory allocation - to avoid deadlocking when called while holding the memory allocator mutex. check-in: 28d1bc98 user: drh tags: trunk
16:54
Merged trunk to lemon-update-2010 branch. check-in: 88b466ba user: icculus tags: lemon-update-2010
16:02
Fix some extra instances of the constants addressed by [83e47ca006]. check-in: 0354ab27 user: dan tags: trunk
15:18
Factor out constant expressions in sqlite3GetVarint() to work around nuisance warning messages from the RVT compiler. check-in: 83e47ca0 user: drh tags: trunk

Changes to tool/lemon.c.

    16     16   #ifndef __WIN32__
    17     17   #   if defined(_WIN32) || defined(WIN32)
    18     18   #	define __WIN32__
    19     19   #   endif
    20     20   #endif
    21     21   
    22     22   #ifdef __WIN32__
    23         -extern int access();
           23  +#ifdef __cplusplus
           24  +extern "C" {
           25  +#endif
           26  +extern int access(const char *path, int mode);
           27  +#ifdef __cplusplus
           28  +}
           29  +#endif
    24     30   #else
    25     31   #include <unistd.h>
    26     32   #endif
    27     33   
    28     34   /* #define PRIVATE static */
    29     35   #define PRIVATE
    30     36   
................................................................................
    41     47   {
    42     48       /* if we failed, delete (most) files we made, to unconfuse build tools. */
    43     49       int i;
    44     50       for (i = 0; i < made_files_count; i++) {
    45     51           if (!successful_exit) {
    46     52               remove(made_files[i]);
    47     53           }
    48         -        free((void *) made_files[i]);
    49     54       }
    50     55       free(made_files);
    51     56       made_files_count = 0;
    52     57       made_files = NULL;
    53     58   }
    54     59   
    55     60   static char *msort(char*,char**,int(*)(const char*,const char*));
................................................................................
   395    400     if( rc==0 ){
   396    401       rc = (int)ap1->type - (int)ap2->type;
   397    402     }
   398    403     if( rc==0 && ap1->type==REDUCE ){
   399    404       rc = ap1->x.rp->index - ap2->x.rp->index;
   400    405     }
   401    406     if( rc==0 ){
   402         -    rc = ap2 - ap1;
          407  +    rc = (int) (ap2 - ap1);
   403    408     }
   404    409     return rc;
   405    410   }
   406    411   
   407    412   /* Sort parser actions */
   408    413   static struct action *Action_sort(
   409    414     struct action *ap
................................................................................
  2755   2760     ** is to keep makefiles from getting confused. We don't include .out files,
  2756   2761     ** though: this is debug information, and you don't want it deleted if there
  2757   2762     ** was an error you need to track down.
  2758   2763     */
  2759   2764     if(( *mode=='w' ) && (strcmp(suffix, ".out") != 0)){
  2760   2765       const char **ptr = (const char **)
  2761   2766           realloc(made_files, sizeof (const char **) * (made_files_count + 1));
  2762         -    char *fname = strdup(lemp->outname);
         2767  +    const char *fname = Strsafe(lemp->outname);
  2763   2768       if ((ptr == NULL) || (fname == NULL)) {
  2764   2769           free(ptr);
  2765         -        free(fname);
  2766   2770           memory_error();
  2767   2771       }
  2768   2772       made_files = ptr;
  2769   2773       made_files[made_files_count++] = fname;
  2770   2774     }
  2771   2775     return fp;
  2772   2776   }
................................................................................
  3241   3245     if( n<=0 ){
  3242   3246       if( n<0 ){
  3243   3247         used += n;
  3244   3248         assert( used>=0 );
  3245   3249       }
  3246   3250       n = lemonStrlen(zText);
  3247   3251     }
  3248         -  if( n+sizeof(zInt)*2+used >= alloced ){
         3252  +  if( (int) (n+sizeof(zInt)*2+used) >= alloced ){
  3249   3253       alloced = n + sizeof(zInt)*2 + used + 200;
  3250   3254       z = (char *) realloc(z,  alloced);
  3251   3255     }
  3252   3256     if( z==0 ) return empty;
  3253   3257     while( n-- > 0 ){
  3254   3258       c = *(zText++);
  3255   3259       if( c=='%' && n>0 && zText[0]=='d' ){