Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
dcdb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
dcdb
dcdb
Commits
ea5162ee
Commit
ea5162ee
authored
Feb 27, 2019
by
Alessio Netti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compiler warning fixes
parent
a7f9b57c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
CollectAgent/sensorcache.cpp
CollectAgent/sensorcache.cpp
+4
-4
CollectAgent/simplemqttserverthread.cpp
CollectAgent/simplemqttserverthread.cpp
+2
-2
CollectAgent/simplemqttserverthread.h
CollectAgent/simplemqttserverthread.h
+1
-1
No files found.
CollectAgent/sensorcache.cpp
View file @
ea5162ee
...
...
@@ -198,7 +198,7 @@ bool CacheEntry::checkValid() {
if
(
_cache
.
size
()
>
2
)
{
TimeStamp
ts
;
// Cache element right after cacheIndex is the oldest entry (circular array)
u
int64_t
ctr
=
(
_cacheIndex
+
1
)
%
_cache
.
size
();
int64_t
ctr
=
(
_cacheIndex
+
1
)
%
_cache
.
size
();
uint64_t
prev
=
_cache
[
ctr
].
timestamp
;
// We compute the average sampling period for this specific sensor
uint64_t
avg
=
0
;
...
...
@@ -230,7 +230,7 @@ int64_t CacheEntry::getAverage(uint64_t avg) {
}
double
sum
=
0
;
u
int64_t
it
,
prev
;
int64_t
it
,
prev
;
prev
=
_cacheIndex
;
it
=
older
(
prev
);
// We compute the weighted average of elements in the cache that fall within the specified window
...
...
@@ -286,8 +286,8 @@ int64_t CacheEntry::getOffset(int64_t t) {
if
(
!
_stable
||
t
<
0
)
return
-
1
;
else
{
int64_t
offset
=
(
(
_cache
.
size
()
*
t
)
/
(
getLatest
().
timestamp
-
getOldest
().
timestamp
)
);
//- 1;
if
(
offset
>
_cache
.
size
())
int64_t
offset
=
(
(
(
int64_t
)
_cache
.
size
()
*
t
)
/
(
getLatest
().
timestamp
-
getOldest
().
timestamp
)
);
//- 1;
if
(
offset
>
(
int64_t
)
_cache
.
size
())
return
-
1
;
return
(
_cache
.
size
()
+
_cacheIndex
-
offset
)
%
_cache
.
size
();
}
...
...
CollectAgent/simplemqttserverthread.cpp
View file @
ea5162ee
...
...
@@ -333,7 +333,7 @@ void SimpleMQTTServerMessageThread::run()
* Apparently, there is work to do...
*/
if
(
numfds
>
0
)
{
for
(
int
connectionId
=
0
;
connectionId
<
this
->
_maxConnPerThread
;
connectionId
++
)
{
for
(
unsigned
connectionId
=
0
;
connectionId
<
this
->
_maxConnPerThread
;
connectionId
++
)
{
if
(
fds
[
connectionId
].
fd
!=
-
1
)
{
#ifdef SimpleMQTTVerbose
coutMtx
.
lock
();
...
...
@@ -486,7 +486,7 @@ void SimpleMQTTServerMessageThread::assignConnections()
return
;
}
for
(
int
i
=
0
;
i
<
this
->
_maxConnPerThread
;
i
++
)
{
for
(
unsigned
i
=
0
;
i
<
this
->
_maxConnPerThread
;
i
++
)
{
if
(
fds
[
i
].
fd
==
-
1
)
{
fds
[
i
].
events
=
POLLIN
|
POLLPRI
|
POLLHUP
;
fds
[
i
].
revents
=
0
;
...
...
CollectAgent/simplemqttserverthread.h
View file @
ea5162ee
...
...
@@ -54,7 +54,7 @@ class SimpleMQTTServerMessageThread : SimpleMQTTServerThread
{
protected:
uint64_t
_maxConnPerThread
;
int
numConnections
;
unsigned
numConnections
;
struct
pollfd
*
fds
;
SimpleMQTTMessage
**
msg
;
int
*
fdQueue
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment