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
This commit is contained in:
Pau Espin 2018-05-16 15:22:20 +02:00
parent 0b0748a4be
commit 7a9c1660cc
1 changed files with 10 additions and 3 deletions

View File

@ -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));