]> sigrok.org Git - libsigrok.git/commitdiff
Bindings: constify data pointer
authorSoeren Apel <redacted>
Sat, 1 Jul 2017 21:57:34 +0000 (23:57 +0200)
committerUwe Hermann <redacted>
Wed, 5 Jul 2017 22:07:30 +0000 (00:07 +0200)
bindings/cxx/classes.cpp
bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp

index 03a4ce115ca06e4f10567defbf74b48e220fca4e..c17a2ee524efad9ebcd62e7006eeeedc41829bc5 100644 (file)
@@ -305,7 +305,7 @@ shared_ptr<Packet> Context::create_logic_packet(
 
 shared_ptr<Packet> Context::create_analog_packet(
        vector<shared_ptr<Channel> > channels,
-       float *data_pointer, unsigned int num_samples, const Quantity *mq,
+       const 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);
@@ -343,7 +343,7 @@ shared_ptr<Packet> Context::create_analog_packet(
        spec->spec_digits = 0;
 
        analog->num_samples = num_samples;
-       analog->data = data_pointer;
+       analog->data = (float*)data_pointer;
        auto packet = g_new(struct sr_datafeed_packet, 1);
        packet->type = SR_DF_ANALOG;
        packet->payload = analog;
index 736a437c5518f196f030e647d23726958b191b7d..f20c4dc8e86c1005d35933a74f191bb59722797f 100644 (file)
@@ -283,7 +283,7 @@ public:
        /** Create an analog packet. */
        shared_ptr<Packet> create_analog_packet(
                vector<shared_ptr<Channel> > channels,
-               float *data_pointer, unsigned int num_samples, const Quantity *mq,
+               const 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. */