]> sigrok.org Git - pulseview.git/commitdiff
Replaced using namespace with using class directives
authorJoel Holdsworth <redacted>
Mon, 30 Dec 2013 15:05:37 +0000 (16:05 +0100)
committerJoel Holdsworth <redacted>
Mon, 30 Dec 2013 15:15:00 +0000 (16:15 +0100)
This will fix ambiguity issues caused by the arrival of C++11

37 files changed:
pv/data/analog.cpp
pv/data/analogsnapshot.cpp
pv/data/decode/annotation.cpp
pv/data/decode/decoder.cpp
pv/data/decoderstack.cpp
pv/data/logic.cpp
pv/data/logicsnapshot.cpp
pv/data/snapshot.cpp
pv/devicemanager.cpp
pv/dialogs/connect.cpp
pv/mainwindow.cpp
pv/popups/deviceoptions.cpp
pv/popups/probes.cpp
pv/prop/binding/binding.cpp
pv/prop/binding/decoderoptions.cpp
pv/prop/binding/deviceoptions.cpp
pv/prop/bool.cpp
pv/prop/double.cpp
pv/prop/enum.cpp
pv/prop/int.cpp
pv/prop/string.cpp
pv/sigsession.cpp
pv/toolbars/samplingbar.cpp
pv/view/analogsignal.cpp
pv/view/cursor.cpp
pv/view/cursorpair.cpp
pv/view/decodetrace.cpp
pv/view/header.cpp
pv/view/logicsignal.cpp
pv/view/ruler.cpp
pv/view/timemarker.cpp
pv/view/view.cpp
pv/view/viewport.cpp
pv/widgets/popup.cpp
test/data/analogsnapshot.cpp
test/data/decoderstack.cpp
test/data/logicsnapshot.cpp

index dd4097a8d2a7cea131e7d3eea6912a4caead690e..21ddb5fb766cff41da6a5d4ad63e7e02f0b3bd93 100644 (file)
@@ -23,8 +23,9 @@
 #include "analog.h"
 #include "analogsnapshot.h"
 
 #include "analog.h"
 #include "analogsnapshot.h"
 
