From 7b9242121e16737f517dcb961b42f3413aabe058 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Fri, 2 Jul 2004 16:48:13 +0000 Subject: [PATCH] Moved CK_SyntaxError definition to the .h file. It's used in more than one .cpp file. --- Cantera/src/converters/CKParser.cpp | 27 ++++++++++++++------------- Cantera/src/converters/CKParser.h | 7 ++++++- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Cantera/src/converters/CKParser.cpp b/Cantera/src/converters/CKParser.cpp index 52ba96503..51e1e1307 100755 --- a/Cantera/src/converters/CKParser.cpp +++ b/Cantera/src/converters/CKParser.cpp @@ -6,7 +6,11 @@ // Copyright 2001 California Institute of Technology // // $Log$ -// Revision 1.5 2004-05-13 17:45:05 dggoodwin +// Revision 1.6 2004-07-02 16:48:13 hkmoffa +// Moved CK_SyntaxError definition to the .h file. It's used in more +// than one .cpp file. +// +// Revision 1.5 2004/05/13 17:45:05 dggoodwin // fixed bug in which a species name beginning with M was interpreted as a third body // // Revision 1.4 2004/05/13 16:58:33 dggoodwin @@ -43,15 +47,12 @@ namespace ckr { } /// Exception class for syntax errors. - class CK_SyntaxError : public CK_Exception { - public: - CK_SyntaxError(ostream& f, const string& s, int linenum = -1) - : m_out(f) { - m_msg += "Syntax error: " + s; - if (linenum > 0) m_msg += " (line " + int2s(linenum) + ")\n"; - } - ostream& m_out; - }; + CK_SyntaxError::CK_SyntaxError(ostream& f, + const string& s, int linenum) + : m_out(f) { + m_msg += "Syntax error: " + s; + if (linenum > 0) m_msg += " (line " + int2s(linenum) + ")\n"; + } static int parseGroupString(string str, vector& esyms, @@ -271,7 +272,7 @@ namespace ckr { const char undoCommentChar = '%'; // carriage return - const char char13 = char(13); + //const char char13 = char(13); // linefeed const char char10 = char(10); @@ -977,7 +978,7 @@ next: else if ((mloc = sleft.find("+M"), mloc >= 0) || (mloc = sleft.find("+m"), mloc >= 0)) { - if (mloc == sleft.size()-2) { + if (mloc == static_cast(sleft.size()) - 2) { rxn.isThreeBodyRxn = true; rxn.type = ThreeBody; sleft = sleft.substr(0, mloc); @@ -1049,7 +1050,7 @@ next: else if ((mloc = sright.find("+M"), mloc >= 0) || (mloc = sright.find("+m"), mloc >= 0)) { - if (mloc == sright.size()-2) { + if (mloc == static_cast(sright.size()) - 2) { if (rxn.type == Falloff) throw CK_SyntaxError(*m_log, "mismatched +M or (+M)", m_line); diff --git a/Cantera/src/converters/CKParser.h b/Cantera/src/converters/CKParser.h index dcc92eca1..37448dfad 100755 --- a/Cantera/src/converters/CKParser.h +++ b/Cantera/src/converters/CKParser.h @@ -36,7 +36,12 @@ namespace ckr { //@} - + /// Exception class for syntax errors. + class CK_SyntaxError : public CK_Exception { + public: + CK_SyntaxError(ostream& f, const string& s, int linenum = -1); + ostream& m_out; + }; /** * Chemkin mechanism file parser. For internal use by class CKReader.