Skip to content

Commit

Permalink
Use nullptr instead of 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
dok-net committed May 2, 2019
1 parent b669f6f commit f8f19b4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Sds011.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ class Sds011Async_Base : public Sds011 {
}
if (query_data_auto_collected >= query_data_auto_n) {
if (query_data_auto_handler) query_data_auto_handler(query_data_auto_collected);
query_data_auto_handler = 0;
query_data_auto_handler = nullptr;
query_data_auto_state = QDA_OFF;
query_data_auto_pm25_ptr = 0;
query_data_auto_pm10_ptr = 0;
onReceive(0);
onReceive(nullptr);
}
});
});
Expand All @@ -190,15 +190,15 @@ class Sds011Async_Base : public Sds011 {
if (QDA_COLLECTING == query_data_auto_state &&
static_cast<int32_t>(millis() - query_data_auto_deadline) > 0) {
if (query_data_auto_handler) query_data_auto_handler(query_data_auto_collected);
query_data_auto_handler = 0;
query_data_auto_handler = nullptr;
query_data_auto_state = QDA_OFF;
query_data_auto_pm25_ptr = 0;
query_data_auto_pm10_ptr = 0;
onReceive(0);
onReceive(nullptr);
}
}

std::function<void(int n)> query_data_auto_handler = 0;
std::function<void(int n)> query_data_auto_handler;

enum QueryDataAutoState { QDA_OFF, QDA_WAITCOLLECT, QDA_RAMPUP, QDA_COLLECTING };
QueryDataAutoState query_data_auto_state = QDA_OFF;
Expand Down Expand Up @@ -246,7 +246,7 @@ template<> class Sds011Async<HardwareSerial> : public Sds011Async_Base {
receiveHandler = handler;
}

std::function<void(int available)> receiveHandler = 0;
std::function<void(int available)> receiveHandler;
};

#endif

0 comments on commit f8f19b4

Please sign in to comment.