diff options
author | David Sorber <david.sorber@blacklynx.tech> | 2021-10-18 08:54:12 -0400 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-10-25 11:27:01 -0400 |
commit | d4bd90853f499d5b65a61b3b7bf9ecf50e68bf6b (patch) | |
tree | d1bde0753540937bf6678f0cef1734d88ed5f9ce /gnuradio-runtime/lib/buffer_double_mapped.cc | |
parent | 47c374211221f3c636e0be2238ef233dd353697d (diff) |
runtime: replace the DEFINE_CUSTOM_BUFFER_TYPE() macro function with
some advanced template magic; also a few minor type corrections for
consistency
Signed-off-by: David Sorber <david.sorber@blacklynx.tech>
Diffstat (limited to 'gnuradio-runtime/lib/buffer_double_mapped.cc')
-rw-r--r-- | gnuradio-runtime/lib/buffer_double_mapped.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/gnuradio-runtime/lib/buffer_double_mapped.cc b/gnuradio-runtime/lib/buffer_double_mapped.cc index 700ebac0c1..e5f8d716f9 100644 --- a/gnuradio-runtime/lib/buffer_double_mapped.cc +++ b/gnuradio-runtime/lib/buffer_double_mapped.cc @@ -31,12 +31,13 @@ namespace gr { * * type_size * nitems == k * page_size */ -static inline long minimum_buffer_items(long type_size, long page_size) +static inline long minimum_buffer_items(size_t type_size, size_t page_size) { return page_size / GR_GCD(type_size, page_size); } -buffer_type buffer_double_mapped::type(buftype_DEFAULT_NON_CUSTOM{}); +buffer_type + buffer_double_mapped::type(buftype<buffer_double_mapped, buffer_double_mapped>{}); buffer_double_mapped::buffer_double_mapped(int nitems, size_t sizeof_item, @@ -67,12 +68,12 @@ buffer_double_mapped::buffer_double_mapped(int nitems, // NB: Added the extra 'block_sptr unused' parameter so that the // call signature matches the other factory-like functions used to create // the buffer_single_mapped subclasses -buffer_sptr make_buffer_double_mapped(int nitems, - size_t sizeof_item, - uint64_t downstream_lcm_nitems, - uint32_t downstream_max_out_mult, - block_sptr link, - block_sptr unused) +buffer_sptr buffer_double_mapped::make_buffer(int nitems, + size_t sizeof_item, + uint64_t downstream_lcm_nitems, + uint32_t downstream_max_out_mult, + block_sptr link, + block_sptr unused) { return buffer_sptr(new buffer_double_mapped( nitems, sizeof_item, downstream_lcm_nitems, downstream_max_out_mult, link)); |