commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 14/50: controlport: Thrift's binary type


From: git
Subject: [Commit-gnuradio] [gnuradio] 14/50: controlport: Thrift's binary type
Date: Wed, 15 Apr 2015 21:07:53 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 6dd37d48d3b24997ec95f2302df75deef4211fa3
Author: Nate Goergen <address@hidden>
Date:   Sat Feb 28 21:45:15 2015 -0600

    controlport: Thrift's binary type
    
    * Convert list<byte> "VectorC" to use Thrift 'binary' data type for 
efficiency
---
 gnuradio-runtime/lib/controlport/thrift/gnuradio.thrift            | 2 +-
 gnuradio-runtime/lib/controlport/thrift/rpcpmtconverters_thrift.cc | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnuradio-runtime/lib/controlport/thrift/gnuradio.thrift 
b/gnuradio-runtime/lib/controlport/thrift/gnuradio.thrift
index f261229..66fbd63 100644
--- a/gnuradio-runtime/lib/controlport/thrift/gnuradio.thrift
+++ b/gnuradio-runtime/lib/controlport/thrift/gnuradio.thrift
@@ -28,7 +28,7 @@ struct complex {
 }
 
 typedef list<bool>    VectorB
-typedef list<byte>    VectorC
+typedef binary        VectorC
 typedef list<i16>     VectorT
 typedef list<i32>     VectorI
 typedef list<i64>     VectorL
diff --git a/gnuradio-runtime/lib/controlport/thrift/rpcpmtconverters_thrift.cc 
b/gnuradio-runtime/lib/controlport/thrift/rpcpmtconverters_thrift.cc
index 27573af..9541f18 100644
--- a/gnuradio-runtime/lib/controlport/thrift/rpcpmtconverters_thrift.cc
+++ b/gnuradio-runtime/lib/controlport/thrift/rpcpmtconverters_thrift.cc
@@ -113,7 +113,7 @@ rpcpmtconverter::from_pmt(const pmt::pmt_t& knob)
     result.type = GNURadio::BaseTypes::S8VECTOR;
     size_t size(pmt::length(knob));
     const int8_t* start((const int8_t*)pmt::s8vector_elements(knob,size));
-    result.value.__set_a_s8vector(std::vector<int8_t>(start,start+size));
+    result.value.__set_a_s8vector(std::basic_string<char>(start,start+size));
     return result;
   }
   else if(pmt::is_c32vector(knob)) {
@@ -193,8 +193,8 @@ rpcpmtconverter::to_pmt(const GNURadio::Knob& knob)
     return pmt::init_s16vector(v.size(), v);
   }
   else if(knob.type == GNURadio::BaseTypes::S8VECTOR) {
-    std::vector<int8_t> v = knob.value.a_s8vector;
-    return pmt::init_s8vector(v.size(), v);
+         std::basic_string<char> v = knob.value.a_s8vector;
+       return pmt::init_s8vector(v.size(), reinterpret_cast<const 
int8_t*>(v.data()));
   }
   else if(knob.type == GNURadio::BaseTypes::C32VECTOR) {
     std::vector<GNURadio::complex> v0 = knob.value.a_c32vector;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]