[Pkg-running-devel] [antpm] 05/20: ant: fix uninitialized members
Kristof Ralovich
ralovich-guest at moszumanska.debian.org
Sun Jun 28 12:26:49 UTC 2015
This is an automated email from the git hooks/post-receive script.
ralovich-guest pushed a commit to branch upstream
in repository antpm.
commit fa66b269891b4919150c19f09c11a04fa261fcb1
Author: RALOVICH, Kristof <tade60 at freemail.hu>
Date: Sun May 31 18:12:18 2015 +0200
ant: fix uninitialized members
---
src/AntMessage.cpp | 3 +++
src/AntMessage.hpp | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/AntMessage.cpp b/src/AntMessage.cpp
index 863948f..098a4f5 100644
--- a/src/AntMessage.cpp
+++ b/src/AntMessage.cpp
@@ -604,6 +604,9 @@ bool AntMessage::assemble(unsigned char mesg, const unsigned char *inbuf, unsign
bytes[3+i] = inbuf[i];
unsigned char chk = getCheckSum();
bytes[len+3] = chk;
+
+ sent = true;
+ idx = 0;
return true;
}
diff --git a/src/AntMessage.hpp b/src/AntMessage.hpp
index 8ff7cec..bf3ce77 100644
--- a/src/AntMessage.hpp
+++ b/src/AntMessage.hpp
@@ -374,7 +374,7 @@ struct AntMessage{
public:
- AntMessage() {}
+ AntMessage() : sent(false), idx(0) {}
AntMessage(uchar mesg, uchar data1) {uchar buf[1] = {data1}; if(!assemble(mesg, buf, sizeof(buf))) throw 0; }
AntMessage(uchar mesg, uchar data1, uchar data2) {uchar buf[2] = {data1, data2 }; if(!assemble(mesg, buf, sizeof(buf))) throw 0; }
AntMessage(uchar mesg, uchar data1, uchar data2, uchar data3) {uchar buf[3] = {data1, data2, data3 }; if(!assemble(mesg, buf, sizeof(buf))) throw 0; }
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-running/antpm.git
More information about the Pkg-running-devel
mailing list