summaryrefslogtreecommitdiff
path: root/gr-blocks/lib
diff options
context:
space:
mode:
authorAnders Kalør <anders@kaloer.com>2019-08-17 14:33:21 +0200
committerMartin Braun <martin.braun@ettus.com>2019-08-22 15:59:00 -0700
commit943f3c1942f4ca080c964480e4fd75c4d2a930d6 (patch)
treef8a8707f838f4e89cb2db51ce89d135a994b5faa /gr-blocks/lib
parentd301bc9f4155b6570e5ae365fde8b58ca6f72df3 (diff)
Fix memset clearing non-trivial type gr_complex warnings in gcc-8
Using memset with gr_complex is not a problem since the underlying representation of gr_complex is guaranteed to be two floats in adjacent memory locations without padding or additional memory. Fixes #2743
Diffstat (limited to 'gr-blocks/lib')
-rw-r--r--gr-blocks/lib/mute_impl.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gr-blocks/lib/mute_impl.cc b/gr-blocks/lib/mute_impl.cc
index 34c0d4094e..bd65ce2075 100644
--- a/gr-blocks/lib/mute_impl.cc
+++ b/gr-blocks/lib/mute_impl.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2004,2010,2013,2018 Free Software Foundation, Inc.
+ * Copyright 2004,2010,2013,2018,2019 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -28,6 +28,7 @@
#include "mute_impl.h"
#include <gnuradio/io_signature.h>
#include <string.h>
+#include <algorithm>
namespace gr {
namespace blocks {
@@ -66,7 +67,7 @@ int mute_impl<T>::work(int noutput_items,
int size = noutput_items;
if (d_mute) {
- memset(optr, 0, noutput_items * sizeof(T));
+ std::fill_n(optr, noutput_items, 0);
} else {
while (size >= 8) {
*optr++ = *iptr++;