Skip to content

Commit

Permalink
addpkg: openzwave
Browse files Browse the repository at this point in the history
  • Loading branch information
Ast-x64 committed Oct 22, 2021
1 parent f800753 commit 4f2a9a3
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 0 deletions.
70 changes: 70 additions & 0 deletions openzwave/fix_nullptr_mistakes.patch
Original file line number Diff line number Diff line change
@@ -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);
25 changes: 25 additions & 0 deletions openzwave/riscv64.patch
Original file line number Diff line number Diff line change
@@ -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() {

0 comments on commit 4f2a9a3

Please sign in to comment.