From patchwork Wed Apr 20 12:13:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Openvpn-devel,1/3] dev-tools: Remove no longer needed openvpn-plugin.h.in patching X-Patchwork-Submitter: David Sommerseth X-Patchwork-Id: 2375 Message-Id: <20220420121322.42732-1-openvpn@sf.lists.topphemmelig.net> To: openvpn-devel@lists.sourceforge.net Cc: David Sommerseth Date: Wed, 20 Apr 2022 14:13:20 +0200 From: David Sommerseth List-Id: From: David Sommerseth The bug in uncrustify 0.64 is no longer causing us issues as we now require at least v0.72. This workaround was added as part of the initial reformat-all inclusion, in commit 2417d55c4945d491e. Signed-off-by: David Sommerseth Acked-by: Gert Doering --- .../after_include_openvpn-plugin.h.in.patch | 13 ------------- .../before_include_openvpn-plugin.h.in.patch | 13 ------------- dev-tools/special-files.lst | 1 - 3 files changed, 27 deletions(-) delete mode 100644 dev-tools/reformat-patches/after_include_openvpn-plugin.h.in.patch delete mode 100644 dev-tools/reformat-patches/before_include_openvpn-plugin.h.in.patch diff --git a/dev-tools/reformat-patches/after_include_openvpn-plugin.h.in.patch b/dev-tools/reformat-patches/after_include_openvpn-plugin.h.in.patch deleted file mode 100644 index 100da078..00000000 --- a/dev-tools/reformat-patches/after_include_openvpn-plugin.h.in.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/include/openvpn-plugin.h.in b/include/openvpn-plugin.h.in -index 05bffab..05b4b6a 100644 ---- a/include/openvpn-plugin.h.in -+++ b/include/openvpn-plugin.h.in -@@ -169,7 +169,7 @@ typedef void *openvpn_plugin_handle_t; - /* - * We are compiling OpenVPN. - */ --/* #define OPENVPN_PLUGIN_DEF typedef */ -+#define OPENVPN_PLUGIN_DEF typedef - #define OPENVPN_PLUGIN_FUNC(name) (*name) - - #else /* ifdef OPENVPN_PLUGIN_H */ diff --git a/dev-tools/reformat-patches/before_include_openvpn-plugin.h.in.patch b/dev-tools/reformat-patches/before_include_openvpn-plugin.h.in.patch deleted file mode 100644 index 679c4149..00000000 --- a/dev-tools/reformat-patches/before_include_openvpn-plugin.h.in.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/include/openvpn-plugin.h.in b/include/openvpn-plugin.h.in -index 34ad18b..f4c5472 100644 ---- a/include/openvpn-plugin.h.in -+++ b/include/openvpn-plugin.h.in -@@ -169,7 +169,7 @@ typedef void *openvpn_plugin_handle_t; - /* - * We are compiling OpenVPN. - */ --#define OPENVPN_PLUGIN_DEF typedef -+// #define OPENVPN_PLUGIN_DEF typedef - #define OPENVPN_PLUGIN_FUNC(name) (*name) - - #else diff --git a/dev-tools/special-files.lst b/dev-tools/special-files.lst index f3f77ea3..64ee9e1a 100644 --- a/dev-tools/special-files.lst +++ b/dev-tools/special-files.lst @@ -1,4 +1,3 @@ E:doc/doxygen/doc_key_generation.h # @verbatim section gets mistreated, exclude it E:src/compat/compat-lz4.c # Preserve LZ4 upstream formatting E:src/compat/compat-lz4.h # Preserve LZ4 upstream formatting -P:include/openvpn-plugin.h.in # uncrustify segfaults, patch it before+after From patchwork Wed Apr 20 12:13:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Openvpn-devel,2/3] dev-tools: Remove uncrusify -p X-Patchwork-Submitter: David Sommerseth X-Patchwork-Id: 2377 Message-Id: <20220420121322.42732-2-openvpn@sf.lists.topphemmelig.net> To: openvpn-devel@lists.sourceforge.net Cc: David Sommerseth Date: Wed, 20 Apr 2022 14:13:21 +0200 From: David Sommerseth List-Id: From: David Sommerseth The -p option to uncrustify was providing debug information about decisions done by uncrustify. This was useful when debugging why certain formatting choices. With newer versions of uncrusitfy the -p option can only be used on individual files and not a list of files. Since still supporting this would require a bigger rewrite of reformat-all.sh, it was chosen to instead remove the usage of this option. If certain behaviours needs to be debugged, running uncrusity on individual files directly will work fine anyhow. Signed-off-by: David Sommerseth Acked-by: Gert Doering --- dev-tools/reformat-all.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev-tools/reformat-all.sh b/dev-tools/reformat-all.sh index dc2bfc4e..ff126b0f 100755 --- a/dev-tools/reformat-all.sh +++ b/dev-tools/reformat-all.sh @@ -80,8 +80,8 @@ cd "$srcroot" # Kick off uncrustify echo - echo "** INFO ** Running: uncrustify -c $cfg --no-backup -l C -p debug.uncr -F $files" - uncrustify -c "$cfg" --no-backup -l C -p debug.uncr -F "$files" 2>&1 + echo "** INFO ** Running: uncrustify -c $cfg --no-backup -l C -F $files" + uncrustify -c "$cfg" --no-backup -l C -F "$files" 2>&1 res=$? echo "** INFO ** Uncrustify completed (exit code $res)" } | tee "${log}-1" # Log needs to be closed here, to be processed in next block From patchwork Wed Apr 20 12:13:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Openvpn-devel,3/3] dev-tools: Avoid uncrustify mangling MAC_FMT macro X-Patchwork-Submitter: David Sommerseth X-Patchwork-Id: 2376 Message-Id: <20220420121322.42732-3-openvpn@sf.lists.topphemmelig.net> To: openvpn-devel@lists.sourceforge.net Cc: David Sommerseth Date: Wed, 20 Apr 2022 14:13:22 +0200 From: David Sommerseth List-Id: From: David Sommerseth The MAC_FMT in src/openvpn/misc.h need to be formatted strictly, and uncrustify does not fully grasp the current code. So we tell it to not touch it. Signed-off-by: David Sommerseth Acked-by: Gert Doering --- src/openvpn/misc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/openvpn/misc.h b/src/openvpn/misc.h index 7970b60d..d8a15650 100644 --- a/src/openvpn/misc.h +++ b/src/openvpn/misc.h @@ -212,7 +212,9 @@ struct buffer prepend_dir(const char *dir, const char *path, struct gc_arena *gc); #define _STRINGIFY(S) #S +/* *INDENT-OFF* - uncrustify need to ignore this macro */ #define MAC_FMT _STRINGIFY(%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx) +/* *INDENT-ON* */ #define MAC_PRINT_ARG(_mac) _mac[0], _mac[1], _mac[2], \ _mac[3], _mac[4], _mac[5] #define MAC_SCAN_ARG(_mac) &_mac[0], &_mac[1], &_mac[2], \