Skip to content

Commit

Permalink
bextract.cc: fix class-memaccess warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz authored and franku committed Nov 5, 2019
1 parent 39fd881 commit a1b2aaa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
16 changes: 8 additions & 8 deletions core/src/include/jcr.h
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2000-2012 Free Software Foundation Europe e.V.
Copyright (C) 2011-2012 Planets Communications B.V.
Copyright (C) 2013-2018 Bareos GmbH & Co. KG
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -289,18 +289,18 @@ struct Resources {

/* clang-format off */
struct CompressionContext {
POOLMEM* deflate_buffer = nullptr; /**< Buffer used for deflation (compression) */
POOLMEM* inflate_buffer = nullptr; /**< Buffer used for inflation (decompression) */
uint32_t deflate_buffer_size = 0; /**< Length of deflation buffer */
uint32_t inflate_buffer_size = 0; /**< Length of inflation buffer */
POOLMEM* deflate_buffer{nullptr}; /**< Buffer used for deflation (compression) */
POOLMEM* inflate_buffer{nullptr}; /**< Buffer used for inflation (decompression) */
uint32_t deflate_buffer_size{0}; /**< Length of deflation buffer */
uint32_t inflate_buffer_size{0}; /**< Length of inflation buffer */
struct {
#ifdef HAVE_LIBZ
void* pZLIB = nullptr; /**< ZLIB compression session data */
void* pZLIB{nullptr}; /**< ZLIB compression session data */
#endif
#ifdef HAVE_LZO
void* pLZO = nullptr; /**< LZO compression session data */
void* pLZO{nullptr}; /**< LZO compression session data */
#endif
void* pZFAST = nullptr; /**< FASTLZ compression session data */
void* pZFAST{nullptr}; /**< FASTLZ compression session data */
} workset;
};
/* clang-format on */
Expand Down
6 changes: 4 additions & 2 deletions core/src/stored/bextract.cc
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2000-2011 Free Software Foundation Europe e.V.
Copyright (C) 2011-2012 Planets Communications B.V.
Copyright (C) 2013-2016 Bareos GmbH & Co. KG
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -424,8 +424,10 @@ static void DoExtract(char* devname)

jcr->buf_size = DEFAULT_NETWORK_BUFFER_SIZE;
SetupDecompressionBuffers(jcr, &decompress_buf_size);

static const CompressionContext emptyCompressionContext{};
if (decompress_buf_size > 0) {
memset(&jcr->compress, 0, sizeof(CompressionContext));
jcr->compress = emptyCompressionContext;
jcr->compress.inflate_buffer = GetMemory(decompress_buf_size);
jcr->compress.inflate_buffer_size = decompress_buf_size;
}
Expand Down

0 comments on commit a1b2aaa

Please sign in to comment.