Skip to content

Commit

Permalink
Bug #29588949: UPGRADE TO CLANG-FORMAT 8
Browse files Browse the repository at this point in the history
Upgrade clang-format settings from 5.0 to 8, and rerun it over the entire code base.

The real committer is Steinar H. Gunderson <[email protected]>,
but the author has been set to Anonymous Reformatter so that git blame won't
show myself as author of all existing code. To ignore whitespace changes caused
by this commit, please use git blame -w. For ignoring larger changes, you can
run blame on the commit immediately preceding this, as follows:

  git blame clang-format-8-base^ -- path/to/file.cc

Change-Id: Ia6fe3de72ab6e760b678305175204f216185fa89
  • Loading branch information
Anonymous Reformatter authored and Steinar H. Gunderson committed Apr 2, 2019
1 parent 0d77e99 commit 4f7fc7f
Show file tree
Hide file tree
Showing 338 changed files with 2,157 additions and 2,145 deletions.
52 changes: 48 additions & 4 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

# This is the output of clang-format-5.0 --style=google --dump-config,
# This is the output of clang-format-8 --style=google --dump-config,
# except for changes mentioned below. We lock the style so that any newer
# version of clang-format will give the same result; as time goes, we may
# update this list, requiring newer versions of clang-format.

---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
Expand All @@ -43,7 +44,7 @@ AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
Expand All @@ -55,6 +56,7 @@ BraceWrapping:
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
Expand All @@ -64,6 +66,7 @@ BraceWrapping:
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
Expand All @@ -83,7 +86,10 @@ ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Expand All @@ -92,6 +98,7 @@ IncludeCategories:
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
Expand All @@ -101,30 +108,67 @@ MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
CanonicalDelimiter: ''
BasedOnStyle: google
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseTab: Never

Expand All @@ -133,5 +177,5 @@ UseTab: Never
DerivePointerAlignment: false
PointerAlignment: Right

# MySQL source code is allowed to use C++11 features.
# MySQL source code is allowed to use C++11 (and C++14) features.
Standard: Cpp11
2 changes: 1 addition & 1 deletion client/base/help_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

using namespace Mysql::Tools::Base::Options;
using Mysql::Tools::Base::Abstract_program;
using std::placeholders::_1;
using std::string;
using std::placeholders::_1;

extern const char *load_default_groups[];

Expand Down
2 changes: 1 addition & 1 deletion client/base/mysql_connection_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
using Mysql::Nullable;
using Mysql::Tools::Base::Abstract_program;
using namespace Mysql::Tools::Base::Options;
using std::placeholders::_1;
using std::string;
using std::vector;
using std::placeholders::_1;

bool Mysql_connection_options::mysql_inited;

Expand Down
2 changes: 1 addition & 1 deletion client/base/mysql_query_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
#include "template_utils.h"

using namespace Mysql::Tools::Base;
using std::placeholders::_1;
using std::string;
using std::vector;
using std::placeholders::_1;

Mysql_query_runner::Mysql_query_runner(MYSQL *connection)
: m_is_processing(new std::atomic<bool>(false)),
Expand Down
2 changes: 1 addition & 1 deletion client/base/password_option.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

using namespace Mysql::Tools::Base::Options;
using Mysql::Nullable;
using std::placeholders::_1;
using std::string;
using std::placeholders::_1;

Password_option::Password_option(Nullable<string> *value, string name,
string description)
Expand Down
2 changes: 1 addition & 1 deletion client/base/show_variable_query_extractor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
#include <functional>

using namespace Mysql::Tools::Base;
using std::placeholders::_1;
using std::string;
using std::vector;
using std::placeholders::_1;

Show_variable_query_extractor::Show_variable_query_extractor()
: m_exists(false) {}
Expand Down
2 changes: 1 addition & 1 deletion client/dump/mysql_object_reader_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Mysql_object_reader_options
uint64 m_row_group_size;
const Mysql_chain_element_options *m_mysql_chain_element_options;
};
}
} // namespace Dump
} // namespace Tools
} // namespace Mysql

Expand Down
20 changes: 10 additions & 10 deletions client/mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2574,9 +2574,9 @@ static bool add_line(String &buffer, char *line, size_t line_length,
DBUG_RETURN(0);
}

/*****************************************************************
Interface to Readline Completion
******************************************************************/
/*****************************************************************
Interface to Readline Completion
******************************************************************/

#ifdef HAVE_READLINE

