diff options
Diffstat (limited to 'mtxlanguage.cc')
-rw-r--r-- | mtxlanguage.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/mtxlanguage.cc b/mtxlanguage.cc index 623db7c..4055159 100644 --- a/mtxlanguage.cc +++ b/mtxlanguage.cc @@ -18,10 +18,10 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <string> -#include <vector> -#include <ctype.h> #include <algorithm> +#include <cstring> +#include <ctype.h> +#include <vector> #include "mtx.h" #include "mtxsymbol.h" @@ -34,7 +34,7 @@ using namespace std; -char *MtxLanguage::lexical_groups[] = +const char *MtxLanguage::lexical_groups[] = { "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.", "=+-*/", "(", ")", "[", "]", ",", ";", @@ -48,13 +48,13 @@ MtxLanguage::MtxLanguage() size_t MtxLanguage::findGroup(char c) const { - char *ptr; + const char *ptr; size_t i; i = 0; while (lexical_groups[i] != NULL - && (ptr = strchr(lexical_groups[i], c)) == NULL) + && (ptr = std::strchr(lexical_groups[i], c)) == NULL) i++; if (lexical_groups[i] == NULL) @@ -95,7 +95,7 @@ MtxLanguage::checkLexicalElement(const string &lexical_element) const mtx_expression_t MtxLanguage::parseLexicalElements(const string &expression) const { - size_t i, str_length, prev_group, group; + size_t i, str_length, prev_group = 0, group; mtx_expression_t lexical_elements; string lexical_element; bool prev_set; |