/ Check-in [475e2fed]
Login

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

Overview
Comment:Make lemon 64-bit clean (CVS 294)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:475e2fedda2256cc1cfdffa1b12745bc401e552d
User & Date: drh 2001-10-25 20:37:17
Context
2001-10-31
15:44
More documentation updates (CVS 295) check-in: f65df59e user: drh tags: trunk
2001-10-25
20:37
Make lemon 64-bit clean (CVS 294) check-in: 475e2fed user: drh tags: trunk
2001-10-22
03:00
Version 2.0.7 (CVS 463) check-in: b0442cb9 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/lemon.c.

  1301   1301   ** ALGORITHM:
  1302   1302   ** Merge-sort.
  1303   1303   */
  1304   1304   
  1305   1305   /*
  1306   1306   ** Return a pointer to the next structure in the linked list.
  1307   1307   */
  1308         -#define NEXT(A) (*(char**)(((int)A)+offset))
         1308  +#define NEXT(A) (*(char**)(((unsigned long)A)+offset))
  1309   1309   
  1310   1310   /*
  1311   1311   ** Inputs:
  1312   1312   **   a:       A sorted, null-terminated linked list.  (May be null).
  1313   1313   **   b:       A sorted, null-terminated linked list.  (May be null).
  1314   1314   **   cmp:     A pointer to the comparison function.
  1315   1315   **   offset:  Offset in the structure to the "next" field.
................................................................................
  1375   1375   */
  1376   1376   #define LISTSIZE 30
  1377   1377   char *msort(list,next,cmp)
  1378   1378   char *list;
  1379   1379   char **next;
  1380   1380   int (*cmp)();
  1381   1381   {
  1382         -  int offset;
         1382  +  unsigned long offset;
  1383   1383     char *ep;
  1384   1384     char *set[LISTSIZE];
  1385   1385     int i;
  1386         -  offset = (int)next - (int)list;
         1386  +  offset = (unsigned long)next - (unsigned long)list;
  1387   1387     for(i=0; i<LISTSIZE; i++) set[i] = 0;
  1388   1388     while( list ){
  1389   1389       ep = list;
  1390   1390       list = NEXT(list);
  1391   1391       NEXT(ep) = 0;
  1392   1392       for(i=0; i<LISTSIZE-1 && set[i]!=0; i++){
  1393   1393         ep = merge(ep,set[i],cmp,offset);
................................................................................
  1527   1527           break;
  1528   1528         case OPT_DBL:
  1529   1529         case OPT_FDBL:
  1530   1530           dv = strtod(cp,&end);
  1531   1531           if( *end ){
  1532   1532             if( err ){
  1533   1533               fprintf(err,"%sillegal character in floating-point argument.\n",emsg);
  1534         -            errline(i,((int)end)-(int)argv[i],err);
         1534  +            errline(i,((unsigned long)end)-(unsigned long)argv[i],err);
  1535   1535             }
  1536   1536             errcnt++;
  1537   1537           }
  1538   1538           break;
  1539   1539         case OPT_INT:
  1540   1540         case OPT_FINT:
  1541   1541           lv = strtol(cp,&end,0);
  1542   1542           if( *end ){
  1543   1543             if( err ){
  1544   1544               fprintf(err,"%sillegal character in integer argument.\n",emsg);
  1545         -            errline(i,((int)end)-(int)argv[i],err);
         1545  +            errline(i,((unsigned long)end)-(unsigned long)argv[i],err);
  1546   1546             }
  1547   1547             errcnt++;
  1548   1548           }
  1549   1549           break;
  1550   1550         case OPT_STR:
  1551   1551         case OPT_FSTR:
  1552   1552           sv = cp;
................................................................................
  2621   2621     char buf[1000];
  2622   2622     FILE *in;
  2623   2623     char *tpltname;
  2624   2624     char *cp;
  2625   2625   
  2626   2626     cp = strrchr(lemp->filename,'.');
  2627   2627     if( cp ){
  2628         -    sprintf(buf,"%.*s.lt",(int)cp-(int)lemp->filename,lemp->filename);
         2628  +    sprintf(buf,"%.*s.lt",(unsigned long)cp-(unsigned long)lemp->filename,lemp->filename);
  2629   2629     }else{
  2630   2630       sprintf(buf,"%s.lt",lemp->filename);
  2631   2631     }
  2632   2632     if( access(buf,004)==0 ){
  2633   2633       tpltname = buf;
  2634   2634     }else if( access(templatename,004)==0 ){
  2635   2635       tpltname = templatename;