Alexander Mai
4d5b463613
Fix clang compiler warning in mathlib.cpp and repair test case for #5895
2014-06-07 13:16:02 +02:00
orbitcowboy
8fe163285f
MathLib: Added missing testcase for incdec.
2014-06-04 08:41:30 +02:00
orbitcowboy
60e80b6fb1
Fixed #5885 - fsanitize=undefined: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' in lib/tokenize.cpp.
2014-05-29 18:25:01 +02:00
Martin Ettl
af369b4925
astyle run [ci skip]
2014-05-16 23:01:21 +02:00
amai2012
6f31ce334d
#5875 Fix 'lib/mathlib.cpp:559:43: runtime error: division by zero'. Several fixes to MathLib::divide(): avoid division by zero, handle various representation of 0 value, use 'nan.' instead of '-nan.0'
2014-05-31 18:25:23 +02:00
orbitcowboy
ee5cd91d51
MathLib: removed duplicated #include
2014-05-22 17:53:13 +02:00
Alexander Mai
cccddc20bf
#5843 MathLib::toLongNumber()/MathLib::toULongNumber() now use min/max values for bigint/biguint type in case the number to converted cannot be converted properly
2014-05-21 21:36:17 +02:00
PKEuS
ab4f58a146
Partially reverted 1317063b21
. enum class is not part of the common subset of supported C++11 functions of the compilers supported by cppcheck. ( Fixes #5745 )
2014-04-30 21:06:01 +02:00
Alexander Mai
1317063b21
Fix some more (clang++) compiler warnings
2014-04-26 20:44:21 +02:00
Alexander Mai
b5c580a59e
Fix some clang warnings - most related to semantic doxygen errors
2014-04-26 16:17:26 +02:00
orbitcowboy
3d0217b69e
Implemented a slower but shorter version of MathLib::isNullValue() as suggested by PKeuS. Removed not needed test cases. Improved doxygen documentation for MathLib::IsNullValue().
2014-04-14 05:27:38 +02:00
Daniel Marjamäki
28751c8ad0
astyle formatting
...
[ci skip]
2014-04-15 06:32:25 +02:00
Alexander Mai
ac24635056
Convert MathLib::toLongNumber() from template member function to toLongNumber() and toULongNumber() to avoid various problems compiling with Visual Studio
2014-04-14 20:30:38 +02:00
Martin Ettl
82092e412a
MathLib::isNullValue(): Fixed bug in detecting zero values. Improved test coverage of MathLib::IsNullValue().
2014-04-12 02:14:50 +02:00
Alexander Mai
718e42f5ca
Fix some clang warnings about type conversions
2014-04-11 23:35:53 +02:00
Alexander Mai
6da6508913
Extract new function MathLib::isDec() our of isInt()
2014-04-11 22:15:25 +02:00
orbitcowboy
6be53376f4
MathLib:IsNullValue(): removed commented out code.
2014-04-11 01:28:16 +02:00
orbitcowboy
9c08885caf
MathLib:IsNullValue(): using a Finite State Machine to determine a string value contains a numeric NULL value. The NULL value can be Integer, Binary, Hex, Octal. The corresponding unit test cases are also included.
2014-04-11 01:27:05 +02:00
Philipp Kloke
1fafc7f4dc
Refactorization: use MathLib::isNullValue in CheckOther::checkMemsetInvalid2ndParam(); Fixed it to support also float literals like "0.f"
2014-04-11 14:17:36 +02:00
Alexander Mai
ab2f8bfba3
Tidy up MathLib::isInt() - using a state machine approach
2014-04-10 22:46:55 +02:00
Alexander Mai
cba1879fee
Fixed #5571 (Clean up MathLib::isInt())
2014-03-16 11:55:44 +01:00
Daniel Marjamäki
8c7cf090c4
Merge pull request #261 from orbitcowboy/master
...
MathLib:isHex(): fix detection of missing suffixes (U,L).
2014-03-14 13:00:35 +01:00
orbitcowboy
74d10cd6d9
Added function MathLib::isValidSuffix()
2014-03-14 11:46:41 +01:00
orbitcowboy
71ee625aab
MathLib: replaced isHexDigit function by isxdigit.
2014-03-14 09:33:20 +01:00
Daniel Marjamäki
618c26f6bf
Merge pull request #260 from orbitcowboy/master
...
MathLib::isOct() fix missing detection of U and L suffix combinations an...
2014-03-12 05:30:35 +01:00
orbitcowboy
ed793793db
MathLib:isHex(): fix detection of missing suffixes (U,L).
2014-03-11 20:02:04 +01:00
Daniel Marjamäki
af0cf9bbc1
Merge pull request #258 from orbitcowboy/master
...
MathLib::isBin(): fix missing detection of U and L suffix combinations. ...
2014-03-11 06:36:31 +01:00
orbitcowboy
5b4ece4f9c
MathLib::isBin(): fix missing detection of U and L suffix combinations. Added missing test cases.
2014-03-10 17:23:07 +01:00
Martin Ettl
0360840753
MathLib::isOct() fix missing detection of U and L suffix combinations and unittests.
2014-03-09 21:14:14 +01:00
Alexander Mai
a02bbfa47e
Fixed #5492 (Fix small bug in MathLib::isFloat())
2014-02-27 16:08:49 +01:00
Daniel Marjamäki
dea4107245
Fix Cppcheck warning
2014-02-26 06:38:48 +01:00
Alexander Mai
0747b55485
Fixed #5304 (Wrong simplification of numbers like 001E+07 to 1.0)
2014-02-24 18:52:31 +01:00
Alexander Mai
82a2279425
Fixed #5304 (Wrong simplification of numbers like 001E+07 to 1.0)
2014-02-20 16:56:49 +01:00
Daniel Marjamäki
fd3a8a2a18
Update copyright
2014-02-15 07:45:39 +01:00
Martin Ettl
babbee4e73
Fixed typos in comments, no functional changes.
2013-11-09 16:07:28 +01:00
Daniel Marjamäki
8ff412fcee
Fixed #5142 (False positive with floating-point special cases in conditions)
2013-11-04 11:56:43 +01:00
Daniel Marjamäki
769b4617c3
Fixed #5142 (False positive with floating-point special cases in conditions)
2013-11-02 22:58:23 +01:00
Martin Ettl
00987eb120
MathLib: improved constness of local variables. No functional change.
2013-09-29 15:49:02 +02:00
Martin Ettl
0527aefb11
Improved simplifyMathFunctions when simplifying special cases of pow(x,y)-function.
2013-09-29 15:11:09 +02:00
Simon Martin
894f537eba
Remove warnings emitted by clang's -Wsign-conversion
2013-09-22 13:22:52 +02:00
PKEuS
a9a5dc0354
Updated to AStyle 2.03, require this version
2013-08-07 16:27:37 +02:00
Daniel Marjamäki
794aebe3cf
MathLib: Return inf.0 for NAN and INF calculations
2013-07-19 09:27:33 +02:00
PKEuS
917acea2ca
Fixed two spelling mistakes found by ettlmartin
2013-06-12 13:13:05 -07:00
Daniel Marjamäki
b6bcdf2936
Fixed #4520 (segmentation fault of cppcheck (preprocessing))
2013-05-09 18:50:24 +02:00
Daniel Marjamäki
c3d1274db3
Reverted 'simplify NOT' since there are problems related to signedness of numeric values.
2013-04-24 06:32:34 +02:00
Ettl Martin
33cfc1a52e
fixed #4726 : simplify bitwise Not (~ %num%)
2013-04-11 09:16:40 +02:00
Andrew C. Martin
4a73c93750
Fix compiler warnings and comment/string typos
...
- fix g++ warning:
> lib/checkother.cpp:3779: warning: comparison between signed and unsigned integer expressions
- fix suncc warning (see [everything2](http://everything2.com/title/C%252B%252B%253A+static+extern+%2522C%2522 )):
> "lib/checkmemoryleak.cpp", line 578: Warning (Anachronism): Formal argument __compar of type extern "C" int(*)(const void*,const void*) in call to bsearch(const void*, const void*, unsigned long, unsigned long, extern "C" int(*)(const void*,const void*)) is being passed int(*)(const void*,const void*).
- prefer empty() / isEmpty() over "size() > 0" (cases not caught by stlSize)
- fix word misspellings (mostly comments, a few output lines)
- Parenthesis => Parentheses (both variations were used in the codebase)
- fix typo and wording ("never alwayw") in gui/test/data/benchmark/simple.cpp's CheckOther::unsignedPositive():
```
- "An unsigned variable will never alwayw be positive so it is either pointless or "
+ "An unsigned variable can't be negative so it is either pointless or "
```
2013-01-16 07:37:07 -07:00
Reijo Tomperi
5d5f7085bf
Updating year 2012 -> 2013 to .cpp and .h files and man page.
2013-01-01 18:29:08 +02:00
acm4me
7da155c8ba
Support for Sun Studio C++ compiler
2012-12-27 11:51:12 +01:00
Daniel Marjamäki
4e92f8dfcd
Fixed #4295 (False positive: Expression '(X & 0xFF00000000000000LL)==0xa00000000000000' always evaluates to false (64-bit value))
2012-11-27 17:37:49 +01:00