Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
We have upgraded GitLab to 15.1. Due to major code changes GitLab was down for some time.
Open sidebar
dcdb
dcdb
Commits
b78c2307
Commit
b78c2307
authored
Dec 14, 2018
by
Michael Ott
Browse files
Use long unsigned int (lu) instead of llu to initialize and compare Timestamp objects
parent
2b321dfc
Changes
1
Hide whitespace changes
Inline
Side-by-side
tools/dcdbquery/query.cpp
View file @
b78c2307
...
...
@@ -105,7 +105,7 @@ void DCDBQuery::genOutput(std::list<DCDB::SensorDataStoreReading> &results, quer
std
::
cout
<<
std
::
endl
;
int64_t
prevValue
;
DCDB
::
TimeStamp
prevT
(
0l
l
u
);
DCDB
::
TimeStamp
prevT
(
0lu
);
for
(
std
::
list
<
DCDB
::
SensorDataStoreReading
>::
iterator
reading
=
results
.
begin
();
reading
!=
results
.
end
();
reading
++
)
{
int64_t
value
=
(
*
reading
).
value
;
DCDB
::
TimeStamp
ts
=
(
*
reading
).
timeStamp
;
...
...
@@ -131,7 +131,7 @@ void DCDBQuery::genOutput(std::list<DCDB::SensorDataStoreReading> &results, quer
break
;
case
DCDB_OP_DELTA
:
{
int64_t
result
;
if
((
prevT
>
0l
l
u
)
&&
(
DCDB
::
delta
(
value
,
prevValue
,
&
result
)
==
DCDB
::
DCDB_OP_SUCCESS
))
{
if
((
prevT
>
0lu
)
&&
(
DCDB
::
delta
(
value
,
prevValue
,
&
result
)
==
DCDB
::
DCDB_OP_SUCCESS
))
{
std
::
cout
<<
","
<<
result
;
}
else
{
std
::
cout
<<
","
;
...
...
@@ -139,7 +139,7 @@ void DCDBQuery::genOutput(std::list<DCDB::SensorDataStoreReading> &results, quer
break
;}
case
DCDB_OP_DELTAT
:
{
int64_t
result
;
if
((
prevT
>
0l
l
u
)
&&
(
DCDB
::
delta
(
ts
.
getRaw
(),
prevT
.
getRaw
(),
&
result
)
==
DCDB
::
DCDB_OP_SUCCESS
))
{
if
((
prevT
>
0lu
)
&&
(
DCDB
::
delta
(
ts
.
getRaw
(),
prevT
.
getRaw
(),
&
result
)
==
DCDB
::
DCDB_OP_SUCCESS
))
{
std
::
cout
<<
","
<<
result
;
}
else
{
std
::
cout
<<
","
;
...
...
@@ -147,7 +147,7 @@ void DCDBQuery::genOutput(std::list<DCDB::SensorDataStoreReading> &results, quer
break
;}
case
DCDB_OP_DERIVATIVE
:
{
int64_t
result
;
if
(
(
prevT
>
0l
l
u
)
&&
DCDB
::
derivative
(
value
,
prevValue
,
ts
.
getRaw
(),
prevT
.
getRaw
(),
&
result
)
==
DCDB
::
DCDB_OP_SUCCESS
)
{
if
(
(
prevT
>
0lu
)
&&
DCDB
::
derivative
(
value
,
prevValue
,
ts
.
getRaw
(),
prevT
.
getRaw
(),
&
result
)
==
DCDB
::
DCDB_OP_SUCCESS
)
{
std
::
cout
<<
","
<<
result
;
}
else
{
std
::
cout
<<
","
;
...
...
@@ -155,7 +155,7 @@ void DCDBQuery::genOutput(std::list<DCDB::SensorDataStoreReading> &results, quer
break
;}
case
DCDB_OP_INTEGRAL
:
{
int64_t
result
;
if
(
(
prevT
>
0l
l
u
)
&&
DCDB
::
integral
(
value
,
prevValue
,
ts
.
getRaw
(),
prevT
.
getRaw
(),
&
result
)
==
DCDB
::
DCDB_OP_SUCCESS
)
{
if
(
(
prevT
>
0lu
)
&&
DCDB
::
integral
(
value
,
prevValue
,
ts
.
getRaw
(),
prevT
.
getRaw
(),
&
result
)
==
DCDB
::
DCDB_OP_SUCCESS
)
{
std
::
cout
<<
","
<<
result
;
}
else
{
std
::
cout
<<
","
;
...
...
Write
Preview
Supports
Markdown
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