aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cubeb_utils.h
diff options
context:
space:
mode:
authorMatthew Gregan <[email protected]>2016-11-15 16:25:27 +1300
committerMatthew Gregan <[email protected]>2016-11-15 16:25:27 +1300
commit5fd234931fc344713d6beceeebce535d1b1402f6 (patch)
treeb8606ddbed951d1d19f8c76d7d2e83aa1c48fa6d /src/cubeb_utils.h
parentd5599c2402e521b4f6ed056165cd7319a9d5b942 (diff)
downloadcubeb-5fd234931fc344713d6beceeebce535d1b1402f6.tar.gz
cubeb-5fd234931fc344713d6beceeebce535d1b1402f6.zip
Fix existing Clang analyzer warnings to allow warnings-as-errors.
Diffstat (limited to 'src/cubeb_utils.h')
-rw-r--r--src/cubeb_utils.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cubeb_utils.h b/src/cubeb_utils.h
index d8e9928..b6b6eac 100644
--- a/src/cubeb_utils.h
+++ b/src/cubeb_utils.h
@@ -23,6 +23,7 @@ template<typename T>
void PodCopy(T * destination, const T * source, size_t count)
{
static_assert(std::is_trivial<T>::value, "Requires trivial type");
+ assert(destination && source);
memcpy(destination, source, count * sizeof(T));
}
@@ -31,6 +32,7 @@ template<typename T>
void PodMove(T * destination, const T * source, size_t count)
{
static_assert(std::is_trivial<T>::value, "Requires trivial type");
+ assert(destination && source);
memmove(destination, source, count * sizeof(T));
}
@@ -39,6 +41,7 @@ template<typename T>
void PodZero(T * destination, size_t count)
{
static_assert(std::is_trivial<T>::value, "Requires trivial type");
+ assert(destination);
memset(destination, 0, count * sizeof(T));
}