Changeset 52b1aa7 in tol


Ignore:
Timestamp:
Mar 29, 2011, 11:13:48 AM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
37576df
Parents:
b0b1ed5
Message:

Refs #1146
Refs #740
Reordering members and methods

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@3378 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/bgrammar/class.cpp

    rb0b1ed5 r52b1aa7  
    12421242  const BMember* m1 = *((const BMember**)v1);
    12431243  const BMember* m2 = *((const BMember**)v2);
    1244   int cmp1 = m1->isMethod_ - m2->isMethod_;
    1245   if(cmp1) { return(cmp1); }
    1246   int cmp2 = m1->isStatic_ - m2->isStatic_;
    1247   if(cmp2) { return(cmp2); }
    1248   int cmp3 = m2->definition_.HasName() - m1->definition_.HasName();
    1249   if(cmp3) { return(cmp3); }
    1250   BClass* cls1 = (BClass*)m1->parent_;
    1251   BClass* cls2 = (BClass*)m2->parent_;
    1252   BText clsNam1 = (cls1)?cls1->FullName():"~~~~~~~~~~~~~";
    1253   BText clsNam2 = (cls1)?cls1->FullName():"~~~~~~~~~~~~~";
    1254   int cmp4 = StrCmp(clsNam1, clsNam2);
    1255   if(cmp4) { return(cmp4); }
     1244  int cmp_met = m1->isMethod_ - m2->isMethod_;
     1245  if(cmp_met) { return(cmp_met); }
     1246  bool isPub1 = m1->name_[0]!='_';
     1247  bool isPub2 = m2->name_[0]!='_';
     1248  int cmp_pub = isPub2 - isPub1;
     1249  if(cmp_pub) { return(cmp_pub); }
     1250  int cmp_stt = m1->isStatic_ - m2->isStatic_;
     1251  if(cmp_stt) { return(cmp_stt); }
     1252  int cmp_def = m1->definition_.HasName() - m2->definition_.HasName();
     1253  if(cmp_def) { return(cmp_def); }
    12561254  return(StrCmp(m1->name_, m2->name_));
    12571255}
    … …  
    13291327  BText md;
    13301328  bool is_empty = true;
    1331   if(num_met)
     1329  if(num_mem)
    13321330  {   
    1333     dump += "/* Methods */";
    1334     for(n=0; n<num_met; n++)
    1335     {
    1336       m = met[n];
     1331    dump += "/* Members */";
     1332    for(n=0; n<num_mem; n++)
     1333    {
     1334      m = mem[n];
    13371335      if(m)
    13381336      {
    … …  
    13471345    }
    13481346  }
    1349   if(num_mem)
     1347  if(num_met)
    13501348  {   
    1351     dump += "/* Members */";
    1352     for(n=0; n<num_mem; n++)
    1353     {
    1354       m = mem[n];
     1349    dump += "/* Methods */";
     1350    for(n=0; n<num_met; n++)
     1351    {
     1352      m = met[n];
    13551353      if(m)
    13561354      {
    … …  
    17421740    }
    17431741  }
    1744   if(cls && (defined>=0) && (cls->isDefined_!=defined))
     1742  if(cls && (defined>=0) && (cls->isDefined_!=(defined!=0)))
    17451743  {
    17461744    cls = NULL;
Note: See TracChangeset for help on using the changeset viewer.