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:
@@ -62,7 +62,7 @@ void StringAppendV(string* dst, const char* format, va_list ap) {
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined (_MSC_VER)
|
||||
#if defined(_MSC_VER)
|
||||
// Error or MSVC running out of space. MSVC 8.0 and higher
|
||||
// can be asked about space needed with the special idiom below:
|
||||
va_copy(backup_ap, ap);
|
||||
@@ -78,7 +78,7 @@ void StringAppendV(string* dst, const char* format, va_list ap) {
|
||||
|
||||
// Increase the buffer size to the size requested by vsnprintf,
|
||||
// plus one for the closing \0.
|
||||
int length = result+1;
|
||||
int length = result + 1;
|
||||
char* buf = new char[length];
|
||||
|
||||
// Restore the va_list before we use it again
|
||||
@@ -93,7 +93,6 @@ void StringAppendV(string* dst, const char* format, va_list ap) {
|
||||
delete[] buf;
|
||||
}
|
||||
|
||||
|
||||
string StringPrintf(const char* format, ...) {
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
|
||||
Reference in New Issue
Block a user