Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
The container registry cleanup task is now completed and the registry can be used normally.
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
...
@@ -105,7 +105,7 @@ void DCDBQuery::genOutput(std::list<DCDB::SensorDataStoreReading> &results, quer
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
int64_t
prevValue
;
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
++
)
{
for
(
std
::
list
<
DCDB
::
SensorDataStoreReading
>::
iterator
reading
=
results
.
begin
();
reading
!=
results
.
end
();
reading
++
)
{
int64_t
value
=
(
*
reading
).
value
;
int64_t
value
=
(
*
reading
).
value
;
DCDB
::
TimeStamp
ts
=
(
*
reading
).
timeStamp
;
DCDB
::
TimeStamp
ts
=
(
*
reading
).
timeStamp
;
...
@@ -131,7 +131,7 @@ void DCDBQuery::genOutput(std::list<DCDB::SensorDataStoreReading> &results, quer
...
@@ -131,7 +131,7 @@ void DCDBQuery::genOutput(std::list<DCDB::SensorDataStoreReading> &results, quer
break
;
break
;
case
DCDB_OP_DELTA
:
{
case
DCDB_OP_DELTA
:
{
int64_t
result
;
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
;
std
::
cout
<<
","
<<
result
;
}
else
{
}
else
{
std
::
cout
<<
","
;
std
::
cout
<<
","
;
...
@@ -139,7 +139,7 @@ void DCDBQuery::genOutput(std::list<DCDB::SensorDataStoreReading> &results, quer
...
@@ -139,7 +139,7 @@ void DCDBQuery::genOutput(std::list<DCDB::SensorDataStoreReading> &results, quer
break
;}
break
;}
case
DCDB_OP_DELTAT
:
{
case
DCDB_OP_DELTAT
:
{
int64_t
result
;
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
;
std
::
cout
<<
","
<<
result
;
}
else
{
}
else
{
std
::
cout
<<
","
;
std
::
cout
<<
","
;
...
@@ -147,7 +147,7 @@ void DCDBQuery::genOutput(std::list<DCDB::SensorDataStoreReading> &results, quer
...
@@ -147,7 +147,7 @@ void DCDBQuery::genOutput(std::list<DCDB::SensorDataStoreReading> &results, quer
break
;}
break
;}
case
DCDB_OP_DERIVATIVE
:
{
case
DCDB_OP_DERIVATIVE
:
{
int64_t
result
;
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
;
std
::
cout
<<
","
<<
result
;
}
else
{
}
else
{
std
::
cout
<<
","
;
std
::
cout
<<
","
;
...
@@ -155,7 +155,7 @@ void DCDBQuery::genOutput(std::list<DCDB::SensorDataStoreReading> &results, quer
...
@@ -155,7 +155,7 @@ void DCDBQuery::genOutput(std::list<DCDB::SensorDataStoreReading> &results, quer
break
;}
break
;}
case
DCDB_OP_INTEGRAL
:
{
case
DCDB_OP_INTEGRAL
:
{
int64_t
result
;
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
;
std
::
cout
<<
","
<<
result
;
}
else
{
}
else
{
std
::
cout
<<
","
;
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