aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
Diffstat (limited to 'host')
-rw-r--r--host/examples/benchmark_rate.cpp3
-rw-r--r--host/examples/latency_test.cpp2
-rw-r--r--host/examples/network_relay.cpp5
-rw-r--r--host/examples/rx_ascii_art_dft.cpp9
-rw-r--r--host/examples/rx_multi_samples.cpp2
-rw-r--r--host/examples/rx_samples_to_file.cpp2
-rw-r--r--host/examples/rx_samples_to_udp.cpp2
-rw-r--r--host/examples/rx_timed_samples.cpp2
-rw-r--r--host/examples/test_dboard_coercion.cpp2
-rw-r--r--host/examples/test_messages.cpp2
-rw-r--r--host/examples/test_pps_input.cpp2
-rw-r--r--host/examples/test_timed_commands.cpp2
-rw-r--r--host/examples/transport_hammer.cpp2
-rw-r--r--host/examples/tx_bursts.cpp2
-rw-r--r--host/examples/tx_samples_from_file.cpp2
-rw-r--r--host/examples/tx_timed_samples.cpp2
-rw-r--r--host/examples/tx_waveforms.cpp2
-rw-r--r--host/examples/txrx_loopback_to_file.cpp2
-rw-r--r--host/utils/fx2_init_eeprom.cpp8
-rw-r--r--host/utils/uhd_cal_rx_iq_balance.cpp5
-rw-r--r--host/utils/uhd_cal_tx_dc_offset.cpp4
-rw-r--r--host/utils/uhd_cal_tx_iq_balance.cpp5
-rw-r--r--host/utils/uhd_find_devices.cpp7
-rw-r--r--host/utils/uhd_usrp_probe.cpp9
-rw-r--r--host/utils/usrp_burn_db_eeprom.cpp4
-rw-r--r--host/utils/usrp_burn_mb_eeprom.cpp6
-rw-r--r--host/utils/usrp_n2xx_simple_net_burner.cpp10
27 files changed, 56 insertions, 49 deletions
diff --git a/host/examples/benchmark_rate.cpp b/host/examples/benchmark_rate.cpp
index 8a000f6c3..ed3a8580a 100644
--- a/host/examples/benchmark_rate.cpp
+++ b/host/examples/benchmark_rate.cpp
@@ -25,6 +25,7 @@
#include <boost/math/special_functions/round.hpp>
#include <iostream>
#include <complex>
+#include <cstdlib>
namespace po = boost::program_options;
@@ -264,5 +265,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/latency_test.cpp b/host/examples/latency_test.cpp
index 518d2383a..461ac9bf8 100644
--- a/host/examples/latency_test.cpp
+++ b/host/examples/latency_test.cpp
@@ -164,5 +164,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
**************************************************************/
std::cout << boost::format("\nACK %d, UNDERFLOW %d, TIME_ERR %d, other %d")
% ack % underflow % time_error % other << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/network_relay.cpp b/host/examples/network_relay.cpp
index e8f9e667f..bb09296b3 100644
--- a/host/examples/network_relay.cpp
+++ b/host/examples/network_relay.cpp
@@ -24,6 +24,7 @@
#include <iostream>
#include <csignal>
#include <vector>
+#include <cstdlib>
namespace po = boost::program_options;
namespace asio = boost::asio;
@@ -202,7 +203,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
<< "Runs a network relay between UHD on one computer and a USRP on the network.\n"
<< "This example is basically for test purposes. Use at your own convenience.\n"
<< std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
{
@@ -223,5 +224,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/rx_ascii_art_dft.cpp b/host/examples/rx_ascii_art_dft.cpp
index fe8fb0347..1aede51a4 100644
--- a/host/examples/rx_ascii_art_dft.cpp
+++ b/host/examples/rx_ascii_art_dft.cpp
@@ -25,6 +25,7 @@
#include <curses.h>
#include <iostream>
#include <complex>
+#include <cstdlib>
namespace po = boost::program_options;
@@ -63,7 +64,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//print the help message
if (vm.count("help") or not vm.count("rate")){
std::cout << boost::format("UHD RX ASCII Art DFT %s") % desc << std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
//create a usrp device
@@ -82,7 +83,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//set the sample rate
if (not vm.count("rate")){
std::cerr << "Please specify the sample rate with --rate" << std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
std::cout << boost::format("Setting RX Rate: %f Msps...") % (rate/1e6) << std::endl;
usrp->set_rx_rate(rate);
@@ -91,7 +92,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//set the center frequency
if (not vm.count("freq")){
std::cerr << "Please specify the center frequency with --freq" << std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
std::cout << boost::format("Setting RX Freq: %f MHz...") % (freq/1e6) << std::endl;
usrp->set_rx_freq(freq);
@@ -194,5 +195,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/rx_multi_samples.cpp b/host/examples/rx_multi_samples.cpp
index 42ef33d70..83d648eb5 100644
--- a/host/examples/rx_multi_samples.cpp
+++ b/host/examples/rx_multi_samples.cpp
@@ -174,5 +174,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/rx_samples_to_file.cpp b/host/examples/rx_samples_to_file.cpp
index 5197bfe69..d0a02a6c1 100644
--- a/host/examples/rx_samples_to_file.cpp
+++ b/host/examples/rx_samples_to_file.cpp
@@ -214,5 +214,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/rx_samples_to_udp.cpp b/host/examples/rx_samples_to_udp.cpp
index 42b80762f..105db0a02 100644
--- a/host/examples/rx_samples_to_udp.cpp
+++ b/host/examples/rx_samples_to_udp.cpp
@@ -168,5 +168,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/rx_timed_samples.cpp b/host/examples/rx_timed_samples.cpp
index 143bceb03..f0d49b4bd 100644
--- a/host/examples/rx_timed_samples.cpp
+++ b/host/examples/rx_timed_samples.cpp
@@ -124,5 +124,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/test_dboard_coercion.cpp b/host/examples/test_dboard_coercion.cpp
index 5b1e9f0e2..cfc745147 100644
--- a/host/examples/test_dboard_coercion.cpp
+++ b/host/examples/test_dboard_coercion.cpp
@@ -573,5 +573,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
if(test_tx and test_rx) std::cout << std::endl;
if(test_rx) std::cout << rx_results << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/test_messages.cpp b/host/examples/test_messages.cpp
index afb092092..6f2ddfe28 100644
--- a/host/examples/test_messages.cpp
+++ b/host/examples/test_messages.cpp
@@ -350,5 +350,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/test_pps_input.cpp b/host/examples/test_pps_input.cpp
index 994b7ca87..c07f2fffd 100644
--- a/host/examples/test_pps_input.cpp
+++ b/host/examples/test_pps_input.cpp
@@ -58,5 +58,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::cout << std::endl << "Attempt to detect the PPS and set the time..." << std::endl << std::endl;
usrp->set_time_unknown_pps(uhd::time_spec_t(0.0));
std::cout << std::endl << "Success!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/test_timed_commands.cpp b/host/examples/test_timed_commands.cpp
index 34c83dfd6..cecf1607c 100644
--- a/host/examples/test_timed_commands.cpp
+++ b/host/examples/test_timed_commands.cpp
@@ -125,5 +125,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/transport_hammer.cpp b/host/examples/transport_hammer.cpp
index e32912eaa..ff35ceb21 100644
--- a/host/examples/transport_hammer.cpp
+++ b/host/examples/transport_hammer.cpp
@@ -272,5 +272,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/tx_bursts.cpp b/host/examples/tx_bursts.cpp
index 4cf5f2fd1..8dd4a002c 100644
--- a/host/examples/tx_bursts.cpp
+++ b/host/examples/tx_bursts.cpp
@@ -156,5 +156,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/tx_samples_from_file.cpp b/host/examples/tx_samples_from_file.cpp
index 04a6a63d4..f9447c25d 100644
--- a/host/examples/tx_samples_from_file.cpp
+++ b/host/examples/tx_samples_from_file.cpp
@@ -192,5 +192,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/tx_timed_samples.cpp b/host/examples/tx_timed_samples.cpp
index 3b8cc75d4..4cc31a7c0 100644
--- a/host/examples/tx_timed_samples.cpp
+++ b/host/examples/tx_timed_samples.cpp
@@ -124,5 +124,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp
index 3c5eecd65..40326ae93 100644
--- a/host/examples/tx_waveforms.cpp
+++ b/host/examples/tx_waveforms.cpp
@@ -260,5 +260,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/examples/txrx_loopback_to_file.cpp b/host/examples/txrx_loopback_to_file.cpp
index 495c9f7e4..9dc348da8 100644
--- a/host/examples/txrx_loopback_to_file.cpp
+++ b/host/examples/txrx_loopback_to_file.cpp
@@ -443,5 +443,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//finished
std::cout << std::endl << "Done!" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/utils/fx2_init_eeprom.cpp b/host/utils/fx2_init_eeprom.cpp
index c210ae575..701092a5d 100644
--- a/host/utils/fx2_init_eeprom.cpp
+++ b/host/utils/fx2_init_eeprom.cpp
@@ -41,12 +41,12 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
- po::notify(vm);
+ po::notify(vm);
//print the help message
if (vm.count("help")){
std::cout << boost::format("USRP EEPROM initialization %s") % desc << std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
//cant find a uninitialized usrp with this mystery module in the way...
@@ -76,7 +76,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
if (found_addrs.size() == 0){
std::cerr << "No USRP devices found" << std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
for (size_t i = 0; i < found_addrs.size(); i++){
@@ -89,5 +89,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::cout << "Power-cycle the usrp for the changes to take effect." << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/utils/uhd_cal_rx_iq_balance.cpp b/host/utils/uhd_cal_rx_iq_balance.cpp
index 7b6f10f3b..ab951b754 100644
--- a/host/utils/uhd_cal_rx_iq_balance.cpp
+++ b/host/utils/uhd_cal_rx_iq_balance.cpp
@@ -29,6 +29,7 @@
#include <complex>
#include <cmath>
#include <ctime>
+#include <cstdlib>
namespace po = boost::program_options;
@@ -120,7 +121,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::cout <<
"This application measures leakage between RX and TX on an XCVR daughterboard to self-calibrate.\n"
<< std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
//create a usrp device
@@ -236,5 +237,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
store_results(usrp, results, "RX", "rx", "iq");
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/utils/uhd_cal_tx_dc_offset.cpp b/host/utils/uhd_cal_tx_dc_offset.cpp
index 1b2510ba4..152f61918 100644
--- a/host/utils/uhd_cal_tx_dc_offset.cpp
+++ b/host/utils/uhd_cal_tx_dc_offset.cpp
@@ -123,7 +123,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::cout <<
"This application measures leakage between RX and TX on an XCVR daughterboard to self-calibrate.\n"
<< std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
//create a usrp device
@@ -234,5 +234,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
store_results(usrp, results, "TX", "tx", "dc");
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/utils/uhd_cal_tx_iq_balance.cpp b/host/utils/uhd_cal_tx_iq_balance.cpp
index cff3d1646..4c8642660 100644
--- a/host/utils/uhd_cal_tx_iq_balance.cpp
+++ b/host/utils/uhd_cal_tx_iq_balance.cpp
@@ -28,6 +28,7 @@
#include <iostream>
#include <complex>
#include <ctime>
+#include <cstdlib>
namespace po = boost::program_options;
@@ -123,7 +124,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::cout <<
"This application measures leakage between RX and TX on an XCVR daughterboard to self-calibrate.\n"
<< std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
//create a usrp device
@@ -239,5 +240,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
store_results(usrp, results, "TX", "tx", "iq");
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/utils/uhd_find_devices.cpp b/host/utils/uhd_find_devices.cpp
index b778eeb68..c258c580e 100644
--- a/host/utils/uhd_find_devices.cpp
+++ b/host/utils/uhd_find_devices.cpp
@@ -20,6 +20,7 @@
#include <boost/program_options.hpp>
#include <boost/format.hpp>
#include <iostream>
+#include <cstdlib>
namespace po = boost::program_options;
@@ -37,7 +38,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//print the help message
if (vm.count("help")){
std::cout << boost::format("UHD Find Devices %s") % desc << std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
//discover the usrps and print the results
@@ -45,7 +46,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
if (device_addrs.size() == 0){
std::cerr << "No UHD Devices Found" << std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
for (size_t i = 0; i < device_addrs.size(); i++){
@@ -56,5 +57,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//uhd::device::make(device_addrs[i]); //test make
}
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/utils/uhd_usrp_probe.cpp b/host/utils/uhd_usrp_probe.cpp
index 5b3702fb4..736490f19 100644
--- a/host/utils/uhd_usrp_probe.cpp
+++ b/host/utils/uhd_usrp_probe.cpp
@@ -30,6 +30,7 @@
#include <iostream>
#include <sstream>
#include <vector>
+#include <cstdlib>
namespace po = boost::program_options;
using namespace uhd;
@@ -197,12 +198,12 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//print the help message
if (vm.count("help")){
std::cout << boost::format("UHD USRP Probe %s") % desc << std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
if (vm.count("version")){
std::cout << uhd::get_version_string() << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
device::sptr dev = device::make(vm["args"].as<std::string>());
@@ -210,11 +211,11 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
if (vm.count("string")){
std::cout << tree->access<std::string>(vm["string"].as<std::string>()).get() << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
if (vm.count("tree") != 0) print_tree("/", tree);
else std::cout << make_border(get_device_pp_string(tree)) << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/utils/usrp_burn_db_eeprom.cpp b/host/utils/usrp_burn_db_eeprom.cpp
index b6b2dc4d6..3ca953115 100644
--- a/host/utils/usrp_burn_db_eeprom.cpp
+++ b/host/utils/usrp_burn_db_eeprom.cpp
@@ -58,7 +58,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
"Omit the ID argument to perform readback,\n"
"Or specify a new ID to burn into the EEPROM.\n"
) << std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
//make the device and extract the dboard w/ property
@@ -96,5 +96,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::cout << boost::format(" Current revision: \"%s\"") % db_eeprom.revision << std::endl;
std::cout << " Done" << std::endl << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/utils/usrp_burn_mb_eeprom.cpp b/host/utils/usrp_burn_mb_eeprom.cpp
index ca9a6c8ba..1b13fb615 100644
--- a/host/utils/usrp_burn_mb_eeprom.cpp
+++ b/host/utils/usrp_burn_mb_eeprom.cpp
@@ -47,7 +47,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
"Omit the value argument to perform a readback,\n"
"Or specify a new value to burn into the EEPROM.\n"
) << std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
std::cout << "Creating USRP device from address: " + args << std::endl;
@@ -60,7 +60,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
uhd::usrp::mboard_eeprom_t mb_eeprom = tree->access<uhd::usrp::mboard_eeprom_t>("/mboards/0/eeprom").get();
if (not mb_eeprom.has_key(key)){
std::cerr << boost::format("Cannot find value for EEPROM[%s]") % key << std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
std::cout << boost::format(" EEPROM [\"%s\"] is \"%s\"") % key % mb_eeprom[key] << std::endl;
std::cout << std::endl;
@@ -74,5 +74,5 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
}
std::cout << "Done" << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
diff --git a/host/utils/usrp_n2xx_simple_net_burner.cpp b/host/utils/usrp_n2xx_simple_net_burner.cpp
index abbbf37da..2f592adfc 100644
--- a/host/utils/usrp_n2xx_simple_net_burner.cpp
+++ b/host/utils/usrp_n2xx_simple_net_burner.cpp
@@ -365,7 +365,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::cout << boost::format("Automatically detects and burns standard firmware and FPGA images onto USRP N2XX devices.\n");
std::cout << boost::format("Can optionally take user input for custom images.\n\n");
std::cout << desc << std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
bool burn_fpga = (vm.count("no_fpga") == 0);
@@ -376,7 +376,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
if(!burn_fpga && !burn_fw){
std::cout << "No images will be burned." << std::endl;
- return ~0;
+ return EXIT_FAILURE;
}
if(!burn_fw && use_custom_fw) std::cout << boost::format("Conflicting firmware options presented. Will not burn a firmware image.\n\n");
@@ -418,7 +418,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
}
}
- return ~0;
+ return EXIT_FAILURE;
}
std::cout << boost::format("Searching for USRP N2XX with IP address %s.\n") % ip_addr;
@@ -512,7 +512,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
}
std::cout << std::endl; //Formatting
if(reset) reset_usrp(udp_transport);
- else return 0;
+ else return EXIT_SUCCESS;
- return 0;
+ return EXIT_SUCCESS;
}