Ignore:
Timestamp:
Oct 27, 2009, 4:11:22 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
069034
Parents:
55a71b
Message:

Huge refactoring to make const what is const (ticket #38), continued.

  • too many changes because of too many cross-references to be able to list them up here.
  • NOTE that "make check" runs fine and did catch several error.
  • note that we had to use const_iterator several times when the map, ... was declared const.
  • at times we changed an allocated LinkedCell LCList(...) into

const LinkedCell *LCList;
LCList = new LinkedCell(...);

  • also mutable (see ticket #5) was used, e.g. for molecule::InternalPointer (PointCloud changes are allowed, because they are just accounting).

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/unittests/ActOnAllUnitTest.cpp

    r55a71b ra9b2a0a  
    6262
    6363  // scaling by value
    64   VL.ActOnAll( (void (Vector::*)(double)) &Vector::Scale, 2. );
     64  VL.ActOnAll( (void (Vector::*)(const double)) &Vector::Scale, 2. );
    6565  CPPUNIT_ASSERT_EQUAL( VL == Ref , false );
    6666
    67   VL.ActOnAll( (void (Vector::*)(double)) &Vector::Scale, 0.5 );
     67  VL.ActOnAll( (void (Vector::*)(const double)) &Vector::Scale, 0.5 );
    6868  CPPUNIT_ASSERT_EQUAL( VL == Ref , true );
    6969
    7070  // scaling by ref
    71   VL.ActOnAll( (void (Vector::*)(double *)) &Vector::Scale, &factor );
     71  VL.ActOnAll( (void (Vector::*)(const double * const)) &Vector::Scale, (const double * const)&factor );
    7272  CPPUNIT_ASSERT_EQUAL( VL == Ref , false );
    7373
    74   VL.ActOnAll( (void (Vector::*)(double *)) &Vector::Scale, &inverse );
     74  VL.ActOnAll( (void (Vector::*)(const double * const)) &Vector::Scale, (const double * const)&inverse );
    7575  CPPUNIT_ASSERT_EQUAL( VL == Ref , true );
    7676
     
    8282    inverses[i] = 1./factors[i];
    8383  }
    84   VL.ActOnAll( (void (Vector::*)(double **)) &Vector::Scale, &factors );
     84  VL.ActOnAll( (void (Vector::*)(const double ** const)) &Vector::Scale, (const double ** const)&factors );
    8585  CPPUNIT_ASSERT_EQUAL( VL == Ref , false );
    8686
    87   VL.ActOnAll( (void (Vector::*)(double **)) &Vector::Scale, &inverses );
     87  VL.ActOnAll( (void (Vector::*)(const double ** const)) &Vector::Scale, (const double ** const)&inverses );
    8888  CPPUNIT_ASSERT_EQUAL( VL == Ref , true );
    8989};
Note: See TracChangeset for help on using the changeset viewer.