-using namespace boost;
-using namespace std;
+using boost::shared_ptr;
+using std::deque;
+using std::max;
 
 namespace pv {
 namespace data {
 
 namespace pv {
 namespace data {
index bec65065631aa19239a1f27f18f3b6287521f3a5..36fad7f73477d9da08d9ddb475ab85c882a720a1 100644 (file)
 
 #include "analogsnapshot.h"
 
 
 #include "analogsnapshot.h"
 
-using namespace boost;
-using namespace std;
+using boost::lock_guard;
+using boost::recursive_mutex;
+using std::max;
+using std::max_element;
+using std::min;
+using std::min_element;
 
 namespace pv {
 namespace data {
 
 namespace pv {
 namespace data {
index b8061cab08ea305c120b2a7c2a673c10fa0d016b..b0517ae69ef9c6a13eefc4bad41efeea08b7d9a0 100644 (file)
@@ -26,8 +26,6 @@ extern "C" {
 
 #include "annotation.h"
 
 
 #include "annotation.h"
 
-using namespace std;
-
 namespace pv {
 namespace data {
 namespace decode {
 namespace pv {
 namespace data {
 namespace decode {
index 05adf250717549f27c74e1c2225578ea5de3da6c..592a746c7f612cc71dd34a914c2ab91ec1f8e8f7 100644 (file)
@@ -24,8 +24,9 @@
 
 #include <pv/view/logicsignal.h>
 
 
 #include <pv/view/logicsignal.h>
 
-using namespace boost;
-using namespace std;
+using boost::shared_ptr;
+using std::map;
+using std::string;
 
 namespace pv {
 namespace data {
 
 namespace pv {
 namespace data {
index c2ae9116856161a94826db1adeadcfe9366d647b..5b58761f9c1c3464121299c3c6259a907015a10a 100644 (file)
 #include <pv/data/decode/annotation.h>
 #include <pv/view/logicsignal.h>
 
 #include <pv/data/decode/annotation.h>
 #include <pv/view/logicsignal.h>
 
-using namespace boost;
-using namespace std;
+using boost::lock_guard;
+using boost::mutex;
+using boost::shared_ptr;
+using std::deque;
+using std::min;
+using std::list;
+using std::vector;
 
 namespace pv {
 namespace data {
 
 namespace pv {
 namespace data {
@@ -202,7 +207,8 @@ void DecoderStack::decode_proc(shared_ptr<data::Logic> data)
        srd_session_start(session);
 
        for (int64_t i = 0;
        srd_session_start(session);
 
        for (int64_t i = 0;
-               !this_thread::interruption_requested() && i < sample_count;
+               !boost::this_thread::interruption_requested() &&
+                       i < sample_count;
                i += DecodeChunkLength)
        {
                lock_guard<mutex> decode_lock(_global_decode_mutex);
                i += DecodeChunkLength)
        {
                lock_guard<mutex> decode_lock(_global_decode_mutex);
index d13cd766cc69f9eabfed4930ab6c4550ce9a7808..167c79bd3cf2ef49e1e9db77a4f1070b38084aac 100644 (file)
@@ -23,8 +23,9 @@
 #include "logic.h"
 #include "logicsnapshot.h"
 
 #include "logic.h"
 #include "logicsnapshot.h"
 
-using namespace boost;
-using namespace std;
+using boost::shared_ptr;
+using std::deque;
+using std::max;
 
 namespace pv {
 namespace data {
 
 namespace pv {
 namespace data {
index d32274b3322cb4b02808343dad61f92afee57774..f2fa81bcdde675fa9811977a32261be129687b75 100644 (file)
 
 #include "logicsnapshot.h"
 
 
 #include "logicsnapshot.h"
 
-using namespace boost;
-using namespace std;
+using boost::lock_guard;
+using boost::recursive_mutex;
+using std::max;
+using std::min;
+using std::pair;
 
 namespace pv {
 namespace data {
 
 namespace pv {
 namespace data {
index 602388412f00624cc6db0cfbce81fff684b1223f..85f54e784a1174cc0023ae687964ddc6c9ef6165 100644 (file)
@@ -24,7 +24,8 @@
 #include <stdlib.h>
 #include <string.h>
 
 #include <stdlib.h>
 #include <string.h>
 
-using namespace boost;
+using boost::lock_guard;
+using boost::recursive_mutex;
 
 namespace pv {
 namespace data {
 
 namespace pv {
 namespace data {
index 0765cac645c87315c43ca64ab39e16ac319a6cf4..14ad16efcad67abb72f844cafd7c108f10c8d9bf 100644 (file)
 
 #include <libsigrok/libsigrok.h>
 
 
 #include <libsigrok/libsigrok.h>
 
-using namespace std;
+using std::list;
+using std::map;
+using std::ostringstream;
+using std::runtime_error;
+using std::string;
 
 namespace pv {
 
 
 namespace pv {
 
index b7efe4f3442a875bd40dc37c2ea01d56852ff2d2..52530beb5d391815233f8a11140bde1c2d5ad20b 100644 (file)
@@ -31,7 +31,8 @@ extern "C" {
 #include <libsigrok/libsigrok.h>
 }
 
 #include <libsigrok/libsigrok.h>
 }
 
-using namespace std;
+using std::list;
+using std::string;
 
 extern sr_context *sr_ctx;
 
 
 extern sr_context *sr_ctx;
 
index 2e0fa0ffe8746ce70b3886b94c11724fe7e80da1..317f3c9a701383793d869f5fda7e6a8aee42eea4 100644 (file)
@@ -56,8 +56,7 @@
 #include <glib.h>
 #include <libsigrok/libsigrok.h>
 
 #include <glib.h>
 #include <libsigrok/libsigrok.h>
 
-using namespace boost;
-using namespace std;
+using std::list;
 
 namespace pv {
 
 
 namespace pv {
 
index ac7c2b78f3c3eb0245e77e3d6dc248e47264e801..30d5f579422a37517aa689cae30dc1a88fe98262 100644 (file)
@@ -27,9 +27,6 @@
 
 #include <pv/prop/property.h>
 
 
 #include <pv/prop/property.h>
 
-using namespace boost;
-using namespace std;
-
 namespace pv {
 namespace popups {
 
 namespace pv {
 namespace popups {
 
index 51ba3ddca8b2744bfd60e89a109906ab741f60dd..60f1e0277820b030673f433d6b344c9b3921755d 100644 (file)
@@ -23,9 +23,9 @@
 #include <pv/sigsession.h>
 #include <pv/view/signal.h>
 
 #include <pv/sigsession.h>
 #include <pv/view/signal.h>
 
-using namespace boost;
 using namespace Qt;
 using namespace Qt;
-using namespace std;
+using boost::shared_ptr;
+using std::vector;
 
 namespace pv {
 namespace popups {
 
 namespace pv {
 namespace popups {
index afdd7030a2a694b889cfe799fcc29cb2edd8c1a2..90e5214e86c08dad3eb208c5b3ccf873e609662a 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "binding.h"
 
 
 #include "binding.h"
 
-using namespace boost;
+using boost::shared_ptr;
 
 namespace pv {
 namespace prop {
 
 namespace pv {
 namespace prop {
index 361d85b2bbbbec202638b28b67675ce4d7fff934..e29436768ab499d8364790cd9605335b00f810ad 100644 (file)
 #include <pv/prop/int.h>
 #include <pv/prop/string.h>
 
 #include <pv/prop/int.h>
 #include <pv/prop/string.h>
 
-using namespace boost;
-using namespace std;
+using boost::bind;
+using boost::none;
+using boost::shared_ptr;
+using std::map;
+using std::string;
 
 namespace pv {
 namespace prop {
 
 namespace pv {
 namespace prop {
index ff7be104feb8406af3bdcfc4bd22c7dd34ef0e2b..35541fbf8b8cca292560608c1ac9822c77fc385f 100644 (file)
 #include <pv/prop/enum.h>
 #include <pv/prop/int.h>
 
 #include <pv/prop/enum.h>
 #include <pv/prop/int.h>
 
-using namespace boost;
-using namespace std;
+using boost::bind;
+using boost::function;
+using boost::optional;
+using boost::shared_ptr;
+using std::make_pair;
+using std::pair;
+using std::string;
+using std::vector;
 
 namespace pv {
 namespace prop {
 
 namespace pv {
 namespace prop {
index 179208a5e1c927b74de3469b3aca4a8d3634d453..ac142fd440403c6b015c441f6e6b1d13ae3923aa 100644 (file)
@@ -24,9 +24,6 @@
 
 #include "bool.h"
 
 
 #include "bool.h"
 
-using namespace std;
-using namespace boost;
-
 namespace pv {
 namespace prop {
 
 namespace pv {
 namespace prop {
 
index 188286ae1c4ff08a22687c0ac11704c69920ff23..fa5e5688148bc8f07fe089f88ed3be161a1fab11 100644 (file)
@@ -24,8 +24,8 @@
 
 #include "double.h"
 
 
 #include "double.h"
 
-using namespace std;
-using namespace boost;
+using boost::optional;
+using std::pair;
 
 namespace pv {
 namespace prop {
 
 namespace pv {
 namespace prop {
index 412a31b0827854d01d103d5f110325b7717faaad..d4a04cbb748ae066fb66cebe29b244eca52c6a8f 100644 (file)
@@ -24,8 +24,8 @@
 
 #include "enum.h"
 
 
 #include "enum.h"
 
-using namespace boost;
-using namespace std;
+using std::pair;
+using std::vector;
 
 namespace pv {
 namespace prop {
 
 namespace pv {
 namespace prop {
index faa3171d85d41b13115ba37c624abfa65be6d4bf..4277524886a0f12c9cc5ff610ed805a7faad3c92 100644 (file)
 
 #include "int.h"
 
 
 #include "int.h"
 
-using namespace std;
-using namespace boost;
+using boost::optional;
+using std::max;
+using std::min;
+using std::pair;
 
 namespace pv {
 namespace prop {
 
 namespace pv {
 namespace prop {
index 4921129e9242bdb61c22e1c9ddb5aedfed958091..37efc148255848be1103e8cb5beca9ea48485c20 100644 (file)
@@ -25,9 +25,6 @@
 
 #include "string.h"
 
 
 #include "string.h"
 
-using namespace std;
-using namespace boost;
-
 namespace pv {
 namespace prop {
 
 namespace pv {
 namespace prop {
 
index 6c9b57f84ac1e9492d321b606144643dc1acad3e..719f9ded3610b948438c65a2ebda098d76555f53 100644 (file)
 
 #include <QDebug>
 
 
 #include <QDebug>
 
-using namespace boost;
-using namespace std;
+using boost::dynamic_pointer_cast;
+using boost::function;
+using boost::lock_guard;
+using boost::mutex;
+using boost::shared_ptr;
+using std::map;
+using std::string;
+using std::vector;
 
 namespace pv {
 
 
 namespace pv {
 
index 3bd2cb39519eaab2872a439a1f0fabc26c8c9e07..ca0450b43c2f751aff4b9f93383819ef1dfe2a2e 100644 (file)
@@ -34,7 +34,7 @@
 #include <pv/devicemanager.h>
 #include <pv/popups/deviceoptions.h>
 
 #include <pv/devicemanager.h>
 #include <pv/popups/deviceoptions.h>
 
-using namespace std;
+using std::string;
 
 namespace pv {
 namespace toolbars {
 
 namespace pv {
 namespace toolbars {
@@ -303,7 +303,7 @@ void SamplingBar::commit_sample_rate()
 
 void SamplingBar::on_device_selected()
 {
 
 void SamplingBar::on_device_selected()
 {
-       using namespace pv::popups;
+       using pv::popups::DeviceOptions;
 
        if (_updating_device_selector)
                return;
 
        if (_updating_device_selector)
                return;
index 64633717fb4b8098637901813421df24f83c3d30..eb828a1bfff61c93b58386618e03cb534f6ff850 100644 (file)
 #include "pv/data/analogsnapshot.h"
 #include "pv/view/view.h"
 
 #include "pv/data/analogsnapshot.h"
 #include "pv/view/view.h"
 
-using namespace boost;
-using namespace std;
+using boost::shared_ptr;
+using std::max;
+using std::min;
+using std::deque;
 
 namespace pv {
 namespace view {
 
 namespace pv {
 namespace view {
@@ -151,7 +153,6 @@ void AnalogSignal::paint_envelope(QPainter &p,
        int y, int left, const int64_t start, const int64_t end,
        const double pixels_offset, const double samples_per_pixel)
 {
        int y, int left, const int64_t start, const int64_t end,
        const double pixels_offset, const double samples_per_pixel)
 {
-       using namespace Qt;
        using pv::data::AnalogSnapshot;
 
        AnalogSnapshot::EnvelopeSection e;
        using pv::data::AnalogSnapshot;
 
        AnalogSnapshot::EnvelopeSection e;
@@ -160,7 +161,7 @@ void AnalogSignal::paint_envelope(QPainter &p,
        if (e.length < 2)
                return;
 
        if (e.length < 2)
                return;
 
-       p.setPen(QPen(NoPen));
+       p.setPen(QPen(Qt::NoPen));
        p.setBrush(_colour);
 
        QRectF *const rects = new QRectF[e.length];
        p.setBrush(_colour);
 
        QRectF *const rects = new QRectF[e.length];
index 1b30518e04024225586f8e7dbfcc073a57891989..ca22eefdf1f65d44c145f84c0649733b6b9e3e84 100644 (file)
@@ -33,7 +33,7 @@
 
 #include <extdef.h>
 
 
 #include <extdef.h>
 
-using namespace boost;
+using boost::shared_ptr;
 
 namespace pv {
 namespace view {
 
 namespace pv {
 namespace view {
index 83e6f7334cbd907a370265f6e18589fe9c572948..ed8829d25befdcc4f0b6f790a2f62bc9b4922bc7 100644 (file)
 
 #include <algorithm>
 
 
 #include <algorithm>
 
-using namespace boost;
-using namespace std;
+using boost::shared_ptr;
+using std::max;
+using std::make_pair;
+using std::min;
+using std::pair;
 
 namespace pv {
 namespace view {
 
 namespace pv {
 namespace view {
index cf5cd2ee35e1cc496f953a44b63fdd711756bdfc..37beed98779d73fb8043567cb48d5beeff18e25c 100644 (file)
@@ -47,8 +47,13 @@ extern "C" {
 #include <pv/widgets/decodergroupbox.h>
 #include <pv/widgets/decodermenu.h>
 
 #include <pv/widgets/decodergroupbox.h>
 #include <pv/widgets/decodermenu.h>
 
-using namespace boost;
-using namespace std;
+using boost::dynamic_pointer_cast;
+using boost::shared_ptr;
+using std::list;
+using std::max;
+using std::map;
+using std::min;
+using std::vector;
 
 namespace pv {
 namespace view {
 
 namespace pv {
 namespace view {
index ca5df96fca250dc23666bbdcf59f644a07083139..af67abddd899f401b01eeb3d8665e271f959547c 100644 (file)
 
 #include <pv/widgets/popup.h>
 
 
 #include <pv/widgets/popup.h>
 
-using namespace boost;
-using namespace std;
+using boost::shared_ptr;
+using std::max;
+using std::make_pair;
+using std::pair;
+using std::vector;
 
 namespace pv {
 namespace view {
 
 namespace pv {
 namespace view {
index ae4f11e29eca7195b0bd720c599a262fbfcc5784..e240ebad751307e15cfcc926e9f2481f2a092f22 100644 (file)
 #include "pv/data/logicsnapshot.h"
 #include "pv/view/view.h"
 
 #include "pv/data/logicsnapshot.h"
 #include "pv/view/view.h"
 
-using namespace boost;
-using namespace std;
+using boost::shared_ptr;
+using std::deque;
+using std::max;
+using std::min;
+using std::pair;
+using std::vector;
 
 namespace pv {
 namespace view {
 
 namespace pv {
 namespace view {
index 8d7569e35b427769c191b76d0b50c009116ea156..aec3de979cf5171062df6777e78a42aaf4c74b03 100644 (file)
@@ -37,8 +37,8 @@
 
 #include <pv/widgets/popup.h>
 
 
 #include <pv/widgets/popup.h>
 
-using namespace boost;
-using namespace std;
+using namespace Qt;
+using boost::shared_ptr;
 
 namespace pv {
 namespace view {
 
 namespace pv {
 namespace view {
@@ -92,7 +92,6 @@ QSize Ruler::sizeHint() const
 
 void Ruler::paintEvent(QPaintEvent*)
 {
 
 void Ruler::paintEvent(QPaintEvent*)
 {
-       using namespace Qt;
 
        const double SpacingIncrement = 32.0f;
        const double MinValueSpacing = 32.0f;
 
        const double SpacingIncrement = 32.0f;
        const double MinValueSpacing = 32.0f;
index 2dabaa0eb24346add1889975a687e639350b649a..a5d280bdd97a18cf1f276cc9843a1f1f4ea6b463 100644 (file)
@@ -27,8 +27,6 @@
 
 #include <pv/widgets/popup.h>
 
 
 #include <pv/widgets/popup.h>
 
-using namespace std;
-
 namespace pv {
 namespace view {
 
 namespace pv {
 namespace view {
 
index 18ce679df877f030b2f35a11e208f9ef72e63bcd..438f72ddae02e018ab7f55c42f6c1645f0a94160 100644 (file)
 #include "pv/data/logic.h"
 #include "pv/data/logicsnapshot.h"
 
 #include "pv/data/logic.h"
 #include "pv/data/logicsnapshot.h"
 
-using namespace boost;
-using namespace std;
+using boost::shared_ptr;
+using boost::weak_ptr;
+using std::deque;
+using std::list;
+using std::max;
+using std::min;
+using std::set;
+using std::vector;
 
 namespace pv {
 namespace view {
 
 namespace pv {
 namespace view {
index 145f040fc93be7413d23458e6383c971304073a8..e9a1442217d7bc1bd600f6432e0002c7ed0543e3 100644 (file)
 
 #include <boost/foreach.hpp>
 
 
 #include <boost/foreach.hpp>
 
-using namespace boost;
-using namespace std;
+using boost::shared_ptr;
+using std::max;
+using std::min;
+using std::vector;
 
 namespace pv {
 namespace view {
 
 namespace pv {
 namespace view {
index 73ac1d84bd81eb5d268bd48c82492c6d84afc935..6857358a64c1e0e8c960656d5efa7e104acaf8ef 100644 (file)
@@ -26,7 +26,8 @@
 
 #include "popup.h"
 
 
 #include "popup.h"
 
-using namespace std;
+using std::max;
+using std::min;
 
 namespace pv {
 namespace widgets {
 
 namespace pv {
 namespace widgets {
index cd1fd773fc5759b1b6b6c87f57c300ed8b005937..4f32ebcafb4d56dbbc5491a915b6973995fe45fc 100644 (file)
@@ -27,8 +27,6 @@
 
 #include "../../pv/data/analogsnapshot.h"
 
 
 #include "../../pv/data/analogsnapshot.h"
 
-using namespace std;
-
 using pv::data::AnalogSnapshot;
 
 BOOST_AUTO_TEST_SUITE(AnalogSnapshotTest)
 using pv::data::AnalogSnapshot;
 
 BOOST_AUTO_TEST_SUITE(AnalogSnapshotTest)
index 84a496f1f2ada2c0292b425ec2efae0ebbf99e0d..d6e4f75a8a898dbbf3aea473690dcffdbbdbfb71 100644 (file)
 #include "../../pv/sigsession.h"
 #include "../../pv/view/decodetrace.h"
 
 #include "../../pv/sigsession.h"
 #include "../../pv/view/decodetrace.h"
 
-using namespace boost;
-using namespace std;
+using boost::shared_ptr;
+using pv::data::DecoderStack;
+using pv::data::decode::Decoder;
+using pv::view::DecodeTrace;
+using std::vector;
 
 BOOST_AUTO_TEST_SUITE(DecoderStackTest)
 
 BOOST_AUTO_TEST_CASE(TwoDecoderStack)
 {
 
 BOOST_AUTO_TEST_SUITE(DecoderStackTest)
 
 BOOST_AUTO_TEST_CASE(TwoDecoderStack)
 {
-       using namespace pv;
-
        sr_context *ctx = NULL;
 
        BOOST_REQUIRE(sr_init(&ctx) == SR_OK);
        sr_context *ctx = NULL;
 
        BOOST_REQUIRE(sr_init(&ctx) == SR_OK);
@@ -59,13 +60,13 @@ BOOST_AUTO_TEST_CASE(TwoDecoderStack)
                ss.add_decoder(dec);
 
                // Check the signals were created
                ss.add_decoder(dec);
 
                // Check the signals were created
-               const vector< shared_ptr<view::DecodeTrace> > sigs =
+               const vector< shared_ptr<DecodeTrace> > sigs =
                        ss.get_decode_signals();
 
                        ss.get_decode_signals();
 
-               shared_ptr<data::DecoderStack> dec0 = sigs[0]->decoder();
+               shared_ptr<DecoderStack> dec0 = sigs[0]->decoder();
                BOOST_REQUIRE(dec0);
 
                BOOST_REQUIRE(dec0);
 
-               shared_ptr<data::DecoderStack> dec1 = sigs[0]->decoder();
+               shared_ptr<DecoderStack> dec1 = sigs[0]->decoder();
                BOOST_REQUIRE(dec1);
 
                // Wait for the decode threads to complete
                BOOST_REQUIRE(dec1);
 
                // Wait for the decode threads to complete
index bbc7438338cf6a5df14ef18eebd2ef59c83417d1..8be915f02544bc6a8f10ade5f770438150c95357 100644 (file)
@@ -27,9 +27,8 @@
 
 #include "../../pv/data/logicsnapshot.h"
 
 
 #include "../../pv/data/logicsnapshot.h"
 
-using namespace std;
-
 using pv::data::LogicSnapshot;
 using pv::data::LogicSnapshot;
+using std::vector;
 
 BOOST_AUTO_TEST_SUITE(LogicSnapshotTest)
 
 
 BOOST_AUTO_TEST_SUITE(LogicSnapshotTest)