]> sigrok.org Git - libsigrok.git/commitdiff
Revert API/ABI change for Context::create_analog_packet().
authorUwe Hermann <redacted>
Sun, 14 Oct 2018 18:18:40 +0000 (20:18 +0200)
committerUwe Hermann <redacted>
Sun, 14 Oct 2018 20:40:09 +0000 (22:40 +0200)
This is fine in libsigrokcxx mainline, but for the 0.5.x series we need
to remain API/ABI-compatible.

bindings/cxx/classes.cpp
bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp

index 5bc5dc2fed78f594d0605f4a58bdd644ccfb0239..cdf7fd359d2f9f471ac661b7ff3a0bf81f547316 100644 (file)
@@ -332,7 +332,7 @@ shared_ptr<Packet> Context::create_logic_packet(
 
 shared_ptr<Packet> Context::create_analog_packet(
        vector<shared_ptr<Channel> > channels,
-       const float *data_pointer, unsigned int num_samples, const Quantity *mq,
+       float *data_pointer, unsigned int num_samples, const Quantity *mq,
        const Unit *unit, vector<const QuantityFlag *> mqflags)
 {
        auto analog = g_new0(struct sr_datafeed_analog, 1);
@@ -370,7 +370,7 @@ shared_ptr<Packet> Context::create_analog_packet(
        spec->spec_digits = 0;
 
        analog->num_samples = num_samples;
-       analog->data = (float*)data_pointer;
+       analog->data = data_pointer;
        auto packet = g_new(struct sr_datafeed_packet, 1);
        packet->type = SR_DF_ANALOG;
        packet->payload = analog;
index 80888af61c5064a81c97110af4e6568740126371..ba346315d7b19a64cfd4351139bb24570431d3c9 100644 (file)
@@ -285,7 +285,7 @@ public:
        /** Create an analog packet. */
        shared_ptr<Packet> create_analog_packet(
                vector<shared_ptr<Channel> > channels,
-               const float *data_pointer, unsigned int num_samples, const Quantity *mq,
+               float *data_pointer, unsigned int num_samples, const Quantity *mq,
                const Unit *unit, vector<const QuantityFlag *> mqflags);
        /** Load a saved session.
         * @param filename File name string. */