From 4f2a9a3a701ca1a718514452ec112f93476e361d Mon Sep 17 00:00:00 2001 From: Ast-x64 Date: Sat, 23 Oct 2021 04:12:18 +0800 Subject: [PATCH] addpkg: openzwave --- openzwave/fix_nullptr_mistakes.patch | 70 ++++++++++++++++++++++++++++ openzwave/riscv64.patch | 25 ++++++++++ 2 files changed, 95 insertions(+) create mode 100644 openzwave/fix_nullptr_mistakes.patch create mode 100644 openzwave/riscv64.patch diff --git a/openzwave/fix_nullptr_mistakes.patch b/openzwave/fix_nullptr_mistakes.patch new file mode 100644 index 000000000..6be0b2c34 --- /dev/null +++ b/openzwave/fix_nullptr_mistakes.patch @@ -0,0 +1,70 @@ +diff --git a/cpp/build/Makefile b/cpp/build/Makefile +index bd9463c..80933fd 100644 +--- a/cpp/build/Makefile ++++ b/cpp/build/Makefile +@@ -13,10 +13,10 @@ + + + # what flags we will use for compiling in debug mode +-DEBUG_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-inline -Wno-format -Werror -Wno-error=sequence-point -Wno-sequence-point -ggdb -DDEBUG -fPIC -DSYSCONFDIR="\"$(PREFIX)/etc/openzwave/\"" -DOPENZWAVE_ENABLE_EXCEPTIONS=1 ++DEBUG_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-inline -Werror -Wno-error=sequence-point -Wno-sequence-point -ggdb -DDEBUG -fPIC -DSYSCONFDIR="\"$(PREFIX)/etc/openzwave/\"" -DOPENZWAVE_ENABLE_EXCEPTIONS=1 + DEBUG_CPPFLAGS := -std=c++11 + # what flags we will use for compiling in release mode +-RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Werror -Wno-format -Wno-error=sequence-point -Wno-sequence-point -O3 -DNDEBUG -fPIC -DSYSCONFDIR="\"$(PREFIX)/etc/openzwave/\"" -DOPENZWAVE_ENABLE_EXCEPTIONS=1 ++RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Werror -Wno-error=sequence-point -Wno-sequence-point -O3 -DNDEBUG -fPIC -DSYSCONFDIR="\"$(PREFIX)/etc/openzwave/\"" -DOPENZWAVE_ENABLE_EXCEPTIONS=1 + RELEASE_CPPFLAGS := -std=c++11 + #what flags we will use for linking in debug mode + DEBUG_LDFLAGS := -g +diff --git a/cpp/examples/MinOZW/Makefile b/cpp/examples/MinOZW/Makefile +index fe37cf5..984988f 100644 +--- a/cpp/examples/MinOZW/Makefile ++++ b/cpp/examples/MinOZW/Makefile +@@ -10,8 +10,8 @@ + .PHONY: default clean + + +-DEBUG_CFLAGS := -Wall -Wno-format -ggdb -DDEBUG $(CPPFLAGS) +-RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-format -O3 $(CPPFLAGS) ++DEBUG_CFLAGS := -Wall -ggdb -DDEBUG $(CPPFLAGS) ++RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -O3 $(CPPFLAGS) + + DEBUG_LDFLAGS := -g + +diff --git a/cpp/src/Driver.cpp b/cpp/src/Driver.cpp +index d6f6969..17c23d6 100644 +--- a/cpp/src/Driver.cpp ++++ b/cpp/src/Driver.cpp +@@ -6239,7 +6239,6 @@ void Driver::NotifyWatchers + Log::Write(LogLevel_Info, notification->GetNodeId(), "Dropping Notification as ValueID does not exist"); + nit = m_notifications.begin(); + delete notification; +- val->Release(); + continue; + } + break; +diff --git a/cpp/src/command_classes/AssociationCommandConfiguration.cpp b/cpp/src/command_classes/AssociationCommandConfiguration.cpp +index 0ac07f4..7e17e3a 100644 +--- a/cpp/src/command_classes/AssociationCommandConfiguration.cpp ++++ b/cpp/src/command_classes/AssociationCommandConfiguration.cpp +@@ -204,7 +204,7 @@ bool AssociationCommandConfiguration::HandleMsg + if( Node* node = GetNodeUnsafe() ) + { + Group* group = node->GetGroup( groupIdx ); +- if( NULL == group ) ++ if( NULL != group ) + { + if( firstReports ) + { +diff --git a/cpp/src/command_classes/UserCode.cpp b/cpp/src/command_classes/UserCode.cpp +index a58091a..7f84bf5 100644 +--- a/cpp/src/command_classes/UserCode.cpp ++++ b/cpp/src/command_classes/UserCode.cpp +@@ -466,7 +466,7 @@ bool UserCode::HandleMsg + node->CreateValueString( ValueID::ValueGenre_User, GetCommandClassId(), _instance, i, str, "", false, false, data, 0 ); + } + m_userCode[i].status = UserCode_Available; +- memcpy(&m_userCode[i].usercode, 0, 10); ++ memset(&m_userCode[i].usercode, 0, 10); + } + if (m_com.GetFlagBool(COMPAT_FLAG_UC_EXPOSERAWVALUE)) { + node->CreateValueRaw( ValueID::ValueGenre_User, GetCommandClassId(), _instance, UserCodeIndex_RawValue, "Raw UserCode", "", false, false, 0, 0, 0); diff --git a/openzwave/riscv64.patch b/openzwave/riscv64.patch new file mode 100644 index 000000000..48951d86a --- /dev/null +++ b/openzwave/riscv64.patch @@ -0,0 +1,25 @@ +diff --git PKGBUILD PKGBUILD +index 1b81af1..d03ddc1 100644 +--- PKGBUILD ++++ PKGBUILD +@@ -24,10 +24,12 @@ _tag=890f24b7e88f488eee464ed14c01fbceb276cf2a + source=( + git+https://github.com/OpenZWave/open-zwave.git#tag=${_tag} + openzwave-system-libs.patch ++ fix_nullptr_mistakes.patch + ) + b2sums=( + SKIP + 56095ee16bb04184b2bf037d7601bc5431c654e1328cd1ad63f1fcb7d6918bcd65ef4ab30ee2c80f3bf3c50e838f5818d23e9d01569e41125e9e68028d021c59 ++ b743f0bcf2d86006e832779edfed67bbb024cf84321c089e66969361d1f91e80f4a2910ab9cf80f3c507405524d29868d9fa12a049115a64c315ccfa03be7e54 + ) + + pkgver() { +@@ -40,6 +42,7 @@ prepare() { + cd open-zwave + + patch -Np1 -i ../openzwave-system-libs.patch ++ patch -Np1 -i ../fix_nullptr_mistakes.patch + } + + build() {