Commit Graph

177 Commits

Author SHA1 Message Date
Oliver Stöneberg e01c463ff8
fixed #11428 - improved handling of suffixes in `MathLib::to{Double|ULong|Long}Number()` (#4635)
* fixed #11428 - improved handling of suffices in `MathLib::to{Double|ULong|Long}Number()`

* testmathlib.cpp: adjustments for `libc++`

* mathlib.cpp: added TODO
2022-12-13 07:52:45 +01:00
Oliver Stöneberg 8bb5ac0efd
improved `MathLib::to{ULong|Long|Double}Number()` and increased test coverage / added CMake option `USE_LIBCXX` / fixed #10695 (#4611) 2022-12-07 09:20:09 +01:00
chrchr-github cf8051b7e2
Fix #11368 FP "Same value in both branches of ternary operator" on plus and minus zero (#4569)
Fix #11368 FP "Same value in both branches of ternary operator" on plus and minus zero
2022-10-31 15:18:25 +01:00
Oliver Stöneberg f138df2909
mathlib.h: replaced slow `std::ostringstream` with `std::to_string()` in `MathLib::toString()` (#4382) 2022-08-19 20:44:24 +02:00
chrchr-github 63e567eb50
Remove simplifyKnownVariables() (#4232)
* Remove simplifyKnownVariables()

* Add some test cases back

* Remove unused functions

* Format
2022-06-25 08:38:17 +02:00
Oliver Stöneberg f32583e097
removed OVERRIDE and FINAL defines and use the keywords directly (#3767) 2022-02-10 23:02:24 +01:00
Daniel Marjamäki 3989408738 Update copyright year 2022-02-05 11:45:17 +01:00
Oliver Stöneberg 171da2e6f9
avoid dependency on transitive includes - based on include-what-you-use (#3757) 2022-01-27 19:03:20 +01:00
Oliver Stöneberg 6739995e79
removed or annotated some code which is only used in test code (#3656) 2022-01-03 12:40:20 +01:00
Paul Fultz II 7f358b2bed
Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
Daniel Marjamäki f7d0bf7a59 Refactoring; Reuse simplecpp::characterLiteralToLL 2021-05-02 13:44:37 +02:00
Daniel Marjamäki 6f60c6d965 Revert "Refactoring; Reuse function in simplecpp"
This reverts commit dbe9eb2a27.
2021-05-01 19:54:14 +02:00
Daniel Marjamäki dbe9eb2a27 Refactoring; Reuse function in simplecpp 2021-05-01 18:13:40 +02:00
Daniel Marjamäki 42437277dc Update Copyright year 2021-03-21 20:58:32 +01:00
Oliver Stöneberg 3814163373
some MathLib adjustments for out-of-range numbers after std::stringstream removal (#3100) 2021-02-13 19:10:45 +01:00
Daniel Marjamäki 08ddd84780 Update copyright year 2020-05-10 11:16:32 +02:00
Daniel Marjamäki 3e0218299b Revert "Update copyright year"
This reverts commit 6eec6c4bd5.
2020-05-10 11:13:05 +02:00
Daniel Marjamäki 6eec6c4bd5 Update copyright year 2020-05-10 11:11:34 +02:00
Oliver Stöneberg 1af959af2c
fixed -Wextra-semi-stmt Clang warnings (#2553)
* fixed -Wextra-semi-stmt Clang warnings

* adjusted REDIRECT macro to require a semicolon

* testmathlib.cpp: rolled back accidental change
2020-04-21 17:27:51 +02:00
Rikard Falkeborn f6e7fb4bd9
Bugfix valuetype for some integer constants (#2545) 2020-02-19 07:51:39 +01:00
Rikard Falkeborn b1c6f2946a
Fix redundant FP assignment with unsigned zero (#2521)
* Refactor isNullOperand out of FwdAnalysis

* Improve isNullOperand

* Fix redundantAssignment FP with unsigned zero

* isNullValue check number

* Enhance isNullOperand to handle c++ casts

Also handle cast of NULL.
2020-02-09 11:16:08 +01:00
Rikard Falkeborn bbfd10a69f
Bugfix Mathlib::isNullValue for hexadecimal numbers (#2517) 2020-02-02 16:40:36 +01:00
Dmitry-Me 51e775e21e Improve test coverage for reading numbers represented as strings 2020-01-21 19:29:33 +03:00
Rikard Falkeborn c6e74f4c10 Mathlib: Fix value of suffixed binary integer literal (#2487) 2020-01-12 08:11:12 +01:00
Dmitry-Me 9d8f67a6ca Improve test coverage for MathLib::calculate() 2020-01-09 18:18:03 +03:00
Rikard Falkeborn 297360920a Keep prefix in string and char literals (#2272)
Keeping the prefix in the token allows cppcheck to print the correct
string and char literals in debug and error messages.

To achieve this, move some of the helper functions from token.cpp to
utils.h so that checks that look at string and char literals can reuse
them. This is a large part of this commit.

Note that the only user visible change is that when string and char
literals are printed in error messages, the prefix is now included.

For example:

	int f() {
		return test.substr( 0 , 4 ) == U"Hello" ? 0 : 1 ;
	};

now prints U"Hello" instead of "Hello" in the error message.
2019-10-16 11:41:33 +02:00
Oliver Stöneberg eac040a00b Various clang-tidy fixes (#2192)
* use range loops

* removed redundant string initializations

* use nullptr

* use proper boolean false

* removed unnecessary continue from end of loop

* removed unnecessary c_str() usage

* use emplace_back()

* removed redundant void arguments
2019-09-25 15:25:19 +02:00
orbitcowboy 4d223a70dc MathLib: Added robustness tests for 'MathLib::divide()'. 2019-05-25 23:06:50 +02:00
Daniel Marjamäki bd7790fd8c Update copyright year 2019-02-09 07:24:06 +01:00
Daniel Marjamäki 8dd641b8be Use OVERRIDE in test 2019-01-12 15:45:25 +01:00
amai2012 19e979315f
Correct detection of Microsoft extensions in MathLib::isValidIntegerSuffix. Remove public overloaded implementation which was not used outside mathlib.cpp. (#1531) 2018-12-20 12:20:31 +01:00
amai2012 378ffed37e Address compiler warning 2018-12-19 14:39:04 +01:00
amai2012 6924522475
Refactor methods for identification of numeric literals. (#1514) 2018-12-10 12:10:26 +01:00
amai2012 a68086c959
Implement hexadecimal float conversion in MathLib::toDoubleNumber ind… (#1506)
* Implement hexadecimal float conversion in MathLib::toDoubleNumber independent of C99/C++17
* Refactor MathLib::isFloatHex and cure some false results
2018-12-06 22:16:16 +01:00
Daniel Marjamäki 2c803a1ead Revert "#6514 Try to support hexadecimal floating numbers in MathLib::toDoubleNumber"
This reverts commit a73decf7e4.
2018-12-01 19:01:51 +01:00
Daniel Marjamäki 501f99ac5a Revert "astyle formatting"
This reverts commit 9289c9a283.
2018-12-01 19:01:40 +01:00
Daniel Marjamäki 9289c9a283 astyle formatting 2018-12-01 13:17:16 +01:00
amai2012 a73decf7e4 #6514 Try to support hexadecimal floating numbers in MathLib::toDoubleNumber 2018-12-01 00:50:26 +01:00
orbitcowboy 2f032d8fa7
Improved const correctness of local variables. (#1396)
* Improved const correctness of local variables.

* Running astyle [ci-skip].

* Removed duplicate 'const'-keyword.
2018-09-24 15:08:16 +02:00
IOBYTE ce50df8047 Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
Matthias Krüger f009cfc845 fix some typos found by codespell. 2018-02-04 20:53:43 +01:00
Daniel Marjamäki c4caee6b18 Updated copyright year 2018-01-14 15:37:52 +01:00
PKEuS b684e1f202 Updated AStyle to version 3.0.1 2018-01-08 20:20:33 +01:00
Martin Ettl 53fbfc9fdb test: Various micro optimizations: Replaced std::string() with std::string(). Use std::string::clear() instead of s = and prefer std::string::empty() instead of (s == ) for checking a string is empty. 2018-01-05 22:03:49 +01:00
Daniel Marjamäki f9d8dd9f4d testsuite: don't compare doubles with != 2017-10-10 22:40:49 +02:00
Ayaz Salikhov 28aa939d69 iwyu - include what you use 2017-05-27 04:33:47 +02:00
Daniel Marjamäki adc659f58b Fixed #7897 (MathLib::toDoubleValue: Does not handle character literal) 2017-02-25 21:58:09 +01:00
Matthias Krüger 064a4aa4cc improve constness of functions as per cppchecks suggestions. 2017-01-07 14:31:03 +01:00
Daniel Marjamäki 90ed7634b8 MathLib: fix for octal char literal '\200' 2016-10-16 13:42:20 +02:00
Daniel Marjamäki fee0e4edfa Fixed #7177 (MathLib: Does not handle '\xF6' properly) 2016-08-28 11:37:05 +02:00