From 5066ca4fc2a1906250591cf779af4043cc761ac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Klitzing?= <aklitzing@gmail.com> Date: Sun, 21 Nov 2021 17:51:55 +0100 Subject: [PATCH] community/uncrustify: upgrade to 0.74.0 --- community/uncrustify/APKBUILD | 11 +-- .../use-default-only-with-a-switch.patch | 89 ------------------- 2 files changed, 4 insertions(+), 96 deletions(-) delete mode 100644 community/uncrustify/use-default-only-with-a-switch.patch diff --git a/community/uncrustify/APKBUILD b/community/uncrustify/APKBUILD index b63b20ba991b..6b14fa0df3b4 100644 --- a/community/uncrustify/APKBUILD +++ b/community/uncrustify/APKBUILD @@ -1,16 +1,14 @@ # Maintainer: André Klitzing <aklitzing@gmail.com> pkgname=uncrustify -pkgver=0.73.0 -pkgrel=1 +pkgver=0.74.0 +pkgrel=0 pkgdesc="Source code beautifier" url="https://github.com/uncrustify/uncrustify" arch="all" license="GPL-2.0-or-later" makedepends="cmake python3" subpackages="$pkgname-doc" -source="$pkgname-$pkgver.tar.gz::https://github.com/uncrustify/uncrustify/archive/uncrustify-$pkgver.tar.gz - use-default-only-with-a-switch.patch -" +source="$pkgname-$pkgver.tar.gz::https://github.com/uncrustify/uncrustify/archive/uncrustify-$pkgver.tar.gz" builddir="$srcdir/uncrustify-uncrustify-$pkgver" build() { @@ -32,6 +30,5 @@ package() { } sha512sums=" -24b7eb2a76e2dcfca64223df40a434fcdcc281f5937cbf5e78832deb7716ee01b596aedff473af1e3023b33914357582500e4954f4ded009684bc4fb700e64d9 uncrustify-0.73.0.tar.gz -dc82e10eba5c5f5ac48a2777f5abd3bfcc16d1f739e65a578a22838e0e891529df296054a80e79e11cfb9db7a5fea6c5f35f602e243a1c1e7ef8c900f13d06a7 use-default-only-with-a-switch.patch +97348bf151464e12e292a38dfdbb98d62c15bdd7dd990da7c8854969ceb53d6f70a0873a6e09b9978291010615dda29c3486a4e8a77dc1bfb881c34df01143c5 uncrustify-0.74.0.tar.gz " diff --git a/community/uncrustify/use-default-only-with-a-switch.patch b/community/uncrustify/use-default-only-with-a-switch.patch deleted file mode 100644 index 4c592b5c1cd2..000000000000 --- a/community/uncrustify/use-default-only-with-a-switch.patch +++ /dev/null @@ -1,89 +0,0 @@ -From dc32269e659cebaa6c3a199976fbf8cf616c7b29 Mon Sep 17 00:00:00 2001 -From: Guy Maurel <guy.j@maurel.de> -Date: Sat, 15 May 2021 18:38:11 +0200 -Subject: [PATCH] use default only with a switch - ---- - src/brace_cleanup.cpp | 29 +++++++++++++++---------- - tests/cpp.test | 1 + - tests/expected/cpp/30225-Issue_3176.cpp | 1 + - tests/input/cpp/Issue_3176.cpp | 1 + - 4 files changed, 21 insertions(+), 11 deletions(-) - create mode 100644 tests/expected/cpp/30225-Issue_3176.cpp - create mode 100644 tests/input/cpp/Issue_3176.cpp - -diff --git a/src/brace_cleanup.cpp b/src/brace_cleanup.cpp -index 03ab68e3f8..a650cfa0c2 100644 ---- a/src/brace_cleanup.cpp -+++ b/src/brace_cleanup.cpp -@@ -720,7 +720,6 @@ static void parse_cleanup(BraceState &braceState, ParseFrame &frm, chunk_t *pc) - set_chunk_parent(pc, parent); - } - // Issue #2281 -- LOG_FMT(LBCSPOP, "%s(%d):\n", __func__, __LINE__); - - if ( chunk_is_token(pc, CT_BRACE_OPEN) - && pc->parent_type == CT_SWITCH) -@@ -740,18 +739,26 @@ static void parse_cleanup(BraceState &braceState, ParseFrame &frm, chunk_t *pc) - if ( chunk_is_token(pc, CT_CASE) - || chunk_is_token(pc, CT_DEFAULT)) - { -- LOG_FMT(LBCSPOP, "%s(%d): pc->orig_line is %zu, pc->orig_col is %zu\n", -- __func__, __LINE__, pc->orig_line, pc->orig_col); -- set_chunk_parent(pc, CT_SWITCH); -- size_t idx = frm.size(); -- LOG_FMT(LBCSPOP, "%s(%d): idx is %zu\n", -- __func__, __LINE__, idx); -- chunk_t *saved = frm.at(idx - 2).pc; -+ chunk_t *prev = chunk_get_prev_ncnnl(pc); // Issue #3176 - -- if (saved != nullptr) -+ if ( chunk_is_token(pc, CT_CASE) -+ || ( chunk_is_token(pc, CT_DEFAULT) -+ && chunk_is_not_token(prev, CT_ASSIGN))) - { -- // set parent member -- chunk_set_parent(pc, saved); -+ // it is a CT_DEFAULT from a switch -+ LOG_FMT(LBCSPOP, "%s(%d): pc->orig_line is %zu, pc->orig_col is %zu\n", -+ __func__, __LINE__, pc->orig_line, pc->orig_col); -+ set_chunk_parent(pc, CT_SWITCH); -+ size_t idx = frm.size(); -+ LOG_FMT(LBCSPOP, "%s(%d): idx is %zu\n", -+ __func__, __LINE__, idx); -+ chunk_t *saved = frm.at(idx - 2).pc; -+ -+ if (saved != nullptr) -+ { -+ // set parent member -+ chunk_set_parent(pc, saved); -+ } - } - } - -diff --git a/tests/cpp.test b/tests/cpp.test -index 84bbaa0f96..e8d1f50cd9 100644 ---- a/tests/cpp.test -+++ b/tests/cpp.test -@@ -179,6 +179,7 @@ - 30222 sp_assign_default.cfg cpp/trailing_return.cpp - 30223 sp_enum_colon.cfg cpp/sp_enum_colon.cpp - 30224 sp_enum_colon-r.cfg cpp/sp_enum_colon.cpp -+30225 empty.cfg cpp/Issue_3176.cpp - - 30230 sp_type_func-r.cfg cpp/sp_type_func.cpp - 30231 sp_type_func-f.cfg cpp/sp_type_func.cpp -diff --git a/tests/expected/cpp/30225-Issue_3176.cpp b/tests/expected/cpp/30225-Issue_3176.cpp -new file mode 100644 -index 0000000000..2384027d8f ---- /dev/null -+++ b/tests/expected/cpp/30225-Issue_3176.cpp -@@ -0,0 +1 @@ -+SecureStorage::~SecureStorage() = default; -diff --git a/tests/input/cpp/Issue_3176.cpp b/tests/input/cpp/Issue_3176.cpp -new file mode 100644 -index 0000000000..2384027d8f ---- /dev/null -+++ b/tests/input/cpp/Issue_3176.cpp -@@ -0,0 +1 @@ -+SecureStorage::~SecureStorage() = default; -- GitLab