Commit Graph

14 Commits

Author SHA1 Message Date
Alexander Ivanov 53df5ddcfd Removing using std::...
Change-Id: I584402e2a34869183c1d59071a15d97b216c52fb
2023-01-11 16:51:38 +00:00
Sameer Agarwal caf614a6c1 Modernize code using c++17 constructs
Mostly done using

find . \( -name '*.cc' -o -name '*.h' \) -a -type f -exec clang-tidy -p \
cmake-build -checks='-*,google-*,modernize-*,-modernize-use-nodiscard,-modernize-use-trailing-return-type' {} -fix \;

Change-Id: Ifccbcabe7a1d9a32a09d28ac4f3f8466696c1a50
2022-04-22 06:11:18 -07:00
Sergiu Deitsch f90833f5fa Simplify symbol export
Currently, the logic for exporting symbols is rather complicated: when
tests are enabled internal symbols are exported in addition to the
public symbols. Such logic causes several problems. (1) Test binaries
link against a Ceres build that is different from the final release
since fewer optimizations are applied if more symbols are exported. (2)
Also, some toolchains hide symbols by default breaking the existing
logic eventually causing linker errors.

Since internal symbols are not intended to be used outside of the
project, we can compile them into object files and use exactly the same
binary code both for the final build and the tests without relying on
conditionals.

By default, all symbols are now hidden unless annotated as public.
Internal symbols are explicitly marked as not being exported in case
users chose not to hide symbols by default.

Change-Id: I589dd10be2f6f438508783cf99d141af0120057b
2022-02-14 20:19:08 +01:00
Sameer Agarwal ae65219e04 ClangTidy cleanups
1. NULL -> nullptr
2. foo.reset(new Bar) -> = foo = std::make_unique<Bar>()
3. Missing std library includes & prefixes

Change-Id: I260b261b484554be681ee5a7398126fdb3b3a789
2022-02-09 10:06:49 -08:00
Nikolaus Demmel 7b8f675bfd fix formatting for (non-generated) internal source files
- Change formatting standard to Cpp11. Main difference is not having
  the space between two closing >> for nested templates. We don't
  choose c++14, because older versions of clang-format (version 9
  and earlier) don't know this value yet, and it doesn't make a
  difference in the formatting.
- Apply clang-format to all (non generated) internal source files.
- Manually fix some code sections (clang-format on/off) and c-strings
- Exclude some embedded external files with very different formatting
  (gtest/gmock)
- Add script to format all source files

Change-Id: Ic6cea41575ad6e37c9e136dbce176b0d505dc44d
2020-09-21 02:52:07 +02:00
Alex Stewart 7ef83e0759 Update minimum required C++ version for Ceres to C++14
- Removes all workarounds for pre-C++14 versions
- Removes '11' qualifier from C++ threading option and associated
  defines.
- Fix missing inclusion of 'Multithreading' in reported Ceres components
  when C++ threading model is enabled.
- Update Sphinx documentation to specify C++14 as minimum requirement.

Change-Id: I706c8b367b3221e3c4d1a0aaf669a8f9c911e438
2020-05-30 19:15:03 +01:00
Alex Stewart 706a876541 Fix use of va_copy() if compiling with explicit C++ version < C++11.
- va_copy() was defined in the C99 standard, but did not appear in the
  C++ standard until C++11.  If the C++ standard is not specified,
  both GCC & Clang will define va_copy(), even though strictly speaking
  they should not.  However, if the C++ standard is explicitly specified
  to something < C++11 (e.g. -std=c++03) then va_copy() will NOT be
  defined.
- Now, if va_copy() is not defined, we either define our own version
  on non GCC/Clang compilers (as before for MSVC alone), and use the
  internal __va_copy() version on GCC & Clang, which does exist.

Change-Id: I0224f7fa6aae060dee2287782b1cad767c244d3c
2016-01-21 19:30:58 +00:00
Keir Mierle 7492b0d8de Update copyright headers with new year and URL
Since Ceres is moving to using GitHub for issues, and the Google
Code URL in the current copyright header will soon become invalid,
update all the headers.

Change-Id: I1fce70375d1bcf098591f07b4d8f01a5c1e0789c
2015-03-18 05:43:23 +00:00
Sameer Agarwal 05a07ecc77 Remove using std::string from port.h
Change-Id: I7376f5e7eace22ec1fc05a61eaa858594f08682d
2015-01-07 15:10:46 -08:00
Björn Piltz 3209b04574 Fixed warning : 'va_copy' : macro redefinition
MSVC 2013 has got va_copy
Compare
http://msdn.microsoft.com/en-us/library/kb57fad8(v=vs.110).aspx
and
http://msdn.microsoft.com/en-us/library/kb57fad8.aspx.

Change-Id: If0937c76e8d250cde4b343844f3d35c980bf0921
2014-05-07 19:02:07 +00:00
Sameer Agarwal 89a592f410 LinearSolver::Summary::status -> LinearSolver::Summary::message.
And a bunch of minor lint cleanups as they showed up.

Change-Id: I430a6b05710923c72daf6a5df4dfcd16fbf44b3a
2013-11-26 11:35:49 -08:00
Sergey Sharybin b53c9667f5 Solve No Previous Prototype GCC warning
In some cases there were missing includes of own
header files from implementation files.

In other cases moved function which are only used
within single file into an anonymous namespace.

Change-Id: I2c6b411bcfbc521e2a5f21265dc8e009a548b1c8
2013-02-25 01:44:50 +06:00
Keir Mierle efe7ac60a0 Port Ceres to Windows
This is a preliminary, but full, port of Ceres to Windows.
Currently all tests compile and run, with only system_test
failing to work correctly due to a path issue.

Change-Id: I4152c1588bf51ffd7f4d9401ef9759f5d28c299c
2012-06-24 23:22:04 -07:00
Keir Mierle 8ebb073038 Initial commit of Ceres Solver. 2012-04-30 23:09:08 -07:00