--- trunk/src/utils/ElementsTable.cpp 2012/08/22 02:28:28 1782 +++ trunk/src/utils/ElementsTable.cpp 2015/03/09 17:10:26 2077 @@ -25,7 +25,6 @@ GNU General Public License for more details. * @file ElementsTable.cpp * @author gezelter * @date 12/21/2007 - * @time 11:30am * @version 1.0 */ @@ -40,12 +39,6 @@ GNU General Public License for more details. #include "utils/simError.h" #include "io/ifstrstream.hpp" -#ifdef _MSC_VER -#define strncasecmp _strnicmp -#define strcasecmp _stricmp -#endif - - #ifdef WIN32 #define FILE_SEP_CHAR "\\" #else @@ -69,13 +62,13 @@ namespace OpenMD { ElementsTable::~ElementsTable() { std::vector::iterator i; - for (i = elements_.begin(); i != elements_.end(); i++) + for (i = elements_.begin(); i != elements_.end(); ++i) delete *i; } void ElementsTable::ParseLine(const char *line) { int num, maxbonds; - char symbol[5]; + char symbol[6]; char name[256]; RealType Rcov,Rvdw,mass, elNeg, ionize, elAffin; RealType red, green, blue; @@ -270,7 +263,7 @@ namespace OpenMD { Init(); std::vector::iterator i; - for (i = elements_.begin();i != elements_.end();i++) + for (i = elements_.begin();i != elements_.end(); ++i) if (!strncasecmp(sym,(*i)->GetSymbol(),2)) return((*i)->GetAtomicNum()); @@ -327,11 +320,12 @@ namespace OpenMD { simError(); } - char charBuffer[BUFF_SIZE]; + if ((*ifsP)) { + char charBuffer[BUFF_SIZE]; while(ifsP->getline(charBuffer,BUFF_SIZE)) ParseLine(charBuffer); - + if (ifs1) ifs1.close(); if (ifs2)