Changeset 75793b2


Ignore:
Timestamp:
Jun 7, 2008, 1:20:30 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
42bdb2, a89a22
Parents:
a1c448
Message:

these are all smaller fixes due to extensively enabled compiler warnings

e.g. local variable shadows global (mol::nr by local nr)
and others

Location:
molecuilder/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/analyzer.cpp

    ra1c448 r75793b2  
    312312  // min/mean/max comparison for total force
    313313  if(!OpenOutputFile(output, argv[3], "DeltaMinMeanMaxTotalForce-Order.pyx")) return 1;
    314   CreatePlotHeader(output, "DeltaMinMeanMaxTotalForce-Order", 1, "bottom left", "y", "",  1, 1, "bond order k", "absolute error in total forces [Ht/a.u.]");
     314  CreatePlotHeader(output, "DeltaMinMeanMaxTotalForce-Order", 1, "bottom left", "y", NULL,  1, 1, "bond order k", "absolute error in total forces [Ht/a.u.]");
    315315  output << "plot " << Orderxrange.str().c_str() << " [1e-8:1e+0] \\" << endl; 
    316316  output << "'DeltaMinForces-Order.dat' title 'minimum' using 1:(sqrt($" << 8 << "*$" << 8 << "+$" << 8+1 << "*$" << 8+1 << "+$" << 8+2 << "*$" << 8+2 << ")) with linespoints, \\" << endl;
     
    331331  // min/mean/max comparison for total force
    332332  if(!OpenOutputFile(output, argv[3],"MinMeanMaxTotalForce-Order.pyx")) return 1;
    333   CreatePlotHeader(output, "MinMeanMaxTotalForce-Order", 1, "bottom left", "y", "", 1, 1, "bond order k", "absolute total force [Ht/a.u.]");
     333  CreatePlotHeader(output, "MinMeanMaxTotalForce-Order", 1, "bottom left", "y", NULL, 1, 1, "bond order k", "absolute total force [Ht/a.u.]");
    334334  output << "plot "<< Orderxrange.str().c_str() << " [1e-8:1e+0] \\" << endl; 
    335335  output << "'MinForces-Order.dat' title 'minimum' using 1:(sqrt($" << 8 << "*$" << 8 << "+$" << 8+1 << "*$" << 8+1 << "+$" << 8+2 << "*$" << 8+2 << ")) with linespoints, \\" << endl;
  • molecuilder/src/bond.cpp

    ra1c448 r75793b2  
    140140 * \return true if it is either bond::leftatom or bond::rightatom, false otherwise
    141141 */
    142 bool bond::Contains(const int nr)
     142bool bond::Contains(const int number)
    143143{
    144   return ((leftatom->nr == nr) || (rightatom->nr == nr));
     144  return ((leftatom->nr == number) || (rightatom->nr == number));
    145145};
    146146
  • molecuilder/src/datacreator.cpp

    ra1c448 r75793b2  
    319319  output << "set mxtics "<< mxtics << endl;
    320320  output << "set xtics "<< xtics << endl;
    321   if (logscale != "")
     321  if (logscale != NULL)
    322322    output << "set logscale " << logscale << endl;
    323   if (extraline != "")
     323  if (extraline != NULL)
    324324    output << extraline << endl;
    325325  output << "set xlabel '" << xlabel << "'" << endl;
  • molecuilder/src/element.cpp

    ra1c448 r75793b2  
    4141 * \param NoOfAtoms total number of atom of this element type
    4242 */
    43 bool element::Checkout(ofstream *out, const int No, const int NoOfAtoms) const
     43bool element::Checkout(ofstream *out, const int Number, const int NoOfAtoms) const
    4444{
    4545  if (out != NULL) {
    46     *out << "Ion_Type" << No << "\t" << NoOfAtoms << "\t" << Z << "\t1.0\t3\t3\t" << fixed << setprecision(11) << showpoint << mass << "\t" << name << "\t" << symbol <<endl;
     46    *out << "Ion_Type" << Number << "\t" << NoOfAtoms << "\t" << Z << "\t1.0\t3\t3\t" << fixed << setprecision(11) << showpoint << mass << "\t" << name << "\t" << symbol <<endl;
    4747    return true;
    4848  } else
  • molecuilder/src/parser.cpp

    ra1c448 r75793b2  
    101101  ifstream input;
    102102  char *FragmentNumber = NULL;
    103   stringstream line;
     103  stringstream file;
    104104 
    105105  Header = (char *) Malloc(sizeof(char)*1023, "MatrixContainer::ParseMatrix: *EnergyHeader");
     
    107107  // count the number of matrices
    108108  MatrixCounter = -1; // we count one too much
    109   line << name << FRAGMENTPREFIX << KEYSETFILE;
    110   input.open(line.str().c_str(), ios::in);
     109  file << name << FRAGMENTPREFIX << KEYSETFILE;
     110  input.open(file.str().c_str(), ios::in);
    111111  if (input == NULL) {
    112     cout << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl;
     112    cout << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;
    113113    return false;
    114114  }
     
    182182      Matrix[i][j] = (double *) Malloc(sizeof(double)*ColumnCounter, "MatrixContainer::ParseMatrix: *Matrix[][]");
    183183      input.getline(filename, 1023);
    184       stringstream line(filename);
     184      stringstream lines(filename);
    185185      //cout << "Matrix at level " << j << ":";// << filename << endl;
    186186      for(int k=skipcolumns;k--;)
    187         line >> filename;
     187        lines >> filename;
    188188      for(int k=0;(k<ColumnCounter) && (!line.eof());k++) {
    189         line >> Matrix[i][j][k];
     189        lines >> Matrix[i][j][k];
    190190        //cout << " " << setprecision(2) << Matrix[i][j][k];;
    191191      }
     
    522522  ifstream input;
    523523  char *FragmentNumber = NULL;
    524   stringstream line;
     524  stringstream file;
    525525  char filename[1023];
    526526 
     
    530530  for(int i=FragmentCounter;i--;)
    531531    KeySets[i] = NULL;
    532   line << name << FRAGMENTPREFIX << KEYSETFILE;
    533   input.open(line.str().c_str(), ios::in);
     532  file << name << FRAGMENTPREFIX << KEYSETFILE;
     533  input.open(file.str().c_str(), ios::in);
    534534  if (input == NULL) {
    535     cout << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl;
     535    cout << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;
    536536    return false;
    537537  }
Note: See TracChangeset for help on using the changeset viewer.