aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
authorNicholas Corgan <nick.corgan@ettus.com>2015-03-27 09:35:29 -0700
committerNicholas Corgan <nick.corgan@ettus.com>2015-03-27 09:35:29 -0700
commit1200721b696751edaceb70a332861f84fb8c16d5 (patch)
tree15a56b1a54b5b059779d00115a9f58af991035ac /host/examples
parenta712b026a806cd1c106d62fd9278536fcc0a8b62 (diff)
downloaduhd-1200721b696751edaceb70a332861f84fb8c16d5.tar.gz
uhd-1200721b696751edaceb70a332861f84fb8c16d5.tar.bz2
uhd-1200721b696751edaceb70a332861f84fb8c16d5.zip
Warning fixes
* CMake now not applying C++ flags to C files * GCC 4.4: anti-aliasing rules * MSVC: narrowing, differences in subclass function parameters * Clang: uninitialized variables
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/rx_samples_to_file.cpp2
-rw-r--r--host/examples/test_clock_synch.cpp14
-rw-r--r--host/examples/tx_samples_from_file.cpp4
3 files changed, 10 insertions, 10 deletions
diff --git a/host/examples/rx_samples_to_file.cpp b/host/examples/rx_samples_to_file.cpp
index 975a9da88..80b72de9c 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 7a4226345..9d1883665 100644
--- a/host/examples/test_clock_synch.cpp
+++ b/host/examples/test_clock_synch.cpp
@@ -35,14 +35,14 @@ using namespace uhd::usrp_clock;
using namespace uhd::usrp;
void wait_for_pps(multi_usrp::sptr usrp, size_t chan, double timeout){
- boost::uint32_t last_pps_time = usrp->get_time_last_pps(chan).get_full_secs();
- boost::uint32_t system_time = uhd::time_spec_t::get_system_time().get_full_secs();
- boost::uint32_t exit_time = system_time + 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 + time_t(timeout);
bool detected_pps = false;
//Otherwise, this would hang if the USRP doesn't detect any PPS
while(uhd::time_spec_t::get_system_time().get_full_secs() < exit_time){
- boost::uint32_t time_now = usrp->get_time_last_pps(chan).get_full_secs();
+ time_t time_now = usrp->get_time_last_pps(chan).get_full_secs();
if(last_pps_time < time_now){
detected_pps = true;
break;
@@ -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;