From: Joel Holdsworth Date: Sun, 12 Apr 2015 14:54:29 +0000 (+0100) Subject: Replaced NULL with nullptr X-Git-Tag: pulseview-0.3.0~197 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=4c60462b00cc329e61daedd1c2e66724077bd412;p=pulseview.git Replaced NULL with nullptr --- diff --git a/HACKING b/HACKING index d1edc871..17183ed1 100644 --- a/HACKING +++ b/HACKING @@ -38,7 +38,7 @@ Random notes glib's g_try_malloc()/g_try_malloc0() was used, use g_free() to free the memory. Otherwise use standard free(). Never use the wrong function! - - Never use g_malloc() or g_malloc0(). These functions do not return NULL + - Never use g_malloc() or g_malloc0(). These functions do not return nullptr if not enough memory is available but rather lead to an exit() or segfault instead. This behaviour is not acceptable. Use g_try_malloc()/g_try_malloc0() instead and check the return value. diff --git a/android/loghandler.cpp b/android/loghandler.cpp index 0b99b049..2c6674cd 100644 --- a/android/loghandler.cpp +++ b/android/loghandler.cpp @@ -94,9 +94,9 @@ int AndroidLogHandler::srd_callback(void *cb_data, int loglevel, const char *for void AndroidLogHandler::install_callbacks() { - sr_log_callback_set(sr_callback, NULL); + sr_log_callback_set(sr_callback, nullptr); #ifdef ENABLE_DECODE - srd_log_callback_set(srd_callback, NULL); + srd_log_callback_set(srd_callback, nullptr); #endif } diff --git a/main.cpp b/main.cpp index 089deee7..285c1535 100644 --- a/main.cpp +++ b/main.cpp @@ -87,7 +87,7 @@ int main(int argc, char *argv[]) }; const int c = getopt_long(argc, argv, - "l:Vh?", long_options, NULL); + "l:Vh?", long_options, nullptr); if (c == -1) break; @@ -129,7 +129,7 @@ int main(int argc, char *argv[]) #ifdef ENABLE_DECODE // Initialise libsigrokdecode - if (srd_init(NULL) != SRD_OK) { + if (srd_init(nullptr) != SRD_OK) { qDebug() << "ERROR: libsigrokdecode init failed."; break; } diff --git a/pv/binding/decoder.cpp b/pv/binding/decoder.cpp index dd571602..28cc30d6 100644 --- a/pv/binding/decoder.cpp +++ b/pv/binding/decoder.cpp @@ -106,7 +106,7 @@ shared_ptr Decoder::bind_enum( Glib::VariantBase Decoder::getter(const char *id) { - GVariant *val = NULL; + GVariant *val = nullptr; assert(decoder_); diff --git a/pv/data/decode/decoder.cpp b/pv/data/decode/decoder.cpp index 35840909..018051df 100644 --- a/pv/data/decode/decoder.cpp +++ b/pv/data/decode/decoder.cpp @@ -129,7 +129,7 @@ srd_decoder_inst* Decoder::create_decoder_inst(srd_session *session, int unit_si g_hash_table_destroy(opt_hash); if(!decoder_inst) - return NULL; + return nullptr; // Setup the channels GHashTable *const channels = g_hash_table_new_full(g_str_hash, diff --git a/pv/data/decode/row.cpp b/pv/data/decode/row.cpp index e36051c3..70a06093 100644 --- a/pv/data/decode/row.cpp +++ b/pv/data/decode/row.cpp @@ -27,8 +27,8 @@ namespace data { namespace decode { Row::Row() : - decoder_(NULL), - row_(NULL) + decoder_(nullptr), + row_(nullptr) { } diff --git a/pv/data/decode/row.hpp b/pv/data/decode/row.hpp index 6413e788..9c81b871 100644 --- a/pv/data/decode/row.hpp +++ b/pv/data/decode/row.hpp @@ -38,7 +38,7 @@ public: Row(); Row(const srd_decoder *decoder, - const srd_decoder_annotation_row *row = NULL); + const srd_decoder_annotation_row *row = nullptr); const srd_decoder* decoder() const; const srd_decoder_annotation_row* row() const; diff --git a/pv/data/decoderstack.cpp b/pv/data/decoderstack.cpp index 912d98c7..7c1982bd 100644 --- a/pv/data/decoderstack.cpp +++ b/pv/data/decoderstack.cpp @@ -334,7 +334,7 @@ void DecoderStack::decode_proc() { optional sample_count; srd_session *session; - srd_decoder_inst *prev_di = NULL; + srd_decoder_inst *prev_di = nullptr; assert(segment_); diff --git a/pv/data/logicsegment.cpp b/pv/data/logicsegment.cpp index e56a8371..30e4e67d 100644 --- a/pv/data/logicsegment.cpp +++ b/pv/data/logicsegment.cpp @@ -306,7 +306,7 @@ void LogicSegment::get_subsampled_edges( // We cannot fast-forward if there is no mip-map data at // at the minimum level. - fast_forward = (mip_map_[level].data != NULL); + fast_forward = (mip_map_[level].data != nullptr); if (min_length < MipMapScaleFactor) { diff --git a/pv/mainwindow.hpp b/pv/mainwindow.hpp index 99772e3d..a6b2c898 100644 --- a/pv/mainwindow.hpp +++ b/pv/mainwindow.hpp @@ -78,7 +78,7 @@ private: public: explicit MainWindow(DeviceManager &device_manager, - const char *open_file_name = NULL, + const char *open_file_name = nullptr, QWidget *parent = 0); QAction* action_open() const; diff --git a/pv/popups/channels.cpp b/pv/popups/channels.cpp index 3ad494d3..d4ff6c97 100644 --- a/pv/popups/channels.cpp +++ b/pv/popups/channels.cpp @@ -110,7 +110,7 @@ Channels::Channels(Session &session, QWidget *parent) : } // Create a group - populate_group(NULL, global_sigs); + populate_group(nullptr, global_sigs); // Create the enable/disable all buttons connect(&enable_all_channels_, SIGNAL(clicked()), diff --git a/pv/prop/bool.cpp b/pv/prop/bool.cpp index e3e0ebd5..3e201cc4 100644 --- a/pv/prop/bool.cpp +++ b/pv/prop/bool.cpp @@ -29,7 +29,7 @@ namespace prop { Bool::Bool(QString name, Getter getter, Setter setter) : Property(name, getter, setter), - check_box_(NULL) + check_box_(nullptr) { } @@ -43,11 +43,11 @@ QWidget* Bool::get_widget(QWidget *parent, bool auto_commit) return check_box_; if (!getter_) - return NULL; + return nullptr; Glib::VariantBase variant = getter_(); if (!variant.gobj()) - return NULL; + return nullptr; bool value = Glib::VariantBase::cast_dynamic>( variant).get(); diff --git a/pv/prop/double.cpp b/pv/prop/double.cpp index d0597558..c5ab1db4 100644 --- a/pv/prop/double.cpp +++ b/pv/prop/double.cpp @@ -42,7 +42,7 @@ Double::Double(QString name, suffix_(suffix), range_(range), step_(step), - spin_box_(NULL) + spin_box_(nullptr) { } @@ -56,11 +56,11 @@ QWidget* Double::get_widget(QWidget *parent, bool auto_commit) return spin_box_; if (!getter_) - return NULL; + return nullptr; Glib::VariantBase variant = getter_(); if (!variant.gobj()) - return NULL; + return nullptr; double value = Glib::VariantBase::cast_dynamic>( variant).get(); diff --git a/pv/prop/enum.cpp b/pv/prop/enum.cpp index 6717101b..06e4d76f 100644 --- a/pv/prop/enum.cpp +++ b/pv/prop/enum.cpp @@ -35,7 +35,7 @@ Enum::Enum(QString name, Getter getter, Setter setter) : Property(name, getter, setter), values_(values), - selector_(NULL) + selector_(nullptr) { } @@ -49,11 +49,11 @@ QWidget* Enum::get_widget(QWidget *parent, bool auto_commit) return selector_; if (!getter_) - return NULL; + return nullptr; Glib::VariantBase variant = getter_(); if (!variant.gobj()) - return NULL; + return nullptr; selector_ = new QComboBox(parent); for (unsigned int i = 0; i < values_.size(); i++) { diff --git a/pv/prop/int.cpp b/pv/prop/int.cpp index 55b7ab3e..31f518a8 100644 --- a/pv/prop/int.cpp +++ b/pv/prop/int.cpp @@ -41,7 +41,7 @@ Int::Int(QString name, Property(name, getter, setter), suffix_(suffix), range_(range), - spin_box_(NULL) + spin_box_(nullptr) { } @@ -57,13 +57,13 @@ QWidget* Int::get_widget(QWidget *parent, bool auto_commit) return spin_box_; if (!getter_) - return NULL; + return nullptr; value_ = getter_(); GVariant *value = value_.gobj(); if (!value) - return NULL; + return nullptr; spin_box_ = new QSpinBox(parent); spin_box_->setSuffix(suffix_); @@ -141,7 +141,7 @@ void Int::commit() if (!spin_box_) return; - GVariant *new_value = NULL; + GVariant *new_value = nullptr; const GVariantType *const type = g_variant_get_type(value_.gobj()); assert(type); diff --git a/pv/prop/string.cpp b/pv/prop/string.cpp index b8ecf738..e7af4597 100644 --- a/pv/prop/string.cpp +++ b/pv/prop/string.cpp @@ -36,7 +36,7 @@ String::String(QString name, Getter getter, Setter setter) : Property(name, getter, setter), - line_edit_(NULL) + line_edit_(nullptr) { } @@ -46,11 +46,11 @@ QWidget* String::get_widget(QWidget *parent, bool auto_commit) return line_edit_; if (!getter_) - return NULL; + return nullptr; Glib::VariantBase variant = getter_(); if (!variant.gobj()) - return NULL; + return nullptr; string value = Glib::VariantBase::cast_dynamic>( variant).get(); diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index 8c2be468..5518e98b 100644 --- a/pv/toolbars/mainbar.cpp +++ b/pv/toolbars/mainbar.cpp @@ -71,7 +71,7 @@ MainBar::MainBar(Session &session, MainWindow &main_window) : device_selector_(this, session.device_manager(), main_window.action_connect()), configure_button_(this), - configure_button_action_(NULL), + configure_button_action_(nullptr), channels_button_(this), sample_count_(" samples", this), sample_rate_("Hz", this), @@ -231,7 +231,7 @@ void MainBar::update_sample_rate_selector() { Glib::VariantContainerBase gvar_dict; GVariant *gvar_list; - const uint64_t *elements = NULL; + const uint64_t *elements = nullptr; gsize num_elements; map< const ConfigKey*, std::set > keys; diff --git a/pv/view/decodetrace.cpp b/pv/view/decodetrace.cpp index 4af65f54..8674f40c 100644 --- a/pv/view/decodetrace.cpp +++ b/pv/view/decodetrace.cpp @@ -717,7 +717,7 @@ QComboBox* DecodeTrace::create_channel_selector( QComboBox *selector = new QComboBox(parent); - selector->addItem("-", qVariantFromValue((void*)NULL)); + selector->addItem("-", qVariantFromValue((void*)nullptr)); if (channel_iter == dec->channels().end()) selector->setCurrentIndex(0); diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index 58eaac93..49d12636 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -105,12 +105,12 @@ LogicSignal::LogicSignal( Signal(session, channel), device_(device), data_(data), - trigger_none_(NULL), - trigger_rising_(NULL), - trigger_high_(NULL), - trigger_falling_(NULL), - trigger_low_(NULL), - trigger_change_(NULL) + trigger_none_(nullptr), + trigger_rising_(nullptr), + trigger_high_(nullptr), + trigger_falling_(nullptr), + trigger_low_(nullptr), + trigger_change_(nullptr) { shared_ptr trigger; diff --git a/pv/view/rowitem.cpp b/pv/view/rowitem.cpp index 3a002bbc..07540c1b 100644 --- a/pv/view/rowitem.cpp +++ b/pv/view/rowitem.cpp @@ -28,7 +28,7 @@ namespace pv { namespace view { RowItem::RowItem() : - owner_(NULL), + owner_(nullptr), layout_v_offset_(0), visual_v_offset_(0), v_offset_animation_(this, "visual_v_offset") diff --git a/pv/view/signal.cpp b/pv/view/signal.cpp index bbabcc1b..1896bba2 100644 --- a/pv/view/signal.cpp +++ b/pv/view/signal.cpp @@ -63,7 +63,7 @@ Signal::Signal(pv::Session &session, Trace(QString::fromUtf8(channel->name().c_str())), session_(session), channel_(channel), - name_widget_(NULL), + name_widget_(nullptr), updating_name_widget_(false) { assert(channel_); diff --git a/pv/view/timemarker.cpp b/pv/view/timemarker.cpp index 1e5b8206..e4ef3c0e 100644 --- a/pv/view/timemarker.cpp +++ b/pv/view/timemarker.cpp @@ -45,8 +45,8 @@ TimeMarker::TimeMarker(View &view, const QColor &colour, double time) : TimeItem(view), colour_(colour), time_(time), - value_action_(NULL), - value_widget_(NULL), + value_action_(nullptr), + value_widget_(nullptr), updating_value_widget_(false) { } diff --git a/pv/view/trace.cpp b/pv/view/trace.cpp index 8e392784..729b0b4c 100644 --- a/pv/view/trace.cpp +++ b/pv/view/trace.cpp @@ -43,8 +43,8 @@ const int Trace::LabelHitPadding = 2; Trace::Trace(QString name) : name_(name), - popup_(NULL), - popup_form_(NULL) + popup_(nullptr), + popup_form_(nullptr) { } @@ -219,8 +219,8 @@ void Trace::populate_popup_form(QWidget *parent, QFormLayout *form) void Trace::on_popup_closed() { - popup_ = NULL; - popup_form_ = NULL; + popup_ = nullptr; + popup_form_ = nullptr; } void Trace::on_text_changed(const QString &text) diff --git a/pv/view/tracegroup.cpp b/pv/view/tracegroup.cpp index b155778b..74221d44 100644 --- a/pv/view/tracegroup.cpp +++ b/pv/view/tracegroup.cpp @@ -147,7 +147,7 @@ QMenu* TraceGroup::create_context_menu(QWidget *parent) pv::widgets::Popup* TraceGroup::create_popup(QWidget *parent) { (void)parent; - return NULL; + return nullptr; } int TraceGroup::owner_visual_v_offset() const diff --git a/pv/view/viewitem.cpp b/pv/view/viewitem.cpp index 1492d14d..55243860 100644 --- a/pv/view/viewitem.cpp +++ b/pv/view/viewitem.cpp @@ -33,7 +33,7 @@ const QSizeF ViewItem::LabelPadding(4, 0); const int ViewItem::HighlightRadius = 3; ViewItem::ViewItem() : - context_parent_(NULL), + context_parent_(nullptr), drag_point_(INT_MIN, INT_MIN), selected_(false) { diff --git a/pv/widgets/decodergroupbox.hpp b/pv/widgets/decodergroupbox.hpp index 09c83f27..73bc9971 100644 --- a/pv/widgets/decodergroupbox.hpp +++ b/pv/widgets/decodergroupbox.hpp @@ -34,7 +34,7 @@ class DecoderGroupBox : public QWidget Q_OBJECT public: - DecoderGroupBox(QString title, QWidget *parent = NULL); + DecoderGroupBox(QString title, QWidget *parent = nullptr); void add_layout(QLayout *layout); diff --git a/pv/widgets/popuptoolbutton.cpp b/pv/widgets/popuptoolbutton.cpp index 75aa76a5..5153eee5 100644 --- a/pv/widgets/popuptoolbutton.cpp +++ b/pv/widgets/popuptoolbutton.cpp @@ -27,7 +27,7 @@ namespace widgets { PopupToolButton::PopupToolButton(QWidget *parent) : QToolButton(parent), - popup_(NULL) + popup_(nullptr) { connect(this, SIGNAL(clicked(bool)), this, SLOT(on_clicked(bool))); } diff --git a/pv/widgets/sweeptimingwidget.hpp b/pv/widgets/sweeptimingwidget.hpp index d760a79d..e9e4dcff 100644 --- a/pv/widgets/sweeptimingwidget.hpp +++ b/pv/widgets/sweeptimingwidget.hpp @@ -45,7 +45,7 @@ private: }; public: - SweepTimingWidget(const char *suffix, QWidget *parent = NULL); + SweepTimingWidget(const char *suffix, QWidget *parent = nullptr); void show_none(); void show_min_max_step(uint64_t min, uint64_t max, uint64_t step); diff --git a/signalhandler.hpp b/signalhandler.hpp index fff9efc7..a8ddccb3 100644 --- a/signalhandler.hpp +++ b/signalhandler.hpp @@ -33,7 +33,7 @@ public: static bool prepare_signals(); public: - explicit SignalHandler(QObject* parent = NULL); + explicit SignalHandler(QObject* parent = nullptr); Q_SIGNALS: void int_received(); diff --git a/test/data/analogsegment.cpp b/test/data/analogsegment.cpp index fd7b8870..2593bf67 100644 --- a/test/data/analogsegment.cpp +++ b/test/data/analogsegment.cpp @@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(Basic) const AnalogSegment::Envelope &m = s.envelope_levels_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.samples == NULL); + BOOST_CHECK(m.samples == nullptr); } // Push 8 samples of all zeros @@ -69,7 +69,7 @@ BOOST_AUTO_TEST_CASE(Basic) const AnalogSegment::Envelope &m = s.envelope_levels_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.samples == NULL); + BOOST_CHECK(m.samples == nullptr); } // Push 8 samples of 1.0s to bring the total up to 16 @@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE(Basic) const AnalogSegment::Envelope &e0 = s.envelope_levels_[0]; BOOST_CHECK_EQUAL(e0.length, 1); BOOST_CHECK_EQUAL(e0.data_length, AnalogSegment::EnvelopeDataUnit); - BOOST_REQUIRE(e0.samples != NULL); + BOOST_REQUIRE(e0.samples != nullptr); BOOST_CHECK_EQUAL(e0.samples[0].min, 0.0f); BOOST_CHECK_EQUAL(e0.samples[0].max, 1.0f); @@ -90,7 +90,7 @@ BOOST_AUTO_TEST_CASE(Basic) const AnalogSegment::Envelope &m = s.envelope_levels_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.samples == NULL); + BOOST_CHECK(m.samples == nullptr); } // Push 240 samples of all zeros to bring the total up to 256 @@ -107,7 +107,7 @@ BOOST_AUTO_TEST_CASE(Basic) const AnalogSegment::Envelope &e1 = s.envelope_levels_[1]; BOOST_CHECK_EQUAL(e1.length, 1); BOOST_CHECK_EQUAL(e1.data_length, AnalogSegment::EnvelopeDataUnit); - BOOST_REQUIRE(e1.samples != NULL); + BOOST_REQUIRE(e1.samples != nullptr); BOOST_CHECK_EQUAL(e1.samples[0].min, -1.0f); BOOST_CHECK_EQUAL(e1.samples[0].max, 1.0f); } diff --git a/test/data/decoderstack.cpp b/test/data/decoderstack.cpp index 96f8b4a0..70ed7e03 100644 --- a/test/data/decoderstack.cpp +++ b/test/data/decoderstack.cpp @@ -39,12 +39,12 @@ BOOST_AUTO_TEST_SUITE(DecoderStackTest) BOOST_AUTO_TEST_CASE(TwoDecoderStack) { - sr_context *ctx = NULL; + sr_context *ctx = nullptr; BOOST_REQUIRE(sr_init(&ctx) == SR_OK); BOOST_REQUIRE(ctx); - BOOST_REQUIRE(srd_init(NULL) == SRD_OK); + BOOST_REQUIRE(srd_init(nullptr) == SRD_OK); srd_decoder_load_all(); diff --git a/test/data/logicsegment.cpp b/test/data/logicsegment.cpp index 29bffdda..fabcbd40 100644 --- a/test/data/logicsegment.cpp +++ b/test/data/logicsegment.cpp @@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE(Basic) sr_datafeed_logic logic; logic.length = 0; logic.unitsize = 1; - logic.data = NULL; + logic.data = nullptr; LogicSegment s(logic); @@ -86,7 +86,7 @@ BOOST_AUTO_TEST_CASE(Basic) const LogicSegment::MipMapLevel &m = s.mip_map_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.data == NULL); + BOOST_CHECK(m.data == nullptr); } // Push 8 samples of all zeros @@ -100,7 +100,7 @@ BOOST_AUTO_TEST_CASE(Basic) const LogicSegment::MipMapLevel &m = s.mip_map_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.data == NULL); + BOOST_CHECK(m.data == nullptr); } // Push 8 samples of 0x11s to bring the total up to 16 @@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE(Basic) const LogicSegment::MipMapLevel &m0 = s.mip_map_[0]; BOOST_CHECK_EQUAL(m0.length, 1); BOOST_CHECK_EQUAL(m0.data_length, LogicSegment::MipMapDataUnit); - BOOST_REQUIRE(m0.data != NULL); + BOOST_REQUIRE(m0.data != nullptr); BOOST_CHECK_EQUAL(((uint8_t*)m0.data)[0], 0x11); // The higher levels should still be empty @@ -120,7 +120,7 @@ BOOST_AUTO_TEST_CASE(Basic) const LogicSegment::MipMapLevel &m = s.mip_map_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.data == NULL); + BOOST_CHECK(m.data == nullptr); } // Push 240 samples of all zeros to bring the total up to 256 @@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(Basic) const LogicSegment::MipMapLevel &m1 = s.mip_map_[1]; BOOST_CHECK_EQUAL(m1.length, 1); BOOST_CHECK_EQUAL(m1.data_length, LogicSegment::MipMapDataUnit); - BOOST_REQUIRE(m1.data != NULL); + BOOST_REQUIRE(m1.data != nullptr); BOOST_CHECK_EQUAL(((uint8_t*)m1.data)[0], 0x11); //----- Test LogicSegment::get_subsampled_edges -----// @@ -185,7 +185,7 @@ BOOST_AUTO_TEST_CASE(LargeData) BOOST_CHECK_EQUAL(s.mip_map_[0].length, 62500); BOOST_CHECK_EQUAL(s.mip_map_[0].data_length, LogicSegment::MipMapDataUnit); - BOOST_REQUIRE(s.mip_map_[0].data != NULL); + BOOST_REQUIRE(s.mip_map_[0].data != nullptr); prev_sample = 0; for (unsigned int i = 0; i < s.mip_map_[0].length;) @@ -208,7 +208,7 @@ BOOST_AUTO_TEST_CASE(LargeData) BOOST_CHECK_EQUAL(s.mip_map_[1].length, 3906); BOOST_CHECK_EQUAL(s.mip_map_[1].data_length, LogicSegment::MipMapDataUnit); - BOOST_REQUIRE(s.mip_map_[1].data != NULL); + BOOST_REQUIRE(s.mip_map_[1].data != nullptr); prev_sample = 0; for (unsigned int i = 0; i < s.mip_map_[1].length; i++) @@ -226,7 +226,7 @@ BOOST_AUTO_TEST_CASE(LargeData) BOOST_CHECK_EQUAL(s.mip_map_[2].length, 244); BOOST_CHECK_EQUAL(s.mip_map_[2].data_length, LogicSegment::MipMapDataUnit); - BOOST_REQUIRE(s.mip_map_[2].data != NULL); + BOOST_REQUIRE(s.mip_map_[2].data != nullptr); prev_sample = 0; for (unsigned int i = 0; i < s.mip_map_[2].length; i++) @@ -244,7 +244,7 @@ BOOST_AUTO_TEST_CASE(LargeData) BOOST_CHECK_EQUAL(s.mip_map_[3].length, 15); BOOST_CHECK_EQUAL(s.mip_map_[3].data_length, LogicSegment::MipMapDataUnit); - BOOST_REQUIRE(s.mip_map_[3].data != NULL); + BOOST_REQUIRE(s.mip_map_[3].data != nullptr); for (unsigned int i = 0; i < s.mip_map_[3].length; i++) BOOST_CHECK_EQUAL(*((uint8_t*)s.mip_map_[3].data + i), @@ -256,7 +256,7 @@ BOOST_AUTO_TEST_CASE(LargeData) const LogicSegment::MipMapLevel &m = s.mip_map_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.data == NULL); + BOOST_CHECK(m.data == nullptr); } //----- Test LogicSegment::get_subsampled_edges -----// @@ -310,7 +310,7 @@ BOOST_AUTO_TEST_CASE(Pulses) BOOST_CHECK_EQUAL(s.mip_map_[0].length, 12); BOOST_CHECK_EQUAL(s.mip_map_[0].data_length, LogicSegment::MipMapDataUnit); - BOOST_REQUIRE(s.mip_map_[0].data != NULL); + BOOST_REQUIRE(s.mip_map_[0].data != nullptr); for (unsigned int i = 0; i < s.mip_map_[0].length;) { BOOST_TEST_MESSAGE("Testing mip_map[0].data[" << i << "]"); @@ -330,7 +330,7 @@ BOOST_AUTO_TEST_CASE(Pulses) const LogicSegment::MipMapLevel &m = s.mip_map_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.data == NULL); + BOOST_CHECK(m.data == nullptr); } //----- Test get_subsampled_edges at reduced scale -----// @@ -374,7 +374,7 @@ BOOST_AUTO_TEST_CASE(LongPulses) BOOST_CHECK_EQUAL(s.mip_map_[0].length, 12); BOOST_CHECK_EQUAL(s.mip_map_[0].data_length, LogicSegment::MipMapDataUnit); - BOOST_REQUIRE(s.mip_map_[0].data != NULL); + BOOST_REQUIRE(s.mip_map_[0].data != nullptr); for (unsigned int i = 0; i < s.mip_map_[0].length;) { for (j = 0; i < s.mip_map_[0].length && j < 2; j++) { @@ -396,7 +396,7 @@ BOOST_AUTO_TEST_CASE(LongPulses) const LogicSegment::MipMapLevel &m = s.mip_map_[i]; BOOST_CHECK_EQUAL(m.length, 0); BOOST_CHECK_EQUAL(m.data_length, 0); - BOOST_CHECK(m.data == NULL); + BOOST_CHECK(m.data == nullptr); } //----- Test get_subsampled_edges at a full scale -----//