From 895cbcdd3cc420342f6c293a2713be0b808397c1 Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Sat, 1 Jul 2017 23:57:34 +0200 Subject: [PATCH] Bindings: constify data pointer --- bindings/cxx/classes.cpp | 4 ++-- bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/cxx/classes.cpp b/bindings/cxx/classes.cpp index 03a4ce11..c17a2ee5 100644 --- a/bindings/cxx/classes.cpp +++ b/bindings/cxx/classes.cpp @@ -305,7 +305,7 @@ shared_ptr Context::create_logic_packet( shared_ptr Context::create_analog_packet( vector > 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 mqflags) { auto analog = g_new0(struct sr_datafeed_analog, 1); @@ -343,7 +343,7 @@ shared_ptr 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; diff --git a/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp b/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp index 736a437c..f20c4dc8 100644 --- a/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp +++ b/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp @@ -283,7 +283,7 @@ public: /** Create an analog packet. */ shared_ptr create_analog_packet( vector > 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 mqflags); /** Load a saved session. * @param filename File name string. */