Expand Down Expand Up @@ -2838,7 +2838,7 @@ You can turn off this feature to get a quicker startup with -A\n\n");
DBUG_VOID_RETURN;
}

/* for gnu readline */
/* for gnu readline */

#ifndef HAVE_INDEX
extern "C" {
Expand Down Expand Up @@ -3937,9 +3937,9 @@ static int com_notee(String *buffer MY_ATTRIBUTE((unused)),
return 0;
}

/*
Sorry, this command is not available in Windows.
*/
/*
Sorry, this command is not available in Windows.
*/

#ifdef USE_POPEN
static int com_pager(String *buffer MY_ATTRIBUTE((unused)),
Expand Down Expand Up @@ -3987,9 +3987,9 @@ static int com_nopager(String *buffer MY_ATTRIBUTE((unused)),
}
#endif

/*
Sorry, you can't send the result to an editor in Win32
*/
/*
Sorry, you can't send the result to an editor in Win32
*/

#ifdef USE_POPEN
static int com_edit(String *buffer, char *line MY_ATTRIBUTE((unused))) {
Expand Down
10 changes: 5 additions & 5 deletions client/mysql_config_editor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -665,11 +665,11 @@ static bool check_and_create_login_file(void) {
goto error;
}

/*
NOTE : MYSQL_TEST_LOGIN_FILE env must be a full path,
where the directory structure must exist. However the
login file will be created if it does not exist.
*/
/*
NOTE : MYSQL_TEST_LOGIN_FILE env must be a full path,
where the directory structure must exist. However the
login file will be created if it does not exist.
*/
#ifdef _WIN32
if (!(getenv("MYSQL_TEST_LOGIN_FILE"))) {
/* Check if 'MySQL' directory is in place. */
Expand Down
2 changes: 1 addition & 1 deletion client/mysqladmin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ static int execute_commands(MYSQL *mysql, int argc, char **argv) {
*/
}

/* Warn about password being set in non ssl connection */
/* Warn about password being set in non ssl connection */
#if defined(HAVE_OPENSSL)
{
uint ssl_mode = 0;
Expand Down
8 changes: 4 additions & 4 deletions client/mysqldump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5545,10 +5545,10 @@ static bool get_view_structure(char *table, char *db) {
DBUG_RETURN(0);
}

/*
The following functions are wrappers for the dynamic string functions
and if they fail, the wrappers will terminate the current process.
*/
/*
The following functions are wrappers for the dynamic string functions
and if they fail, the wrappers will terminate the current process.
*/

#define DYNAMIC_STR_ERROR_MSG "Couldn't perform DYNAMIC_STRING operation"

Expand Down
40 changes: 20 additions & 20 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1958,16 +1958,16 @@ static int run_tool(const char *tool_path, DYNAMIC_STRING *ds_res, ...) {
DBUG_RETURN(ret);
}

/*
Test if diff is present. This is needed on Windows systems
as the OS returns 1 whether diff is successful or if it is
not present.

We run diff -v and look for output in stdout.
We don't redirect stderr to stdout to make for a simplified check
Windows will output '"diff"' is not recognized... to stderr if it is
not present.
*/
/*
Test if diff is present. This is needed on Windows systems
as the OS returns 1 whether diff is successful or if it is
not present.

We run diff -v and look for output in stdout.
We don't redirect stderr to stdout to make for a simplified check
Windows will output '"diff"' is not recognized... to stderr if it is
not present.
*/

#ifdef _WIN32

Expand Down Expand Up @@ -10470,14 +10470,14 @@ void replace_strings_append(REPLACE *rep, DYNAMIC_STRING *ds, const char *str,
}
}

/*
Regex replace functions
*/
/*
Regex replace functions
*/

/*
Finds the next (non-escaped) '/' in the expression.
(If the character '/' is needed, it can be escaped using '\'.)
*/
/*
Finds the next (non-escaped) '/' in the expression.
(If the character '/' is needed, it can be escaped using '\'.)
*/

#define PARSE_REGEX_ARG \
while (p < expr_end) { \
Expand Down Expand Up @@ -11163,9 +11163,9 @@ uint end_of_word(const char *pos) {
: 0;
}

/****************************************************************************
* Handle replacement of strings
****************************************************************************/
/****************************************************************************
* Handle replacement of strings
****************************************************************************/

#define PC_MALLOC 256 /* Bytes for pointers */
#define PS_MALLOC 512 /* Bytes for data */
Expand Down
Loading

0 comments on commit 4f7fc7f

Please sign in to comment.