diff --git a/src/mathlib.cpp b/src/mathlib.cpp index 76760cc02..446ed68d5 100644 --- a/src/mathlib.cpp +++ b/src/mathlib.cpp @@ -1,3 +1,24 @@ +/* + * Cppcheck - A tool for static C/C++ code analysis + * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, + * Leandro Penz, Kimmo Varis, Vesa Pikki, Nguyen Duong Tuan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see toNumber(second); } -bool MathLib::isEqual(const std::string &first, const std::string &second) -{ - return toNumber(first) == toNumber(second); -} - -bool MathLib::isLess(const std::string &first, const std::string &second) -{ - return toNumber(first) < toNumber(second); -} - -int MathLib::compare(const std::string &first, const std::string &second) -{ - if (toNumber(first) < toNumber(second)) - return -1; - if (toNumber(first) == toNumber(second)) - return 0; - return 1; -} diff --git a/src/mathlib.h b/src/mathlib.h index 9816b3a3b..202267cc5 100644 --- a/src/mathlib.h +++ b/src/mathlib.h @@ -1,3 +1,23 @@ +/* + * Cppcheck - A tool for static C/C++ code analysis + * Copyright (C) 2007-2009 Daniel Marjamäki, Reijo Tomperi, Nicolas Le Cam, + * Leandro Penz, Kimmo Varis, Vesa Pikki, Nguyen Duong Tuan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see