From e72a38aaa82f4bf954c663f6616f86825f5de7bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 9 Apr 2009 16:17:59 +0200 Subject: [PATCH] mathlib: Added licence text --- src/mathlib.cpp | 39 +++++++++++++++++++++------------------ src/mathlib.h | 23 ++++++++++++++++++++--- 2 files changed, 41 insertions(+), 21 deletions(-) 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