summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib/general
diff options
context:
space:
mode:
authorNicholas Corgan2013-02-18 12:25:35 -0800
committerNicholas Corgan2013-02-18 12:25:35 -0800
commitb781ad0a911e042a06efa5881bd9c3b8e789edcc (patch)
tree2890eb5da12ffa6c98439f4b47ee76668a70d893 /gnuradio-core/src/lib/general
parent6408376d7a1b59533100870bd2d1c392bfbf7864 (diff)
downloadgnuradio-b781ad0a911e042a06efa5881bd9c3b8e789edcc.tar.gz
gnuradio-b781ad0a911e042a06efa5881bd9c3b8e789edcc.tar.bz2
gnuradio-b781ad0a911e042a06efa5881bd9c3b8e789edcc.zip
core: fixed gr_random_pdu MSVC incompatibility issue
Diffstat (limited to 'gnuradio-core/src/lib/general')
-rw-r--r--gnuradio-core/src/lib/general/gr_random_pdu.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/gnuradio-core/src/lib/general/gr_random_pdu.cc b/gnuradio-core/src/lib/general/gr_random_pdu.cc
index 9f692c72b..6d8c13614 100644
--- a/gnuradio-core/src/lib/general/gr_random_pdu.cc
+++ b/gnuradio-core/src/lib/general/gr_random_pdu.cc
@@ -34,6 +34,7 @@
#include <stdexcept>
#include <string.h>
#include <iostream>
+#include <vector>
// public constructor that returns a shared_ptr
@@ -68,13 +69,13 @@ void gr_random_pdu::output_random(){
int len = rvar();
// fill it with random bytes
- unsigned char vec[len];
+ std::vector<unsigned char> vec;
for(int i=0; i<len; i++){
- vec[i] = (unsigned char) bvar();
+ vec.push_back((unsigned char) bvar());
}
// send the vector
- pmt::pmt_t vecpmt( pmt::pmt_make_blob( vec, len ) );
+ pmt::pmt_t vecpmt( pmt::pmt_make_blob( &vec[0], len ) );
pmt::pmt_t pdu( pmt::pmt_cons( pmt::PMT_NIL, vecpmt ) );
message_port_pub( pmt::mp("pdus"), pdu );