From 0794931986bda4bacf6dde8c8230595f99e31e95 Mon Sep 17 00:00:00 2001 From: jesperpedersen Date: Sun, 31 Mar 2024 12:25:18 -0400 Subject: [PATCH] uncrustify --- src/libpgagroal/configuration.c | 6 +- uncrustify.cfg | 101 ++++++++++++++++++++------------ 2 files changed, 67 insertions(+), 40 deletions(-) diff --git a/src/libpgagroal/configuration.c b/src/libpgagroal/configuration.c index bdd5ebca..8be7b47a 100644 --- a/src/libpgagroal/configuration.c +++ b/src/libpgagroal/configuration.c @@ -2400,7 +2400,7 @@ is_same_server(struct server* s1, struct server* s2) /** * Checks if TLS configurations are same. * @return true if the TLS configurations are same -*/ + */ static bool is_same_tls(struct server* src, struct server* dst) { @@ -2471,7 +2471,7 @@ restart_int(char* name, int e, int n) /** * Utility function prints a line in the log when a restart is required. * @return 0 when parameter values are same, 1 when a restart required. -*/ + */ static int restart_bool(char* name, bool e, bool n) { @@ -2563,7 +2563,7 @@ restart_server(struct server* src, struct server* dst) snprintf(restart_message, sizeof(restart_message), "Server <%s>, parameter ", src->name); restart_int(restart_message, dst->port, src->port); return 1; - } + } else if (!is_same_tls(src, dst)) { snprintf(restart_message, sizeof(restart_message), "Server <%s>, parameter ", src->name); diff --git a/uncrustify.cfg b/uncrustify.cfg index 8288a66f..19220fb8 100644 --- a/uncrustify.cfg +++ b/uncrustify.cfg @@ -400,7 +400,7 @@ sp_after_semi_for = force # ignore/add/remove/force/not_defined sp_after_semi_for_empty = ignore # ignore/add/remove/force/not_defined # Add or remove space before '[' (except '[]'). -sp_before_square = remove # ignore/add/remove/force/not_defined +sp_before_square = ignore # ignore/add/remove/force/not_defined # Add or remove space before '[' for a variable definition. # @@ -411,13 +411,13 @@ sp_before_vardef_square = remove # ignore/add/remove/force/not_defined sp_before_square_asm_block = ignore # ignore/add/remove/force/not_defined # Add or remove space before '[]'. -sp_before_squares = remove # ignore/add/remove/force/not_defined +sp_before_squares = ignore # ignore/add/remove/force/not_defined # Add or remove space before C++17 structured bindings. sp_cpp_before_struct_binding = ignore # ignore/add/remove/force/not_defined # Add or remove space inside a non-empty '[' and ']'. -sp_inside_square = remove # ignore/add/remove/force/not_defined +sp_inside_square = ignore # ignore/add/remove/force/not_defined # Add or remove space inside '[]'. sp_inside_square_empty = ignore # ignore/add/remove/force/not_defined @@ -440,7 +440,7 @@ sp_after_mdatype_commas = ignore # ignore/add/remove/force/not_defined # (C#) Add or remove space between '[' and ',' in multidimensional array type # like 'int[,,]'. -sp_before_mdatype_commas = remove # ignore/add/remove/force/not_defined +sp_before_mdatype_commas = ignore # ignore/add/remove/force/not_defined # (C#) Add or remove space between ',' in multidimensional array type # like 'int[,,]'. @@ -468,8 +468,8 @@ sp_type_ellipsis = ignore # ignore/add/remove/force/not_defined # Add or remove space between a '*' and '...'. sp_ptr_type_ellipsis = ignore # ignore/add/remove/force/not_defined -# (D) Add or remove space between a type and '?'. -sp_type_question = ignore # ignore/add/remove/force/not_defined +# Add or remove space before pointer star '*'. +sp_before_ptr_star = remove # ignore/add/remove/force/not_defined # Add or remove space between ')' and '...'. sp_paren_ellipsis = ignore # ignore/add/remove/force/not_defined @@ -1177,9 +1177,12 @@ indent_var_def_blk = 0 # number # Whether to indent continued variable declarations instead of aligning. indent_var_def_cont = false # true/false -# Whether to indent continued shift expressions ('<<' and '>>') instead of -# aligning. Set align_left_shift=false when enabling this. -indent_shift = false # true/false +# How to indent continued shift expressions ('<<' and '>>'). +# Set align_left_shift=false when using this. +# 0: Align shift operators instead of indenting them (default) +# 1: Indent by one level +# -1: Preserve original indentation +indent_shift = 0 # number # Whether to force indentation of function definitions to start in column 1. indent_func_def_force_col1 = false # true/false @@ -1351,17 +1354,23 @@ indent_paren_after_func_decl = false # true/false # if the parenthesis is on its own line. indent_paren_after_func_call = false # true/false -# Whether to indent a comma when inside a brace. -# If true, aligns under the open brace. -indent_comma_brace = false # true/false +# How to indent a comma when inside braces. +# 0: Indent by one level (default) +# 1: Align under the open brace +# -1: Preserve original indentation +indent_comma_brace = 0 # number -# Whether to indent a comma when inside a parenthesis. -# If true, aligns under the open parenthesis. -indent_comma_paren = false # true/false +# How to indent a comma when inside parentheses. +# 0: Indent by one level (default) +# 1: Align under the open parenthesis +# -1: Preserve original indentation +indent_comma_paren = 0 # number -# Whether to indent a Boolean operator when inside a parenthesis. -# If true, aligns under the open parenthesis. -indent_bool_paren = false # true/false +# How to indent a Boolean operator when inside parentheses. +# 0: Indent by one level (default) +# 1: Align under the open parenthesis +# -1: Preserve original indentation +indent_bool_paren = 0 # number # Whether to indent a semicolon when inside a for parenthesis. # If true, aligns under the open for parenthesis. @@ -2218,11 +2227,14 @@ nl_after_func_body_class = 0 # unsigned number # Overrides nl_after_func_body and nl_after_func_body_class. nl_after_func_body_one_liner = 0 # unsigned number -# The number of blank lines after a block of variable definitions at the top -# of a function body. +# The minimum number of blank lines after a block of variable definitions +# at the top of a function body. If any preprocessor directives appear +# between the opening brace of the function and the variable block, then +# it is considered as not at the top of the function.Newlines are added +# before trailing preprocessor directives, if any exist. # # 0: No change (default). -nl_func_var_def_blk = 0 # unsigned number +nl_var_def_blk_end_func_top = 0 # unsigned number # The number of newlines before a block of typedefs. If nl_after_access_spec # is non-zero, that option takes precedence. @@ -2736,9 +2748,16 @@ align_single_line_brace_gap = 0 # unsigned number # 0: Don't align (default). align_oc_msg_spec_span = 0 # unsigned number -# Whether to align macros wrapped with a backslash and a newline. This will -# not work right if the macro contains a multi-line comment. -align_nl_cont = false # true/false +# Whether and how to align backslashes that split a macro onto multiple lines. +# This will not work right if the macro contains a multi-line comment. +# +# 0: Do nothing (default) +# 1: Align the backslashes in the column at the end of the longest line +# 2: Align with the backslash that is farthest to the left, or, if that +# backslash is farther left than the end of the longest line, at the end of +# the longest line +# 3: Align with the backslash that is farthest to the right +align_nl_cont = 0 # unsigned number # Whether to align macro functions and variables together. align_pp_define_together = false # true/false @@ -2980,12 +2999,17 @@ mod_full_brace_function = add # ignore/add/remove/force/not_defined mod_full_brace_if = add # ignore/add/remove/force/not_defined # Whether to enforce that all blocks of an 'if'/'else if'/'else' chain either -# have, or do not have, braces. If true, braces will be added if any block -# needs braces, and will only be removed if they can be removed from all -# blocks. -# -# Overrides mod_full_brace_if. -mod_full_brace_if_chain = false # true/false +# have, or do not have, braces. Overrides mod_full_brace_if. +# +# 0: Don't override mod_full_brace_if +# 1: Add braces to all blocks if any block needs braces and remove braces if +# they can be removed from all blocks +# 2: Add braces to all blocks if any block already has braces, regardless of +# whether it needs them +# 3: Add braces to all blocks if any block needs braces and remove braces if +# they can be removed from all blocks, except if all blocks have braces +# despite none needing them +mod_full_brace_if_chain = 0 # unsigned number # Whether to add braces to all blocks of an 'if'/'else if'/'else' chain. # If true, mod_full_brace_if_chain will only remove braces from an 'if' that @@ -3152,8 +3176,8 @@ pp_indent_at_level = false # true/false # Default: 1 pp_indent_count = 1 # unsigned number -# Add or remove space after # based on pp_level of #if blocks. -pp_space = ignore # ignore/add/remove/force/not_defined +# Add or remove space after # based on pp level of #if blocks. +pp_space_after = ignore # ignore/add/remove/force/not_defined # Sets the number of spaces per level added with pp_space. pp_space_count = 0 # unsigned number @@ -3209,12 +3233,15 @@ pp_indent_func_def = true # true/false # Default: true pp_indent_extern = true # true/false -# Whether to indent braces directly inside #if, #else, and #endif. -# Only applies to the indent of the preprocesser that the braces are directly -# inside of. +# How to indent braces directly inside #if, #else, and #endif. +# Requires pp_if_indent_code=true and only applies to the indent of the +# preprocessor that the braces are directly inside of. +# 0: No extra indent +# 1: Indent by one level +# -1: Preserve original indentation # -# Default: true -pp_indent_brace = true # true/false +# Default: 1 +pp_indent_brace = 1 # # Sort includes options