aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-05-16 15:22:20 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-05-16 15:22:27 +0200
commit7a9c1660cc46d1adcd26a234da2ecbfb07cd5719 (patch)
treea26eac35bfcd121ddeae1bb2655970b42b0875bd
parent0b0748a4be1a35673312e08196611b83a2dcb9af (diff)
rlc: Fix memset(0) on object with no trivial copy-assignment
As warned by gcc 8.1.0, the cs field is a class (GprsCodingScheme) and should not be memset. Change-Id: Id742f82aa856e696b5fb414991dfd0883d0ac7fe
-rw-r--r--src/rlc.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/rlc.cpp b/src/rlc.cpp
index a82f550..ee88bd9 100644
--- a/src/rlc.cpp
+++ b/src/rlc.cpp
@@ -326,11 +326,18 @@ static void gprs_rlc_data_header_init(struct gprs_rlc_data_info *rlc,
unsigned int i;
unsigned int padding_bits = with_padding ? cs.optionalPaddingBits() : 0;
- memset(rlc, 0, sizeof(*rlc));
-
rlc->cs = cs;
- rlc->with_padding = with_padding;
+ rlc->r = 0;
+ rlc->si = 0;
+ rlc->tfi = 0;
+ rlc->cps = 0;
+ rlc->rsb = 0;
+ rlc->usf = 0;
+ rlc->es_p = 0;
+ rlc->rrbp = 0;
+ rlc->pr = 0;
rlc->num_data_blocks = cs.numDataBlocks();
+ rlc->with_padding = with_padding;
OSMO_ASSERT(rlc->num_data_blocks <= ARRAY_SIZE(rlc->block_info));