mathlib: Added licence text

This commit is contained in:
Daniel Marjamäki 2009-04-09 16:17:59 +02:00
parent 6fb18b3ddc
commit e72a38aaa8
2 changed files with 41 additions and 21 deletions

View File

@ -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 <http://www.gnu.org/licenses/
*/
#include "mathlib.h"
@ -69,22 +90,4 @@ bool MathLib::isGreater(const std::string &first, const std::string &second)
return toNumber(first) > 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;
}

View File

@ -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 <http://www.gnu.org/licenses/
*/
#ifndef mathlibH
#define mathlibH
@ -18,9 +38,6 @@ public:
static std::string tan(const std::string & tok);
static std::string abs(const std::string & tok);
static bool isGreater(const std::string & first, const std::string & second);
static bool isEqual(const std::string & first, const std::string & second);
static bool isLess(const std::string & first, const std::string & second);
static int compare(const std::string & first, const std::string & second);
};
#endif