Bindings: constify data pointer

This commit is contained in:
Soeren Apel 2017-07-01 23:57:34 +02:00 committed by Uwe Hermann
parent 8b9fa09859
commit 895cbcdd3c
2 changed files with 3 additions and 3 deletions

View File

@ -305,7 +305,7 @@ shared_ptr<Packet> Context::create_logic_packet(
shared_ptr<Packet> Context::create_analog_packet( shared_ptr<Packet> Context::create_analog_packet(
vector<shared_ptr<Channel> > channels, 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) const Unit *unit, vector<const QuantityFlag *> mqflags)
{ {
auto analog = g_new0(struct sr_datafeed_analog, 1); auto analog = g_new0(struct sr_datafeed_analog, 1);
@ -343,7 +343,7 @@ shared_ptr<Packet> Context::create_analog_packet(
spec->spec_digits = 0; spec->spec_digits = 0;
analog->num_samples = num_samples; analog->num_samples = num_samples;
analog->data = data_pointer; analog->data = (float*)data_pointer;
auto packet = g_new(struct sr_datafeed_packet, 1); auto packet = g_new(struct sr_datafeed_packet, 1);
packet->type = SR_DF_ANALOG; packet->type = SR_DF_ANALOG;
packet->payload = analog; packet->payload = analog;

View File

@ -283,7 +283,7 @@ public:
/** Create an analog packet. */ /** Create an analog packet. */
shared_ptr<Packet> create_analog_packet( shared_ptr<Packet> create_analog_packet(
vector<shared_ptr<Channel> > channels, 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); const Unit *unit, vector<const QuantityFlag *> mqflags);
/** Load a saved session. /** Load a saved session.
* @param filename File name string. */ * @param filename File name string. */