mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
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
This commit is contained in:
@@ -55,9 +55,9 @@ namespace internal {
|
||||
// have an implicit 'this' argument, the arguments of such methods
|
||||
// should be counted from two, not one."
|
||||
#define CERES_PRINTF_ATTRIBUTE(string_index, first_to_check) \
|
||||
__attribute__((__format__ (__printf__, string_index, first_to_check)))
|
||||
__attribute__((__format__(__printf__, string_index, first_to_check)))
|
||||
#define CERES_SCANF_ATTRIBUTE(string_index, first_to_check) \
|
||||
__attribute__((__format__ (__scanf__, string_index, first_to_check)))
|
||||
__attribute__((__format__(__scanf__, string_index, first_to_check)))
|
||||
#else
|
||||
#define CERES_PRINTF_ATTRIBUTE(string_index, first_to_check)
|
||||
#endif
|
||||
@@ -68,7 +68,9 @@ extern std::string StringPrintf(const char* format, ...)
|
||||
CERES_PRINTF_ATTRIBUTE(1, 2);
|
||||
|
||||
// Store result into a supplied string and return it.
|
||||
extern const std::string& SStringPrintf(std::string* dst, const char* format, ...)
|
||||
extern const std::string& SStringPrintf(std::string* dst,
|
||||
const char* format,
|
||||
...)
|
||||
// Tell the compiler to do printf format string checking.
|
||||
CERES_PRINTF_ATTRIBUTE(2, 3);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user