Fossil

Check-in [9512ed93]
Login

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

Overview
Comment:makeheaders.c: suggestions from https://fossil-scm.org/forum/forumpost/00ff64e63e: do not emit main() decl, elide C++ constructor member initialization, and add a missing fclose().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9512ed93d37a7cfd00d075597bae4728b5178230b49bf8478ec628c5e4b103c8
User & Date: stephan 2019-09-06 10:36:51
Context
2019-09-06
13:49
Add the noreadme query parameter to /dir check-in: bf3383b9 user: drh tags: trunk
10:36
makeheaders.c: suggestions from https://fossil-scm.org/forum/forumpost/00ff64e63e: do not emit main() decl, elide C++ constructor member initialization, and add a missing fclose(). check-in: 9512ed93 user: stephan tags: trunk
2019-09-05
13:33
Remove the "Draft" notation from the rebase document. Link the new document into the documentation index. check-in: 569cc741 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/makeheaders.c.

1731
1732
1733
1734
1735
1736
1737










1738
1739
1740
1741
1742
1743
1744
....
1781
1782
1783
1784
1785
1786
1787



1788
1789
1790
1791
1792
1793
1794
1795
....
3215
3216
3217
3218
3219
3220
3221

3222
3223
3224
3225
3226
3227
3228
    }else if( type & PS_Private ){
      StringAppend(&str, "private:\n", 0);
      pDecl->extraType = PS_Private;
    }
  }
  StringAppend(&str, "  ", 0);
  zDecl = TokensToString(pFirst, pLast, ";\n", pClass, 2);










  StringAppend(&str, zDecl, 0);
  SafeFree(zDecl);
  pDecl->zExtra = StrDup(StringGet(&str), 0);
  StringReset(&str);
  return 0;
}

................................................................................
  }
  pName = FindDeclName(pFirst,pLast);
  if( pName==0 ){
    fprintf(stderr,"%s:%d: Malformed function or procedure definition.\n",
      zFilename, pFirst->nLine);
    return 1;
  }




  /*
  ** At this point we've isolated a procedure declaration between pFirst
  ** and pLast with the name pName.
  */
#ifdef DEBUG
  if( debugMask & PARSER ){
    printf("**** Found routine: %.*s on line %d...\n", pName->nText,
................................................................................
        zNew[j] = malloc( n + 1 );
        if( zNew[j] ){
          strcpy( zNew[j], zBuf );
        }
      }
    }
  }

  newArgc = argc + nNew - 1;
  for(i=0; i<=index; i++){
    zNew[i] = argv[i];
  }
  for(i=nNew + index + 1; i<newArgc; i++){
    zNew[i] = argv[i + 1 - nNew];
  }







>
>
>
>
>
>
>
>
>
>







 







>
>
>
|







 







>







1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
....
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
....
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
    }else if( type & PS_Private ){
      StringAppend(&str, "private:\n", 0);
      pDecl->extraType = PS_Private;
    }
  }
  StringAppend(&str, "  ", 0);
  zDecl = TokensToString(pFirst, pLast, ";\n", pClass, 2);
  if(strncmp(zDecl, pClass->zText, pClass->nText)==0){
    /* If member initializer list is found after a constructor,
    ** skip that part. */
    char * colon = strchr(zDecl, ':');
    if(colon!=0 && colon[1]!=0){
      *colon++ = ';';
      *colon++ = '\n';
      *colon = 0;
    }
  }
  StringAppend(&str, zDecl, 0);
  SafeFree(zDecl);
  pDecl->zExtra = StrDup(StringGet(&str), 0);
  StringReset(&str);
  return 0;
}

................................................................................
  }
  pName = FindDeclName(pFirst,pLast);
  if( pName==0 ){
    fprintf(stderr,"%s:%d: Malformed function or procedure definition.\n",
      zFilename, pFirst->nLine);
    return 1;
  }
  if( strncmp(pName->zText,"main",pName->nText)==0 ){
    /* skip main() decl. */
    return 0;
  }
  /*
  ** At this point we've isolated a procedure declaration between pFirst
  ** and pLast with the name pName.
  */
#ifdef DEBUG
  if( debugMask & PARSER ){
    printf("**** Found routine: %.*s on line %d...\n", pName->nText,
................................................................................
        zNew[j] = malloc( n + 1 );
        if( zNew[j] ){
          strcpy( zNew[j], zBuf );
        }
      }
    }
  }
  fclose(in);
  newArgc = argc + nNew - 1;
  for(i=0; i<=index; i++){
    zNew[i] = argv[i];
  }
  for(i=nNew + index + 1; i<newArgc; i++){
    zNew[i] = argv[i + 1 - nNew];
  }