aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
authorBen Hilburn <ben.hilburn@ettus.com>2013-11-27 12:11:23 -0800
committerBen Hilburn <ben.hilburn@ettus.com>2013-11-27 12:11:23 -0800
commit9e47ad607b597954e786db6614f5b42123184ccd (patch)
treef8f021498105c1144968c989b73e37d51d2e94f9 /host/include
parent0e3912767266473e08386c910954450d16d33664 (diff)
downloaduhd-9e47ad607b597954e786db6614f5b42123184ccd.tar.gz
uhd-9e47ad607b597954e786db6614f5b42123184ccd.tar.bz2
uhd-9e47ad607b597954e786db6614f5b42123184ccd.zip
Squashed merge of Coverity fixes.
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/config.hpp3
-rw-r--r--host/include/uhd/transport/zero_copy.hpp4
-rw-r--r--host/include/uhd/utils/atomic.hpp4
3 files changed, 10 insertions, 1 deletions
diff --git a/host/include/uhd/config.hpp b/host/include/uhd/config.hpp
index 6fd2932cf..619bd0787 100644
--- a/host/include/uhd/config.hpp
+++ b/host/include/uhd/config.hpp
@@ -55,18 +55,21 @@ typedef ptrdiff_t ssize_t;
#define UHD_INLINE __forceinline
#define UHD_DEPRECATED __declspec(deprecated)
#define UHD_ALIGNED(x) __declspec(align(x))
+ #define UHD_UNUSED(x) x
#elif defined(__GNUG__) && __GNUG__ >= 4
#define UHD_EXPORT __attribute__((visibility("default")))
#define UHD_IMPORT __attribute__((visibility("default")))
#define UHD_INLINE inline __attribute__((always_inline))
#define UHD_DEPRECATED __attribute__((deprecated))
#define UHD_ALIGNED(x) __attribute__((aligned(x)))
+ #define UHD_UNUSED(x) x __attribute__((unused))
#else
#define UHD_EXPORT
#define UHD_IMPORT
#define UHD_INLINE inline
#define UHD_DEPRECATED
#define UHD_ALIGNED(x)
+ #define UHD_UNUSED(x) x
#endif
// Define API declaration macro
diff --git a/host/include/uhd/transport/zero_copy.hpp b/host/include/uhd/transport/zero_copy.hpp
index fe2974d09..40d7b8c59 100644
--- a/host/include/uhd/transport/zero_copy.hpp
+++ b/host/include/uhd/transport/zero_copy.hpp
@@ -29,7 +29,9 @@ namespace uhd{ namespace transport{
//! Simple managed buffer with release interface
class UHD_API managed_buffer{
public:
- managed_buffer(void):_ref_count(0){}
+ managed_buffer(void):_ref_count(0),_buffer(NULL),_length(0){}
+
+ virtual ~managed_buffer(void) {}
/*!
* Signal to the transport that we are done with the buffer.
diff --git a/host/include/uhd/utils/atomic.hpp b/host/include/uhd/utils/atomic.hpp
index 8ddee73ca..55769d2fd 100644
--- a/host/include/uhd/utils/atomic.hpp
+++ b/host/include/uhd/utils/atomic.hpp
@@ -78,6 +78,10 @@ namespace uhd{
class UHD_API reusable_barrier{
public:
+ reusable_barrier():_size (0) {}
+
+ reusable_barrier(const size_t size):_size(size) {}
+
//! Resize the barrier for N threads
void resize(const size_t size){
_size = size;