diff --git a/owlps-positioner/area.hh b/owlps-positioner/area.hh index 0ba78b0..441f182 100644 --- a/owlps-positioner/area.hh +++ b/owlps-positioner/area.hh @@ -35,7 +35,7 @@ protected: void reorder_coordinates(void) ; public: - Area(const Building *const _building = NULL, + Area(const Building *const _building = nullptr, const std::string &_name = "Unnamed area", const Point3D &p1 = Point3D(0,0,0), const Point3D &p2 = Point3D(0,0,0)) ; diff --git a/owlps-positioner/autocalibrationline.cc b/owlps-positioner/autocalibrationline.cc index 77703ea..9c938e5 100644 --- a/owlps-positioner/autocalibrationline.cc +++ b/owlps-positioner/autocalibrationline.cc @@ -33,14 +33,14 @@ using namespace std ; /** * @param _point The coordinates of the reference point to generate. * @param _cp1 The first capture point (receiver) to use the measurements - * of to generate the reference points; it cannot be NULL. + * of to generate the reference points; it cannot be null. * @param _cp2 The second receiver capture point (optional). */ AutocalibrationLine::AutocalibrationLine( const Point3D &_point, const CapturePoint *const _cp1, const CapturePoint *const _cp2): Autocalibration(_point), cp1(_cp1), cp2(_cp2), - trx_cp(NULL), trx_rp(NULL) + trx_cp(nullptr), trx_rp(nullptr) { assert(cp1) ; } @@ -120,7 +120,7 @@ void AutocalibrationLine::sort_reference_cps() Stock::get_reference_point(ref->second.get_coordinates()) ; const vector &ref_cr = ref_rp.get_requests() ; /* Search for the first measurement made by RX in ref_rp */ - const Measurement *rx_measurement = NULL ; + const Measurement *rx_measurement = nullptr ; const string &rx_mac = rx->second.get_mac_addr() ; for (auto cr = ref_cr.begin() ; cr != ref_cr.end() ; ++cr) { @@ -153,7 +153,7 @@ void AutocalibrationLine::compute_multi_packet_ss() const vector &ref_cr = trx_rp->get_requests() ; /* Search for the first measurement made by RX in trx_rp */ - const Measurement *rx_measurement = NULL ; + const Measurement *rx_measurement = nullptr ; vector::const_iterator cr ; const string &rx_mac = rx->second.get_mac_addr() ; for (cr = ref_cr.begin() ; cr != ref_cr.end() ; ++cr) diff --git a/owlps-positioner/autocalibrationline.hh b/owlps-positioner/autocalibrationline.hh index d8154a3..10b66c5 100644 --- a/owlps-positioner/autocalibrationline.hh +++ b/owlps-positioner/autocalibrationline.hh @@ -49,7 +49,7 @@ protected: public: AutocalibrationLine(const Point3D &_point, const CapturePoint *const _cp1, - const CapturePoint *const _cp2 = NULL) ; + const CapturePoint *const _cp2 = nullptr) ; } ; #endif // _OWLPS_POSITIONING_AUTOCALIBRATIONLINE_HH_ diff --git a/owlps-positioner/autocalibrationmesh.cc b/owlps-positioner/autocalibrationmesh.cc index d3043da..7b299a5 100644 --- a/owlps-positioner/autocalibrationmesh.cc +++ b/owlps-positioner/autocalibrationmesh.cc @@ -187,7 +187,7 @@ void AutocalibrationMesh::compute_multi_packet_ss() const vector &ref1_cr = ref1_rp.get_requests() ; /* Search for the first measurement made by RX in ref1_rp */ - const Measurement *rx_measurement = NULL ; + const Measurement *rx_measurement = nullptr ; vector::const_iterator cr ; const string &rx_mac = rx->second.get_mac_addr() ; for (cr = ref1_cr.begin() ; cr != ref1_cr.end() ; ++cr) diff --git a/owlps-positioner/building.cc b/owlps-positioner/building.cc index bf45b88..ca3ec90 100644 --- a/owlps-positioner/building.cc +++ b/owlps-positioner/building.cc @@ -50,7 +50,7 @@ Building::~Building() /** - * If `area` is NULL, nothing is done. + * If `area` is null, nothing is done. * If `area` is a pointer to an Area that is already stored in #areas, * nothing is done. * If `area` has the same name as (but is not identical to) an Area that diff --git a/owlps-positioner/building.hh b/owlps-positioner/building.hh index 8d4b354..b8051d8 100644 --- a/owlps-positioner/building.hh +++ b/owlps-positioner/building.hh @@ -107,7 +107,7 @@ inline void Building::set_name(const std::string &_name) /** - * @param wp A pointer to the Waypoint to add. If `wp` is NULL, + * @param wp A pointer to the Waypoint to add. If `wp` is null, * nothing will be added. */ inline void Building::add_waypoint(Waypoint *const wp) diff --git a/owlps-positioner/calibrationrequest.cc b/owlps-positioner/calibrationrequest.cc index 5683202..d34ac6a 100644 --- a/owlps-positioner/calibrationrequest.cc +++ b/owlps-positioner/calibrationrequest.cc @@ -20,7 +20,7 @@ CalibrationRequest::CalibrationRequest(const uint_fast8_t _type): - reference_point(NULL), direction(Direction()) + reference_point(nullptr), direction(Direction()) { type = _type ; } @@ -57,7 +57,7 @@ void CalibrationRequest::reference_point_backward_link() const void CalibrationRequest::clear() { Request::clear() ; - reference_point = NULL ; + reference_point = nullptr ; direction.clear() ; } diff --git a/owlps-positioner/calibrationrequest.hh b/owlps-positioner/calibrationrequest.hh index b877b44..3e74c7a 100644 --- a/owlps-positioner/calibrationrequest.hh +++ b/owlps-positioner/calibrationrequest.hh @@ -37,7 +37,7 @@ public: direction(source.direction) {} CalibrationRequest(const Request &source, - ReferencePoint *const _reference_point = NULL, + ReferencePoint *const _reference_point = nullptr, const Direction &_direction = Direction(), const uint_fast8_t _type = OWL_REQUEST_AUTOCALIBRATION) ; diff --git a/owlps-positioner/csvstringreader.cc b/owlps-positioner/csvstringreader.cc index e577701..0a49a87 100644 --- a/owlps-positioner/csvstringreader.cc +++ b/owlps-positioner/csvstringreader.cc @@ -30,7 +30,7 @@ using boost::bad_lexical_cast ; CSVStringReader:: CSVStringReader(const std::string &_str, const char _separator): - separator(_separator), current_token(NULL), current_field_nb(0) + separator(_separator), current_token(nullptr), current_field_nb(0) { set_str(_str) ; } diff --git a/owlps-positioner/csvstringreader.hh b/owlps-positioner/csvstringreader.hh index dde8358..8ac084e 100644 --- a/owlps-positioner/csvstringreader.hh +++ b/owlps-positioner/csvstringreader.hh @@ -39,7 +39,7 @@ protected: public: CSVStringReader(const char _separator = ';'): - separator(_separator), current_token(NULL), current_field_nb(0) {} + separator(_separator), current_token(nullptr), current_field_nb(0) {} CSVStringReader(const std::string &_str, const char _separator = ';') ; diff --git a/owlps-positioner/frbhmbasic.hh b/owlps-positioner/frbhmbasic.hh index 5f2e915..e2eeb47 100644 --- a/owlps-positioner/frbhmbasic.hh +++ b/owlps-positioner/frbhmbasic.hh @@ -28,7 +28,7 @@ protected: public: FRBHMBasic(void): - PositioningAlgorithm("FRBHMBasic"), closest_in_ss(NULL) {} + PositioningAlgorithm("FRBHMBasic"), closest_in_ss(nullptr) {} ~FRBHMBasic(void) {} /** @name Operations */ diff --git a/owlps-positioner/input.cc b/owlps-positioner/input.cc index 9cb20aa..12e11d7 100644 --- a/owlps-positioner/input.cc +++ b/owlps-positioner/input.cc @@ -32,7 +32,7 @@ using namespace std ; Input::Input(): - medium(NULL) + medium(nullptr) { initialise_input_medium() ; initialise_log_media() ; diff --git a/owlps-positioner/inputmedium.cc b/owlps-positioner/inputmedium.cc index b1e8a59..5c07294 100644 --- a/owlps-positioner/inputmedium.cc +++ b/owlps-positioner/inputmedium.cc @@ -78,7 +78,7 @@ void InputMedium::clear_current_request() else { delete current_request ; - current_request = NULL ; + current_request = nullptr ; current_request = new Request() ; } } @@ -174,7 +174,7 @@ void InputMedium::current_request_to_calibration_request( } Request *tmp = current_request ; - current_request = NULL ; + current_request = nullptr ; current_request = new CalibrationRequest(*tmp, const_cast(reference_point), diff --git a/owlps-positioner/inputudpsocket.cc b/owlps-positioner/inputudpsocket.cc index 2621122..d2bd28e 100644 --- a/owlps-positioner/inputudpsocket.cc +++ b/owlps-positioner/inputudpsocket.cc @@ -101,7 +101,7 @@ bool InputUDPSocket::fill_current_request() // Read the main request data owl_request request ; ssize_t nread = recvfrom(sockfd, &request, sizeof(request), 0, - NULL, NULL) ; + nullptr, nullptr) ; if (nread <= 0) { cerr << "InputUDPSocket: No request received!" << endl ; @@ -181,7 +181,7 @@ bool InputUDPSocket::fill_current_request() for (int i = 0 ; i < request.nb_info ; ++i) { nread = recvfrom(sockfd, &request_info, sizeof(request_info), 0, - NULL, NULL) ; + nullptr, nullptr) ; if (nread <= 0) { cerr << "No request info received!" << endl ; diff --git a/owlps-positioner/measurement.cc b/owlps-positioner/measurement.cc index e651f80..9f9a4e0 100644 --- a/owlps-positioner/measurement.cc +++ b/owlps-positioner/measurement.cc @@ -115,7 +115,7 @@ void Measurement::merge(const Measurement &source) /** - * - #cp is not deleted, only initialised to NULL. + * - #cp is not deleted, only initialised to nullptr. * - #ss_list is cleared. * - average and variance variables are reset to 0. */ @@ -129,7 +129,7 @@ void Measurement::clear() variance_mw_m2 = 0 ; variance_dbm_m2 = 0 ; variance_size = 0 ; - cp = NULL ; + cp = nullptr ; } diff --git a/owlps-positioner/measurement.hh b/owlps-positioner/measurement.hh index 8f7446f..731b11f 100644 --- a/owlps-positioner/measurement.hh +++ b/owlps-positioner/measurement.hh @@ -65,7 +65,7 @@ protected: public: - Measurement(const CapturePoint *const _cp = NULL): + Measurement(const CapturePoint *const _cp = nullptr): cp(_cp), average_dbm(0), average_mw(0), variance_mw(0), variance_dbm(0), variance_mw_m2(0), variance_dbm_m2(0), variance_size(0) {} diff --git a/owlps-positioner/owlps-positionerd.cc b/owlps-positioner/owlps-positionerd.cc index fee0bb3..c79b68f 100644 --- a/owlps-positioner/owlps-positionerd.cc +++ b/owlps-positioner/owlps-positionerd.cc @@ -49,9 +49,9 @@ int main(const int argc, const char **const argv) action.sa_flags = 0 ; sigemptyset(&action.sa_mask) ; action.sa_handler = owl_sigint_handler ; - sigaction(SIGINT, &action, NULL) ; + sigaction(SIGINT, &action, nullptr) ; action.sa_handler = owl_sigterm_handler ; - sigaction(SIGTERM, &action, NULL) ; + sigaction(SIGTERM, &action, nullptr) ; /* Run! */ Positioning positioning ; diff --git a/owlps-positioner/realposition.cc b/owlps-positioner/realposition.cc index 737d825..fe649b2 100644 --- a/owlps-positioner/realposition.cc +++ b/owlps-positioner/realposition.cc @@ -20,7 +20,7 @@ Result RealPosition::compute(const Request &request) { - const Point3D *coordinates = NULL ; + const Point3D *coordinates = nullptr ; const CalibrationRequest *calibration_request = dynamic_cast(&request) ; diff --git a/owlps-positioner/referencepoint.hh b/owlps-positioner/referencepoint.hh index c7df183..e3030eb 100644 --- a/owlps-positioner/referencepoint.hh +++ b/owlps-positioner/referencepoint.hh @@ -124,7 +124,7 @@ std::vector& ReferencePoint::get_requests() const /** * @param r A pointer to the CalibrationRequest to add. If it is - * NULL, nothing will be done. + * null, nothing will be done. * The memory pointed by this pointer must not be deallocated before * the ReferencePoint destruction (do *not* pass a pointer to a local * variable!). diff --git a/owlps-positioner/request.cc b/owlps-positioner/request.cc index a08c3c1..68ff215 100644 --- a/owlps-positioner/request.cc +++ b/owlps-positioner/request.cc @@ -32,7 +32,7 @@ Request::Request( ): type(OWL_REQUEST_UNDEFINED), nb_packets(1), mobile(_mobile), time_sent(_time_sent), - measurements(_measurements), real_position(NULL) + measurements(_measurements), real_position(nullptr) { received_now() ; } @@ -41,7 +41,7 @@ Request::Request( Request::Request(const unordered_map &_measurements): type(OWL_REQUEST_UNDEFINED), nb_packets(1), - mobile(NULL), measurements(_measurements), real_position(NULL) + mobile(nullptr), measurements(_measurements), real_position(nullptr) { received_now() ; } @@ -52,8 +52,8 @@ Request::Request( const unordered_map &_measurements ): type(OWL_REQUEST_UNDEFINED), nb_packets(1), - mobile(NULL), time_sent(_time_sent), - measurements(_measurements), real_position(NULL) + mobile(nullptr), time_sent(_time_sent), + measurements(_measurements), real_position(nullptr) { received_now() ; } @@ -63,7 +63,7 @@ Request::Request(const Request &source): type(source.type), nb_packets(source.nb_packets), mobile(source.mobile), time_sent(source.time_sent), time_received(source.time_received), - measurements(source.measurements), real_position(NULL) + measurements(source.measurements), real_position(nullptr) { if (source.real_position) real_position = new Point3D(*source.real_position) ; @@ -86,7 +86,7 @@ Request::~Request() /** * @param mac_receiver The MAC address of the receiver CP. - * @returns A pointer on the found measurement, or NULL if no + * @returns A pointer on the found measurement, or nullptr if no * measurement was made by this CP. */ const Measurement* @@ -95,7 +95,7 @@ Request::get_measurement(const string &mac_receiver) const auto m = measurements.find(mac_receiver) ; if (m != measurements.end()) return &m->second ; - return NULL ; + return nullptr ; } @@ -108,7 +108,7 @@ inline void Request::clear_real_position() if (real_position) { delete real_position ; - real_position = NULL ; + real_position = nullptr ; } } @@ -125,7 +125,8 @@ void Request::set_real_position(const Point3D &_real_position) /** * - #nb_packets is set to 1 (this is the default value when * constructing a Request). - * - #mobile is NULLified, but the value it pointed to is not deleted. + * - #mobile is set to nullptr, but the value it pointed to is not + * deleted. * - The fields of #time_sent and #time_received are initialised to 0. * - #measurements is cleared. */ @@ -133,7 +134,7 @@ void Request::clear() { type = OWL_REQUEST_UNDEFINED ; nb_packets = 1 ; - mobile = NULL ; + mobile = nullptr ; time_sent.clear() ; time_received.clear() ; measurements.clear() ; @@ -195,7 +196,7 @@ bool Request::operator==(const Request &source) const else if (real_position && source.real_position) real_position_equal = *real_position == *source.real_position ; else - real_position_equal = false ; // one of the two is NULL + real_position_equal = false ; // one of the two is null return real_position_equal && diff --git a/owlps-positioner/request.hh b/owlps-positioner/request.hh index 02002b5..d1ab7b8 100644 --- a/owlps-positioner/request.hh +++ b/owlps-positioner/request.hh @@ -66,7 +66,7 @@ protected: using measurements_list = std::unordered_map ; public: - Request(const Mobile *const _mobile = NULL, + Request(const Mobile *const _mobile = nullptr, const Timestamp &_time_sent = Timestamp(), const std::unordered_map &_measurements = measurements_list()) ; diff --git a/owlps-positioner/result.hh b/owlps-positioner/result.hh index 626a64f..79bcd23 100644 --- a/owlps-positioner/result.hh +++ b/owlps-positioner/result.hh @@ -36,7 +36,7 @@ protected: float error ; public: - Result(const Request *const _request = NULL, + Result(const Request *const _request = nullptr, const std::string &_algorithm = "UnknownAlgorithm"): request(_request), algorithm(_algorithm), error(-1) {} Result(const Request *const _request, const std::string &_algorithm, diff --git a/owlps-positioner/resultlist.hh b/owlps-positioner/resultlist.hh index 31e7ec0..ed7ca35 100644 --- a/owlps-positioner/resultlist.hh +++ b/owlps-positioner/resultlist.hh @@ -30,7 +30,7 @@ protected: std::vector results ; public: - ResultList(const Request *const _request = NULL, + ResultList(const Request *const _request = nullptr, const std::vector &_results = std::vector()): request(_request), results(_results) {} ResultList(const ResultList &source): diff --git a/owlps-positioner/stock.cc b/owlps-positioner/stock.cc index be4fcff..d6c649d 100644 --- a/owlps-positioner/stock.cc +++ b/owlps-positioner/stock.cc @@ -94,7 +94,7 @@ const Building& Stock::get_building(const string &name) /** * @returns A pointer to the first Area in which `point` was found. - * @returns NULL if `point` does not belong to any Area. + * @returns nullptr if `point` does not belong to any Area. */ const Area* Stock::in_which_area_is(const Point3D &point) { @@ -107,7 +107,7 @@ const Area* Stock::in_which_area_is(const Point3D &point) return a->second ; } - return NULL ; + return nullptr ; } @@ -323,7 +323,7 @@ double Stock::cp_matrix_get_ss(const std::string &mac_transmitter, /** * @returns A const pointer to the CP `coord` is the coordinates of. - * @returns NULL if `coord` is not the coordinates of any CP. + * @returns nullptr if `coord` is not the coordinates of any CP. */ const CapturePoint* Stock::is_cp_coordinate(const Point3D &coord) { @@ -331,7 +331,7 @@ const CapturePoint* Stock::is_cp_coordinate(const Point3D &coord) if (cp->second.get_coordinates() == coord) return &cp->second ; - return NULL ; + return nullptr ; } @@ -497,7 +497,7 @@ void Stock::generate_reference_points_line() CSVStringReader path_parser(path_csv) ; Point3D p ; vector read_points ; - const CapturePoint *cp1 = NULL ; + const CapturePoint *cp1 = nullptr ; // Read points until the first CP coordinate while (path_parser.read_point3d(p)) @@ -533,7 +533,7 @@ void Stock::generate_reference_points_line() } // Read the next points and generate the RPs - const CapturePoint *cp2 = NULL ; + const CapturePoint *cp2 = nullptr ; while (path_parser.read_point3d(p)) { cp2 = Stock::is_cp_coordinate(p) ; @@ -566,7 +566,7 @@ void Stock::generate_reference_points_line() } cp1 = cp2 ; - cp2 = NULL ; + cp2 = nullptr ; } // Generate the last RPs (after the last RP) diff --git a/owlps-positioner/stock.hh b/owlps-positioner/stock.hh index 42e129b..8c1a9bb 100644 --- a/owlps-positioner/stock.hh +++ b/owlps-positioner/stock.hh @@ -73,7 +73,7 @@ private: static void generate_interpolated_reference_points( const Point3D &start, const Point3D &end, const CapturePoint *const cp1, - const CapturePoint *const cp2 = NULL) ; + const CapturePoint *const cp2 = nullptr) ; /// Generates reference points according to a list static void generate_reference_points_list(void) ; /// Generates a single reference point diff --git a/owlps-positioner/tests/area_test.hh b/owlps-positioner/tests/area_test.hh index f332794..c301f87 100644 --- a/owlps-positioner/tests/area_test.hh +++ b/owlps-positioner/tests/area_test.hh @@ -24,7 +24,7 @@ public: { // Default constructor Area a1 ; - Area a2(NULL, "Unnamed area", Point3D(0,0,0), Point3D(0,0,0)) ; + Area a2(nullptr, "Unnamed area", Point3D(0,0,0), Point3D(0,0,0)) ; TS_ASSERT_EQUALS(a1, a2) ; // Copy constructor diff --git a/owlps-positioner/tests/measurement_test.hh b/owlps-positioner/tests/measurement_test.hh index bf4c355..752b068 100644 --- a/owlps-positioner/tests/measurement_test.hh +++ b/owlps-positioner/tests/measurement_test.hh @@ -24,7 +24,7 @@ public: // Default constructor Measurement m00 ; std::map vi1 ; - Measurement m01(NULL) ; + Measurement m01(nullptr) ; m01.add_ss_list(vi1) ; TS_ASSERT_EQUALS(m00, m01) ; diff --git a/owlps-positioner/tests/result_test.hh b/owlps-positioner/tests/result_test.hh index 2c4fe31..1e68f7f 100644 --- a/owlps-positioner/tests/result_test.hh +++ b/owlps-positioner/tests/result_test.hh @@ -24,8 +24,8 @@ public: { // Default constructor Result result1 ; - Result result2(NULL) ; - Result result3(NULL, "UnknownAlgorithm") ; + Result result2(nullptr) ; + Result result3(nullptr, "UnknownAlgorithm") ; TS_ASSERT_EQUALS(result1, result2) ; TS_ASSERT_EQUALS(result1, result3) ; diff --git a/owlps-positioner/tests/textfilereader_test.hh b/owlps-positioner/tests/textfilereader_test.hh index 5026c3f..1996ce5 100644 --- a/owlps-positioner/tests/textfilereader_test.hh +++ b/owlps-positioner/tests/textfilereader_test.hh @@ -54,7 +54,7 @@ public: output_file.close() ; std::string line ; - TextFileReader *textfilereader = NULL ; + TextFileReader *textfilereader = nullptr ; TS_ASSERT_THROWS_NOTHING( textfilereader = new TextFileReader(test_file_name)) ; TS_ASSERT(textfilereader->read_line(line)) ; diff --git a/owlps-positioner/tests/textfilewriter_test.hh b/owlps-positioner/tests/textfilewriter_test.hh index 83af274..45855b1 100644 --- a/owlps-positioner/tests/textfilewriter_test.hh +++ b/owlps-positioner/tests/textfilewriter_test.hh @@ -48,7 +48,7 @@ public: void test_textfilewriter(void) { - TextFileWriter *textfilewriter = NULL ; + TextFileWriter *textfilewriter = nullptr ; TS_ASSERT_THROWS_NOTHING( textfilewriter = new TextFileWriter(test_file_name)) ; TS_ASSERT(textfilewriter->write_text("Hello\nWorld\n")) ; diff --git a/owlps-positioner/tests/topologyreadercsv_test.hh b/owlps-positioner/tests/topologyreadercsv_test.hh index 972e37f..75bfcba 100644 --- a/owlps-positioner/tests/topologyreadercsv_test.hh +++ b/owlps-positioner/tests/topologyreadercsv_test.hh @@ -73,11 +73,11 @@ public: void test_areas(void) { - Building *building1 = NULL ; + Building *building1 = nullptr ; TS_ASSERT_THROWS_NOTHING( building1 = const_cast( &Stock::get_building("My building"))) ; - Building *building2 = NULL ; + Building *building2 = nullptr ; TS_ASSERT_THROWS_NOTHING( building2 = const_cast( &Stock::get_building("Building #2"))) ; @@ -107,11 +107,11 @@ public: void test_waypoints(void) { - Building *building1 = NULL ; + Building *building1 = nullptr ; TS_ASSERT_THROWS_NOTHING( building1 = const_cast( &Stock::get_building("My building"))) ; - Building *building2 = NULL ; + Building *building2 = nullptr ; TS_ASSERT_THROWS_NOTHING( building2 = const_cast( &Stock::get_building("Building #2"))) ; diff --git a/owlps-positioner/tests/waypoint_test.hh b/owlps-positioner/tests/waypoint_test.hh index 5a3f890..f430847 100644 --- a/owlps-positioner/tests/waypoint_test.hh +++ b/owlps-positioner/tests/waypoint_test.hh @@ -24,7 +24,7 @@ public: { // Default constructor Waypoint wp00 ; - Waypoint wp01(NULL, 0, 0, 0) ; + Waypoint wp01(nullptr, 0, 0, 0) ; TS_ASSERT_EQUALS(wp00, wp01) ; // Copy constructor @@ -37,7 +37,7 @@ public: Point3D p0(5, 3, 8) ; Waypoint wp4(p0) ; TS_ASSERT_EQUALS(p0, wp4) ; - Waypoint wp5(NULL, p0) ; + Waypoint wp5(nullptr, p0) ; TS_ASSERT_EQUALS(wp4, wp5) ; // 3-float array constructor @@ -76,12 +76,12 @@ public: void test_operators(void) { // == - Waypoint wp1(NULL, 42, 21, 19) ; - Waypoint wp2(NULL, 42, 21, 19) ; + Waypoint wp1(nullptr, 42, 21, 19) ; + Waypoint wp2(nullptr, 42, 21, 19) ; TS_ASSERT_EQUALS(wp1, wp2) ; // != - Waypoint wp3(NULL, 1, 4, 7) ; + Waypoint wp3(nullptr, 1, 4, 7) ; TS_ASSERT(wp1 != wp3) ; // = diff --git a/owlps-positioner/trilaterationalgorithm.cc b/owlps-positioner/trilaterationalgorithm.cc index 51afea7..157618a 100644 --- a/owlps-positioner/trilaterationalgorithm.cc +++ b/owlps-positioner/trilaterationalgorithm.cc @@ -26,7 +26,7 @@ using namespace std ; TrilaterationAlgorithm::TrilaterationAlgorithm(): - request(NULL) + request(nullptr) { // Will be changed when other trilateration methods will be // implemented. diff --git a/owlps-positioner/waypoint.cc b/owlps-positioner/waypoint.cc index 97bd383..3584ce1 100644 --- a/owlps-positioner/waypoint.cc +++ b/owlps-positioner/waypoint.cc @@ -26,7 +26,7 @@ using namespace std ; /** * @param _b A pointer to the (first) Building to add to #buildings. - * If it is NULL, #buildings will remain empty. + * If it is null, #buildings will remain empty. * @param _x X coordinate. * @param _y Y coordinate. * @param _z Z coordinate. @@ -42,7 +42,7 @@ Waypoint::Waypoint(Building *const _b, /** * @param _b A pointer to the (first) Building to add to #buildings. - * If it is NULL, #buildings will remain empty. + * If it is null, #buildings will remain empty. * @param p Coordinates of the Waypoint. */ Waypoint::Waypoint(Building *const _b, const Point3D &p): Point3D(p) diff --git a/owlps-positioner/waypoint.hh b/owlps-positioner/waypoint.hh index 640d902..5b62620 100644 --- a/owlps-positioner/waypoint.hh +++ b/owlps-positioner/waypoint.hh @@ -37,7 +37,7 @@ protected: std::unordered_set buildings ; public: - Waypoint(Building *const _b = NULL, const float _x = 0, + Waypoint(Building *const _b = nullptr, const float _x = 0, const float _y = 0, const float _z = 0) ; Waypoint(Building *const _b, const Point3D &p) ; @@ -84,13 +84,13 @@ public: /** * @returns A pointer to the first Building associated with the Waypoint - * (i.e. the first element of #buildings). If #buildings is empty, NULL - * is returned. + * (i.e. the first element of #buildings). If #buildings is empty, + * nullptr is returned. */ inline Building* Waypoint::get_1st_building() const { if (buildings.empty()) - return NULL ; + return nullptr ; return *buildings.begin() ; } @@ -107,8 +107,8 @@ Waypoint::get_buildings() const /** - * @param _b A pointer to the Building to add. If it is - * NULL, nothing will be done. + * @param _b A pointer to the Building to add. If it is null, nothing + * will be done. * The memory pointed by this pointer must not be deallocated before * the Waypoint destruction (do *not* pass a pointer to a local * variable!).