From 332b659bc70cc14b879be75405ed06ca92b1f0a0 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Thu, 15 Dec 2016 09:07:56 -0800 Subject: nocscript: Fixed build issue on Py3k --- host/lib/rfnoc/nocscript/gen_basic_funcs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/host/lib/rfnoc/nocscript/gen_basic_funcs.py b/host/lib/rfnoc/nocscript/gen_basic_funcs.py index 702b3e884..20d3c82fd 100755 --- a/host/lib/rfnoc/nocscript/gen_basic_funcs.py +++ b/host/lib/rfnoc/nocscript/gen_basic_funcs.py @@ -452,9 +452,9 @@ def write_manual_file(output_filename): func_list = prep_function_list() func_list_tree = {} for func in func_list: - if not func_list_tree.has_key(func['category']): + if func['category'] not in func_list_tree: func_list_tree[func['category']] = {} - if not func_list_tree[func['category']].has_key(func['name']): + if func['name'] not in func_list_tree[func['category']]: func_list_tree[func['category']][func['name']] = [] func_list_tree[func['category']][func['name']].append(func) open(output_filename, 'w').write(parse_tmpl(DOXY_TEMPLATE, func_list_tree=func_list_tree)) -- cgit v1.2.3 From 707e503d862486a9c8a4600a1af08811d6aa821b Mon Sep 17 00:00:00 2001 From: Michael Dickens Date: Fri, 16 Dec 2016 12:22:05 -0500 Subject: nocscript: fully fix build issue on Py3k --- host/lib/rfnoc/nocscript/gen_basic_funcs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/host/lib/rfnoc/nocscript/gen_basic_funcs.py b/host/lib/rfnoc/nocscript/gen_basic_funcs.py index 20d3c82fd..e4971d2e9 100755 --- a/host/lib/rfnoc/nocscript/gen_basic_funcs.py +++ b/host/lib/rfnoc/nocscript/gen_basic_funcs.py @@ -331,9 +331,9 @@ REGISTER_COMMANDS_TEMPLATE = """ );""" DOXY_TEMPLATE = """/*! \page page_nocscript_funcs NocScript Function Reference -% for cat, func_by_name in func_list_tree.iteritems(): +% for cat, func_by_name in func_list_tree.items(): - ${cat} -% for func_name, func_info_list in func_by_name.iteritems(): +% for func_name, func_info_list in func_by_name.items(): - ${func_name}: ${func_info_list[0]['docstring']} % for func_info in func_info_list: - ${func_info['arglist']} -> ${func_info['retval']} -- cgit v1.2.3 From 2f20264768bf6000e6edd485afa533ed8b4826a2 Mon Sep 17 00:00:00 2001 From: Andrej Rode Date: Mon, 19 Dec 2016 11:21:43 -0800 Subject: utils: use vt100 terminal codes in uhd_images_downloader --- host/utils/uhd_images_downloader.py.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/host/utils/uhd_images_downloader.py.in b/host/utils/uhd_images_downloader.py.in index 7a3ff8ddf..593f7759f 100644 --- a/host/utils/uhd_images_downloader.py.in +++ b/host/utils/uhd_images_downloader.py.in @@ -91,8 +91,12 @@ class uhd_images_downloader(): filesize_dl += len(buff) if print_progress: status = r"%05d kB / %05d kB (%03d%%)" % (int(math.ceil(filesize_dl/1000.)), int(math.ceil(filesize/1000.)), int(math.ceil(filesize_dl*100.)/filesize)) - status += chr(8)*(len(status)+1) + if os.name == "nt": + status += chr(8)*(len(status)+1) + else: + sys.stdout.write("\x1b[2K\r") #Clear previos line sys.stdout.write(status) + sys.stdout.flush() if print_progress: print('') return (filesize, filesize_dl) -- cgit v1.2.3 From d00d4ae8ff7744d0a5f514cf8cc875348bd408ac Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Tue, 3 Jan 2017 11:22:48 -0800 Subject: C API: Added UHD_VERSION usrp.h --- host/include/uhd/usrp/usrp.h | 2 ++ host/include/uhd/version.hpp.in | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/host/include/uhd/usrp/usrp.h b/host/include/uhd/usrp/usrp.h index f24d12b85..bb186a278 100644 --- a/host/include/uhd/usrp/usrp.h +++ b/host/include/uhd/usrp/usrp.h @@ -30,6 +30,8 @@ #include #include #include +/* version.hpp is safe to include in C: */ +#include /* Provides UHD_VERSION */ #include #include diff --git a/host/include/uhd/version.hpp.in b/host/include/uhd/version.hpp.in index 10f6a97ba..8cfc7b8c6 100644 --- a/host/include/uhd/version.hpp.in +++ b/host/include/uhd/version.hpp.in @@ -18,9 +18,6 @@ #ifndef INCLUDED_UHD_VERSION_HPP #define INCLUDED_UHD_VERSION_HPP -#include -#include - /*! * The ABI version string that the client application builds against. * Call get_abi_string() to check this against the library build. @@ -36,6 +33,10 @@ */ #define UHD_VERSION @UHD_VERSION_ADDED@ +#ifdef __cplusplus +#include +#include + namespace uhd{ //! Get the version string (dotted version number + build info) @@ -45,5 +46,6 @@ namespace uhd{ UHD_API std::string get_abi_string(void); } //namespace uhd +#endif #endif /* INCLUDED_UHD_VERSION_HPP */ -- cgit v1.2.3 From 8bd2a5fae547fa1c23da2a78f4f5e61552c431d0 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 4 Jan 2017 07:00:36 -0800 Subject: cmake: Add some quotes on case certain variables are blank --- host/lib/utils/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/host/lib/utils/CMakeLists.txt b/host/lib/utils/CMakeLists.txt index 790ef72ad..128d7c00a 100644 --- a/host/lib/utils/CMakeLists.txt +++ b/host/lib/utils/CMakeLists.txt @@ -116,8 +116,8 @@ SET_SOURCE_FILES_PROPERTIES( ######################################################################## # Define UHD_PKG_DATA_PATH for paths.cpp ######################################################################## -FILE(TO_NATIVE_PATH ${CMAKE_INSTALL_PREFIX} UHD_PKG_PATH) -STRING(REPLACE "\\" "\\\\" UHD_PKG_PATH ${UHD_PKG_PATH}) +FILE(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}" UHD_PKG_PATH) +STRING(REPLACE "\\" "\\\\" UHD_PKG_PATH "${UHD_PKG_PATH}") STRING(REGEX MATCH ".*/.*" SLASH "${LIB_SUFFIX}") IF(SLASH STREQUAL "") -- cgit v1.2.3 From f86f209b3370be54ec0870186ab1b9d8988736eb Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 4 Jan 2017 07:36:51 -0800 Subject: utils: Fixed minor rounding issue in gain_group --- host/lib/utils/gain_group.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/host/lib/utils/gain_group.cpp b/host/lib/utils/gain_group.cpp index 9428702d1..71caf33be 100644 --- a/host/lib/utils/gain_group.cpp +++ b/host/lib/utils/gain_group.cpp @@ -39,7 +39,7 @@ static bool compare_by_step_size( * * Due to small doubleing-point inaccuracies: * num = n*step + e, where e is a small inaccuracy. - * When e is negative, floor would yeild (n-1)*step, + * When e is negative, floor would yield (n-1)*step, * despite that n*step is really the desired result. * This function is designed to mitigate that issue. * @@ -49,7 +49,11 @@ static bool compare_by_step_size( * \return a multiple of step approximating num */ template static T floor_step(T num, T step, T e = T(0.001)){ - return step*int(num/step + e); + if (num < T(0)) { + return step*int(num/step - e); + } else { + return step*int(num/step + e); + } } gain_group::~gain_group(void){ -- cgit v1.2.3