aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib')
-rwxr-xr-xhost/lib/rfnoc/nocscript/gen_basic_funcs.py8
-rw-r--r--host/lib/utils/CMakeLists.txt4
-rw-r--r--host/lib/utils/gain_group.cpp8
3 files changed, 12 insertions, 8 deletions
diff --git a/host/lib/rfnoc/nocscript/gen_basic_funcs.py b/host/lib/rfnoc/nocscript/gen_basic_funcs.py
index 702b3e884..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']}
@@ -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))
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 "")
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 <typename T> 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){