Changeset 0f9eb0


Ignore:
Timestamp:
Apr 23, 2021, 8:51:43 PM (5 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
d951a5
Parents:
49874c
git-author:
Frederik Heber <frederik.heber@…> (11/27/20 20:25:21)
git-committer:
Frederik Heber <frederik.heber@…> (04/23/21 20:51:43)
Message:

Modified fstream checks to good() or eof().

  • not using != or == NULL.
Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/Element/periodentafel.cpp

    r49874c r0f9eb0  
    695695  strncat(filename, STANDARDELEMENTSDB, MAXSTRINGSIZE-strlen(filename));
    696696  f.open(filename);
    697   if (f != NULL) {
     697  if (f.good()) {
    698698    f << header1 << endl;
    699699    f << header2 << endl;
     
    703703    f.close();
    704704    return true;
    705   } else
    706     return result;
     705  }
     706  return result;
    707707};
    708708
  • src/Filling/Inserter/RandomInserter.cpp

    r49874c r0f9eb0  
    221221    std::vector<Vector> RandomAtomTranslations(atoms.size(), zeroVec);
    222222    std::generate_n(RandomAtomTranslations.begin(), atoms.size(),
    223         boost::bind(&RandomInserter::getRandomVector, boost::cref(this), MaxAtomComponent, -MaxAtomComponent));
     223        boost::bind(&RandomInserter::getRandomVector, this, MaxAtomComponent, -MaxAtomComponent));
    224224
    225225    // apply!
  • src/Fragmentation/Graph.cpp

    r49874c r0f9eb0  
    182182  sprintf(filename, "%s/%s%s", path, FRAGMENTPREFIX, TEFACTORSFILE);
    183183  InputFile.open(filename);
    184   if (InputFile != NULL) {
     184  if (InputFile.good()) {
    185185    // 3. add found TEFactors to each keyset
    186186    NumberOfFragments = 0;
     
    225225  output.open(line.c_str(), ios::out);
    226226  LOG(1, "INFO: Saving TEFactors of the total graph ... ");
    227   if(output != NULL) {
     227  if(output.good()) {
    228228    for(Graph::const_iterator runner = begin(); runner != end(); runner++)
    229229      output << (*runner).second.second << endl;
  • src/Fragmentation/MatrixContainer.cpp

    r49874c r0f9eb0  
    492492    delete[](FragmentNumber);
    493493    output.open(line.str().c_str(), ios::out);
    494     if (output == NULL) {
     494    if (!output.good()) {
    495495      ELOG(0, "MatrixContainer::WriteTotalFragments: Unable to open output energy file " << line.str() << "!");
    496496      performCriticalExit();
     
    522522  line << name << prefix << suffix;
    523523  output.open(line.str().c_str(), ios::out);
    524   if (output == NULL) {
     524  if (output.eof()) {
    525525    ELOG(0, "MatrixContainer::WriteLastMatrix: Unable to open output matrix file " << line.str() << "!");
    526526    performCriticalExit();
  • src/UIElements/Views/Qt4/QtToolBar_QtFavoriteActions.cpp

    r49874c r0f9eb0  
    6262  LastActionCalled(
    6363      ActionQueue::getPointer(),
    64       boost::bind(&QtToolBar::QtFavoriteActions::updateQueuedAction, boost::cref(this)),
     64      boost::bind(&QtToolBar::QtFavoriteActions::updateQueuedAction, this),
    6565      "QtFavoriteActions_QueuedAction",
    6666      std::string(""),
Note: See TracChangeset for help on using the changeset viewer.