ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/io/EAMAtomTypesSectionParser.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-3.0/src/io/EAMAtomTypesSectionParser.cpp (file contents):
Revision 1891 by tim, Mon Dec 13 22:30:27 2004 UTC vs.
Revision 1892 by tim, Thu Dec 16 17:27:47 2004 UTC

# Line 75 | Line 75 | void EAMAtomTypesSectionParser::parseEAMParamFile(Forc
75      std::string lattice;
76      if (ppfStream->getline(buffer, bufferSize)) {      
77          StringTokenizer tokenizer1(buffer);
78        ident = tokenizer1.nextTokenAsInt();
78          
79          if (tokenizer1.countTokens() >= 4) {
80              junk = tokenizer1.nextTokenAsInt();
# Line 123 | Line 122 | void EAMAtomTypesSectionParser::parseEAMArray(std::ist
122      if (num % dataPerLine != 0) {
123  
124      }
125 +
126 +    int nlinesToRead = num / dataPerLine;
127      
128      const int bufferSize = 65535;
129      char buffer[bufferSize];
130      std::string line;
131      int readLines = num/dataPerLine;
132      int lineCount = 0;
132    while(input.getline(buffer, bufferSize) && lineCount < num){
133  
134 +    while(lineCount < nlinesToRead && input.getline(buffer, bufferSize) ){
135 +
136          StringTokenizer tokenizer(buffer);
137          if (tokenizer.countTokens() >= dataPerLine) {
138              for (int i = 0; i < dataPerLine; ++i) {
# Line 142 | Line 144 | void EAMAtomTypesSectionParser::parseEAMArray(std::ist
144          ++lineCount;
145      }
146  
147 <    if (lineCount < num) {
147 >    if (lineCount < nlinesToRead) {
148          
149      }
150      

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines