Navigation Menu

Skip to content

Commit

Permalink
btape.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 35efcce commit 5d27471
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
5 changes: 2 additions & 3 deletions core/src/stored/btape.cc
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-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 @@ -2098,7 +2098,6 @@ static void statcmd()
*/
static void fillcmd()
{
DeviceRecord rec;
DeviceBlock* block = dcr->block;
char ec1[50], ec2[50];
char buf1[100], buf2[100];
Expand Down Expand Up @@ -2187,7 +2186,7 @@ static void fillcmd()
}
Pmsg0(-1, _("Wrote Start of Session label.\n"));

memset(&rec, 0, sizeof(rec));
DeviceRecord rec;
rec.data = GetMemory(100000); /* max record size */
rec.data_len = REC_SIZE;

Expand Down
38 changes: 19 additions & 19 deletions core/src/stored/record.h
Expand Up @@ -119,25 +119,25 @@ struct DeviceRecord {
/**<
* File and Block are always returned during reading and writing records.
*/
uint32_t File; /**< File number */
uint32_t Block; /**< Block number */
uint32_t VolSessionId; /**< Sequential id within this session */
uint32_t VolSessionTime; /**< Session start time */
int32_t FileIndex; /**< Sequential file number */
int32_t Stream; /**< Full Stream number with high bits */
int32_t maskedStream; /**< Masked Stream without high bits */
uint32_t data_len; /**< Current record length */
uint32_t remainder; /**< Remaining bytes to read/write */
char state_bits[REC_STATE_BYTES]; /**< State bits */
rec_state state; /**< State of WriteRecordToBlock */
BootStrapRecord* bsr; /**< Pointer to bsr that matched */
POOLMEM* data; /**< Record data. This MUST be a memory pool item */
int32_t match_stat; /**< BootStrapRecord match status */
uint32_t last_VolSessionId; /**< Used in sequencing FI for Vbackup */
uint32_t last_VolSessionTime;
int32_t last_FileIndex;
int32_t last_Stream; /**< Used in SD-SD replication */
bool own_mempool; /**< Do we own the POOLMEM pointed to in data ? */
uint32_t File{0}; /**< File number */
uint32_t Block{0}; /**< Block number */
uint32_t VolSessionId{0}; /**< Sequential id within this session */
uint32_t VolSessionTime{0}; /**< Session start time */
int32_t FileIndex{0}; /**< Sequential file number */
int32_t Stream{0}; /**< Full Stream number with high bits */
int32_t maskedStream{0}; /**< Masked Stream without high bits */
uint32_t data_len{0}; /**< Current record length */
uint32_t remainder{0}; /**< Remaining bytes to read/write */
char state_bits[REC_STATE_BYTES]{}; /**< State bits */
rec_state state{st_none}; /**< State of WriteRecordToBlock */
BootStrapRecord* bsr{nullptr}; /**< Pointer to bsr that matched */
POOLMEM* data{nullptr}; /**< Record data. This MUST be a memory pool item */
int32_t match_stat{0}; /**< BootStrapRecord match status */
uint32_t last_VolSessionId{0}; /**< Used in sequencing FI for Vbackup */
uint32_t last_VolSessionTime{0};
int32_t last_FileIndex{0};
int32_t last_Stream{0}; /**< Used in SD-SD replication */
bool own_mempool{false}; /**< Do we own the POOLMEM pointed to in data ? */
};

/*
Expand Down

0 comments on commit 5d27471

Please sign in to comment.