Commit Graph

23 Commits (master)

Author SHA1 Message Date
Sébastien Villemot b2e9ec205e
No longer use reserved identifiers for include guards
Automatically detected using clang-tidy with bugprone-reserved-identifier
check.

By the way, homogeneize the define identifiers in relation to camel case
convention.
2023-12-01 15:39:01 +01:00
Sébastien Villemot 7e6abc97c4
Add [[nodiscard]] attribute to various functions
Automatically detected using clang-tidy with modernize-use-nodiscard check.
2023-12-01 14:14:44 +01:00
Sébastien Villemot d463607e90
Reformat C++ source code using clang-format 15 2023-11-30 15:58:32 +01:00
Sébastien Villemot e1e1a753d0
Do not use C++20 aggregate initialization with parentheses
Initialization with initalizer list is nicer. And, more importantly,
initialization with parentheses is not supported by Clang < 16.
2023-07-07 14:32:16 +02:00
Sébastien Villemot 3d9ac26aa6
Remove all instances of the “map.find(key)->second” pattern
This is unsafe since the find() method can return a past-the-end iterator,
which should be tested for.

Replace most instances by calls to the std::map::at() method (which throws if
the key is unknown), and which is incidentally more readable.
2022-09-27 12:56:16 +02:00
Sébastien Villemot f0629555a5
Remove useless constructors (aggregate initialization is enough for those)
By the way, turn those classes into structs since all their members are public.
2022-07-20 14:48:28 +02:00
Sébastien Villemot 4867120757
Remove unused function 2022-07-08 14:44:01 +02:00
Sébastien Villemot 0b5c88109f
Various simplifications 2022-06-07 14:34:30 +02:00
Sébastien Villemot b42ee40b55
C++20 modernization: use contains() method on containers 2022-05-04 17:37:57 +02:00
Sébastien Villemot 0db05a886a
Move “using namespace std” statement after inclusion of standard headers
Otherwise clang emits this warning:
 using directive refers to implicitly-defined namespace 'std'
2022-01-06 14:54:57 +01:00
Sébastien Villemot 74ef3457b4
Use secure URL for link to GNU licenses 2021-06-09 17:21:00 +02:00
Sébastien Villemot 031c0cff5f
Various code simplifications and modernizations 2019-12-16 19:42:59 +01:00
Sébastien Villemot b73d554ad2
Use Unicode copyright symbol (in UTF-8 encoding) 2019-04-16 11:35:31 +02:00
Sébastien Villemot 1793078ba2
Minor stylistic improvements 2019-03-18 18:49:55 +01:00
Sébastien Villemot 1089a223c4 Clean up default constructors/destructors 2018-10-11 17:08:44 +02:00
Sébastien Villemot 7bb5382428 Always use brace-initializer in constructors
The syntax makes clearer the distinction between a function call and an
initialization. Also, it prevents bugs due to implicit type conversions.
2018-10-04 17:19:18 +02:00
Sébastien Villemot a4aefb4c65 Mark all constructors taking a single argument as "explicit"
For a rationale, see http://www.sjbrown.co.uk/2004/05/01/always-use-explicit/
2018-10-04 17:19:18 +02:00
Sébastien Villemot 3f26933f44 Replace ExternalFunctionSetOrNot enum by integer constants
This was not conceptually an enum, but rather a collection of unrelated
constants:
- two constants for use as placeholder for symbol IDs at different places
- one constant for the default number of arguments
2018-10-02 18:10:12 +02:00
Sébastien Villemot 7d9cd718fc Replace more typedefs by using
Those were not automatically replaced by clang-tidy, I don’t know why…
2018-06-04 15:03:31 +02:00
Sébastien Villemot e73ebc7033 Port to C++11 noexcept keyword
Performed using modernize-use-noexcept from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-noexcept.html
2018-06-04 15:03:31 +02:00
Sébastien Villemot c0ed97d247 Port to C++11 auto keyword
Performed using modernize-use-auto from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-auto.html
2018-06-04 15:03:26 +02:00
Sébastien Villemot 6cf4e6dc0c Port to C++11 range-based for loops
Performed using modernize-loop-convert from clang-tidy.

Manual intervention was needed in MacroValue.cc because of a variable name
capture issue.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-loop-convert.html
2018-06-04 12:26:16 +02:00
Houtan Bastani b504f160ca move files to src directory 2018-02-15 11:48:04 +01:00