Commit Graph

30 Commits

Author SHA1 Message Date
Andrew Gaul 4845831f93
Convert some const to constexpr (#2342)
This guarantees that the function or value will resolve at compile-time.
2023-11-14 22:15:17 +09:00
Andrew Gaul 6c55bcfdd8
Own values in add_header (#2285)
Also fix up indentation.
2023-08-20 18:59:18 +09:00
Andrew Gaul e157d811cb
Use std::string::compare and operator== where possible (#2256) 2023-08-15 21:22:36 +09:00
Andrew Gaul a4a2841c05
Use C++11 nullptr instead of 0 or NULL (#2234)
This improves type-safety.
2023-07-27 21:56:58 +09:00
Andrew Gaul 6344d74ae3
Replace some raw pointers with std::unique_ptr (#2195)
This simplifies code paths and makes memory leaks less likely.  It
also makes memory ownership more explicit by requiring std::move.
This commit requires C++11.  References #2179.
2023-07-27 09:12:28 +09:00
Andrew Gaul 3b6688253f
Address cppcheck 2.10 warnings (#2163)
Disable newer cppcheck until we can diagnose this further.
References #2162.
2023-06-25 16:04:16 +09:00
Andrew Gaul 01a92476e6
Remove unneeded headers identified by IWYU (#2007) 2022-07-28 23:38:38 +09:00
Andrew Gaul a100be9dce
Prefer std::string::empty over length == 0 (#1679)
This is more concise.
2021-06-13 20:03:10 +09:00
Takeshi Nakatani 2908878988 Fixed codes for cppcheck 2.4.1 2021-04-13 21:12:35 +09:00
Andrew Gaul d019dda4f7
Simplify substr manipulations with erase (#1532)
This avoids creating a new std::string.
2021-01-25 18:02:32 +09:00
Takeshi Nakatani 38e1eaa8a3 Added logfile option for non-syslog logging 2020-10-19 20:10:19 +09:00
Andrew Gaul 1043e08dfa Remove uses of implicit namespace std
Fixed via:

sed -i '/using namespace std/{N;d}' src/*.cpp
sed -i 's/ string/ std::string/g' src/*.cpp
sed -i 's/(string/(std::string/g' src/*.cpp
sed -i 's/\[string/\[std::string/g' src/*.cpp
sed -i 's/^string/std::string/g' src/*.cpp
sed -i 's/ ifstream/ std::ifstream/g' src/*.cpp
sed -i 's/ istringstream/ std::istringstream/g' src/*.cpp
sed -i 's/ ostringstream/ std::ostringstream/g' src/*.cpp
sed -i 's/ max(/ std::max(/g' src/*.cpp
sed -i 's/ min(/ std::min(/g' src/*.cpp
sed -i 's/ endl/ std::endl/g' src/*.cpp
2020-09-13 11:57:20 +09:00
Takeshi Nakatani b5ffd419d8 Source file division and set 4 spaces and cleanup 2020-08-26 17:43:50 +09:00
Andrew Gaul 958ad83a4b Correct vim modeline to 2-space indentation 2020-08-19 21:03:46 +09:00
Takeshi Nakatani bedd648d47 Fixed build error by cppcheck 1.89 2019-09-23 10:49:49 +00:00
Takeshi Nakatani a337c32840
Merge pull request #1088 from gaul/clang-tidy/misplaced-const
Avoid misplaced const via removing unneeded typedef
2019-07-15 04:08:51 +09:00
Andrew Gaul 6fd42d9fe4 Prefer modern C headers
Found and fixed via clang-tidy.
2019-07-12 03:50:59 -07:00
Andrew Gaul efff9c01a6 Avoid misplaced const via removing unneeded typedef
Found via clang-tidy.
2019-07-12 03:41:19 -07:00
Takeshi Nakatani c603680e02
Merge pull request #939 from gaul/stringstream-specific
Prefer specific [io]stringstream where possible
2019-02-03 11:06:57 +09:00
Andrew Gaul 07636c8a8d Prefer specific [io]stringstream where possible
These better communicate intent and are slightly more efficient.
2019-01-29 10:44:33 -08:00
Andrew Gaul 35d55ee513 Remove unneeded void parameter
This is implicit in C++.  Found and fixed via clang-tidy.
2019-01-28 23:22:27 -08:00
Andrew Gaul 84b421d6ef Prefer empty over size checks
Found and fixed via clang-tidy.
2019-01-23 11:30:28 -08:00
Andrew Gaul 1fc25e8c3f Remove redundant string initializations
Found and fixed via clang-tidy.
2019-01-22 23:16:37 -08:00
Andrew Gaul 40ba3b44a1 Prefer abort over assert(false)
The compiler can remove the latter when compiled with NDEBUG which may
cause unintended control flow.
2019-01-20 12:30:27 -08:00
Andrew Gaul ab2f36f202 Plug memory leaks
Found via clang-tidy.
2019-01-17 18:54:34 -08:00
Takeshi Nakatani c494e54320 Fixed cppcheck error on osx 2018-02-28 12:06:06 +00:00
Takeshi Nakatani 9d10a5aa70 Changed copyright year format for debian pkg 2017-05-07 11:24:17 +00:00
Takeshi Nakatani 6cc30eea44 Allow duplicate key in ahbe_conf - #386 2016-05-06 01:08:39 +00:00
Takeshi Nakatani 1af7aaeccb Fixed addhead.cpp for cppcheck 2016-02-07 05:53:56 +00:00
Takeshi Nakatani c7cf86c2ef Sepalated AdditionalHeader class from curl.* 2016-02-07 05:41:56 +00:00