aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2015-03-27 13:35:27 -0700
committerMartin Braun <martin.braun@ettus.com>2015-03-27 13:35:27 -0700
commit88ffeb35dadb3d10593be39c9eae2f90c4d7c008 (patch)
tree4dc3fb96097260c3eb46e45ebba39c17efb3af7a /host/examples
parent5b285598d367b936caf91b615e30e90af8af2a5d (diff)
parent1200721b696751edaceb70a332861f84fb8c16d5 (diff)
downloaduhd-88ffeb35dadb3d10593be39c9eae2f90c4d7c008.tar.gz
uhd-88ffeb35dadb3d10593be39c9eae2f90c4d7c008.tar.bz2
uhd-88ffeb35dadb3d10593be39c9eae2f90c4d7c008.zip
Merge branch 'maint'
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/rx_samples_to_file.cpp2
-rw-r--r--host/examples/test_clock_synch.cpp8
-rw-r--r--host/examples/tx_samples_from_file.cpp4
3 files changed, 7 insertions, 7 deletions
diff --git a/host/examples/rx_samples_to_file.cpp b/host/examples/rx_samples_to_file.cpp
index f71c4ed47..934dce586 100644
--- a/host/examples/rx_samples_to_file.cpp
+++ b/host/examples/rx_samples_to_file.cpp
@@ -64,7 +64,7 @@ template<typename samp_type> void recv_to_file(
uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS:
uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE
);
- stream_cmd.num_samps = num_requested_samples;
+ stream_cmd.num_samps = size_t(num_requested_samples);
stream_cmd.stream_now = true;
stream_cmd.time_spec = uhd::time_spec_t();
rx_stream->issue_stream_cmd(stream_cmd);
diff --git a/host/examples/test_clock_synch.cpp b/host/examples/test_clock_synch.cpp
index 50a1444f8..9d1883665 100644
--- a/host/examples/test_clock_synch.cpp
+++ b/host/examples/test_clock_synch.cpp
@@ -37,7 +37,7 @@ using namespace uhd::usrp;
void wait_for_pps(multi_usrp::sptr usrp, size_t chan, double timeout){
time_t last_pps_time = usrp->get_time_last_pps(chan).get_full_secs();
time_t system_time = uhd::time_spec_t::get_system_time().get_full_secs();
- time_t exit_time = system_time + timeout;
+ time_t exit_time = system_time + time_t(timeout);
bool detected_pps = false;
//Otherwise, this would hang if the USRP doesn't detect any PPS
@@ -54,7 +54,7 @@ void wait_for_pps(multi_usrp::sptr usrp, size_t chan, double timeout){
}
-void get_usrp_time(multi_usrp::sptr usrp, size_t chan, std::vector<boost::uint32_t> *times){
+void get_usrp_time(multi_usrp::sptr usrp, size_t chan, std::vector<time_t> *times){
wait_for_pps(usrp, chan, 2);
(*times)[chan] = usrp->get_time_now(chan).get_full_secs();
}
@@ -130,7 +130,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//Wait for next PPS to start polling
wait_for_pps(usrp, 0, 2);
- srand(time(NULL));
+ srand((unsigned int)time(NULL));
std::cout << boost::format("\nRunning %d comparisons at random intervals.") % num_tests << std::endl << std::endl;
boost::uint32_t num_matches = 0;
@@ -140,7 +140,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
boost::this_thread::sleep(boost::posix_time::milliseconds(wait_time));
//Get all times before output
- std::vector<boost::uint32_t> usrp_times(usrp->get_num_mboards());
+ std::vector<time_t> usrp_times(usrp->get_num_mboards());
boost::thread_group thread_group;
clock_time = clock->get_time();
for(size_t j = 0; j < usrp->get_num_mboards(); j++){
diff --git a/host/examples/tx_samples_from_file.cpp b/host/examples/tx_samples_from_file.cpp
index e9d0e8721..cc7e963d5 100644
--- a/host/examples/tx_samples_from_file.cpp
+++ b/host/examples/tx_samples_from_file.cpp
@@ -55,7 +55,7 @@ template<typename samp_type> void send_from_file(
while(not md.end_of_burst and not stop_signal_called){
infile.read((char*)&buff.front(), buff.size()*sizeof(samp_type));
- size_t num_tx_samps = infile.gcount()/sizeof(samp_type);
+ size_t num_tx_samps = size_t(infile.gcount()/sizeof(samp_type));
md.end_of_burst = infile.eof();
@@ -104,7 +104,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
return ~0;
}
- bool repeat = vm.count("repeat");
+ bool repeat = vm.count("repeat") > 0;
//create a usrp device
std::cout << std::endl;