Commit b78c2307 authored by Michael Ott's avatar Michael Ott
Browse files

Use long unsigned int (lu) instead of llu to initialize and compare Timestamp objects

parent 2b321dfc
...@@ -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(0llu); 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 > 0llu) && (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 > 0llu) && (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 > 0llu) && 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 > 0llu) && 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 << ",";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment