diff options
Diffstat (limited to 'host/utils')
-rw-r--r-- | host/utils/fx2_init_eeprom.cpp | 8 | ||||
-rw-r--r-- | host/utils/uhd_cal_rx_iq_balance.cpp | 5 | ||||
-rw-r--r-- | host/utils/uhd_cal_tx_dc_offset.cpp | 4 | ||||
-rw-r--r-- | host/utils/uhd_cal_tx_iq_balance.cpp | 5 | ||||
-rw-r--r-- | host/utils/uhd_find_devices.cpp | 7 | ||||
-rw-r--r-- | host/utils/uhd_usrp_probe.cpp | 9 | ||||
-rw-r--r-- | host/utils/usrp_burn_db_eeprom.cpp | 4 | ||||
-rw-r--r-- | host/utils/usrp_burn_mb_eeprom.cpp | 6 | ||||
-rw-r--r-- | host/utils/usrp_n2xx_simple_net_burner.cpp | 10 |
9 files changed, 31 insertions, 27 deletions
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; } |