]> sigrok.org Git - pulseview.git/commitdiff
Fix compile issues with some compiler versions
authorSoeren Apel <redacted>
Thu, 21 May 2020 20:29:30 +0000 (22:29 +0200)
committerUwe Hermann <redacted>
Thu, 21 May 2020 22:04:14 +0000 (00:04 +0200)
pv/data/decode/annotation.cpp
pv/data/decode/annotation.hpp
pv/data/decode/decoder.hpp
pv/data/decode/row.hpp
pv/data/decode/rowdata.cpp
pv/views/trace/decodetrace.cpp
pv/views/trace/decodetrace.hpp

index b1dc6ef66c17efa6f44bd416bf546261380f2636..7f2334788f70f93c2a734d680c90d6a8b957d293 100644 (file)
@@ -35,7 +35,7 @@ namespace data {
 namespace decode {
 
 Annotation::Annotation(uint64_t start_sample, uint64_t end_sample,
 namespace decode {
 
 Annotation::Annotation(uint64_t start_sample, uint64_t end_sample,
-       const vector<QString>* texts, Class ann_class_id, const RowData *data) :
+       const vector<QString>* texts, uint32_t ann_class_id, const RowData *data) :
        start_sample_(start_sample),
        end_sample_(end_sample),
        texts_(texts),
        start_sample_(start_sample),
        end_sample_(end_sample),
        texts_(texts),
@@ -91,7 +91,7 @@ uint64_t Annotation::length() const
        return end_sample_ - start_sample_;
 }
 
        return end_sample_ - start_sample_;
 }
 
-Annotation::Class Annotation::ann_class_id() const
+uint32_t Annotation::ann_class_id() const
 {
        return ann_class_id_;
 }
 {
        return ann_class_id_;
 }
index edc27bee4dfa52947477980622e137863aaa14f2..717206a4b97b06b6f73eecb09b315002ebf6db0f 100644 (file)
@@ -26,6 +26,8 @@
 #include <QColor>
 #include <QString>
 
 #include <QColor>
 #include <QString>
 
+#include "pv/data/decode/row.hpp"
+
 using std::vector;
 
 struct srd_proto_data;
 using std::vector;
 
 struct srd_proto_data;
@@ -34,17 +36,13 @@ namespace pv {
 namespace data {
 namespace decode {
 
 namespace data {
 namespace decode {
 
-class Row;
 class RowData;
 
 class Annotation
 {
 class RowData;
 
 class Annotation
 {
-public:
-       typedef uint32_t Class;
-
 public:
        Annotation(uint64_t start_sample, uint64_t end_sample,
 public:
        Annotation(uint64_t start_sample, uint64_t end_sample,
-               const vector<QString>* texts, Class ann_class_id, const RowData *data);
+               const vector<QString>* texts, uint32_t ann_class_id, const RowData *data);
        Annotation(Annotation&& a);
        Annotation& operator=(Annotation&& a);
 
        Annotation(Annotation&& a);
        Annotation& operator=(Annotation&& a);
 
@@ -55,7 +53,7 @@ public:
        uint64_t end_sample() const;
        uint64_t length() const;
 
        uint64_t end_sample() const;
        uint64_t length() const;
 
-       Class ann_class_id() const;
+       uint32_t ann_class_id() const;
        const QString ann_class_name() const;
        const QString ann_class_description() const;
 
        const QString ann_class_name() const;
        const QString ann_class_description() const;
 
@@ -74,7 +72,7 @@ private:
        uint64_t start_sample_;
        uint64_t end_sample_;
        const vector<QString>* texts_;
        uint64_t start_sample_;
        uint64_t end_sample_;
        const vector<QString>* texts_;
-       Class ann_class_id_;
+       uint32_t ann_class_id_;
        const RowData* data_;
 };
 
        const RowData* data_;
 };
 
index 2c4337478135fdc40d63c82c63316a59617f188e..6e11e83f374e23e4c4487ff2cd2148fbb0143ddc 100644 (file)
 
 #include <QObject>
 
 
 #include <QObject>
 
-#include <pv/data/signalbase.hpp>
 #include <pv/data/decode/row.hpp>
 
 using std::deque;
 using std::map;
 #include <pv/data/decode/row.hpp>
 
 using std::deque;
 using std::map;
+using std::shared_ptr;
 using std::string;
 using std::vector;
 
 using std::string;
 using std::vector;
 
index 8e76dfa0b64d9a10ac555419cc752cbbbce16b88..80aa114c1edb8dde8514c67f7ee67139a55c0d91 100644 (file)
 #ifndef PULSEVIEW_PV_DATA_DECODE_ROW_HPP
 #define PULSEVIEW_PV_DATA_DECODE_ROW_HPP
 
 #ifndef PULSEVIEW_PV_DATA_DECODE_ROW_HPP
 #define PULSEVIEW_PV_DATA_DECODE_ROW_HPP
 
+#include <map>
 #include <vector>
 
 #include <vector>
 
+#include <QObject>
 #include <QColor>
 
 #include <QColor>
 
-#include <pv/data/decode/annotation.hpp>
-#include <pv/data/decode/decoder.hpp>
-
 struct srd_decoder;
 struct srd_decoder_annotation_row;
 
 struct srd_decoder;
 struct srd_decoder_annotation_row;
 
+using std::map;
+using std::vector;
+
 namespace pv {
 namespace data {
 namespace decode {
 namespace pv {
 namespace data {
 namespace decode {
index a9c2e2a883b8eee89dbc518e8bb18aae25bb8607..3d250f49472eb03194d1001c6dd693c2ef644ae2 100644 (file)
@@ -104,7 +104,7 @@ const Annotation* RowData::emplace_annotation(srd_proto_data *pdata)
 {
        const srd_proto_data_annotation *const pda = (const srd_proto_data_annotation*)pdata->data;
 
 {
        const srd_proto_data_annotation *const pda = (const srd_proto_data_annotation*)pdata->data;
 
-       Annotation::Class ann_class_id = (Annotation::Class)(pda->ann_class);
+       uint32_t ann_class_id = pda->ann_class;
 
        // Look up the longest annotation text to see if we have it in storage.
        // This implies that if the longest text is the same, the shorter texts
 
        // Look up the longest annotation text to see if we have it in storage.
        // This implies that if the longest text is the same, the shorter texts
index 0b09439bb8bb4e28976b30102995aa5e60607d8d..d9b4691b310e883816a4bfd373cf93644608708a 100644 (file)
@@ -697,7 +697,7 @@ void DecodeTrace::mouse_left_press_event(const QMouseEvent* event)
 void DecodeTrace::draw_annotations(deque<const Annotation*>& annotations,
                QPainter &p, const ViewItemPaintParams &pp, int y, const DecodeTraceRow& row)
 {
 void DecodeTrace::draw_annotations(deque<const Annotation*>& annotations,
                QPainter &p, const ViewItemPaintParams &pp, int y, const DecodeTraceRow& row)
 {
-       Annotation::Class block_class = 0;
+       uint32_t block_class = 0;
        bool block_class_uniform = true;
        qreal block_start = 0;
        int block_ann_count = 0;
        bool block_class_uniform = true;
        qreal block_start = 0;
        int block_ann_count = 0;
@@ -802,7 +802,7 @@ void DecodeTrace::draw_annotation(const Annotation* a, QPainter &p,
 }
 
 void DecodeTrace::draw_annotation_block(qreal start, qreal end,
 }
 
 void DecodeTrace::draw_annotation_block(qreal start, qreal end,
-       Annotation::Class ann_class, bool use_ann_format, QPainter &p, int y,
+       uint32_t ann_class, bool use_ann_format, QPainter &p, int y,
        const DecodeTraceRow& row) const
 {
        const double top = y + .5 - annotation_height_ / 2;
        const DecodeTraceRow& row) const
 {
        const double top = y + .5 - annotation_height_ / 2;
index 4d6d4f8e883cdc897a0c812bea406d0dfbdb5c56..4a65d5ba24f53509c497fb9cd004dc3b814e3c02 100644 (file)
@@ -198,7 +198,7 @@ private:
        void draw_annotation(const Annotation* a, QPainter &p,
                const ViewItemPaintParams &pp, int y, const DecodeTraceRow& row) const;
 
        void draw_annotation(const Annotation* a, QPainter &p,
                const ViewItemPaintParams &pp, int y, const DecodeTraceRow& row) const;
 
-       void draw_annotation_block(qreal start, qreal end, Annotation::Class ann_class,
+       void draw_annotation_block(qreal start, qreal end, uint32_t ann_class,
                bool use_ann_format, QPainter &p, int y, const DecodeTraceRow& row) const;
 
        void draw_instant(const Annotation* a, QPainter &p, qreal x, int y) const;
                bool use_ann_format, QPainter &p, int y, const DecodeTraceRow& row) const;
 
        void draw_instant(const Annotation* a, QPainter &p, qreal x, int y) const;