Skip to content

Commit

Permalink
Removed unnecessary const_cast in DataFormats/L1GlobalTrigger
Browse files Browse the repository at this point in the history
Removed const_cast which were then followed by reinterpret_cast
but whose value was bound to a const variable. Adding const to
the reinterpret_cast removed the need for const_cast.
This was found by the static analyzer.
  • Loading branch information
Dr15Jones committed Oct 13, 2015
1 parent 2757e40 commit c520df4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DataFormats/L1GlobalTrigger/src/L1GtFdlWord.cc
Expand Up @@ -895,7 +895,7 @@ void L1GtFdlWord::unpack(const unsigned char* fdlPtr)
<< std::endl;

const cms_uint64_t* payload =
reinterpret_cast<cms_uint64_t*>(const_cast<unsigned char*>(fdlPtr));
reinterpret_cast<cms_uint64_t const*>(fdlPtr);

setBoardId(payload[BoardIdWord]);
setBxInEvent(payload[BxInEventWord]);
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/L1GlobalTrigger/src/L1GtfeExtWord.cc
Expand Up @@ -601,7 +601,7 @@ void L1GtfeExtWord::unpack(const unsigned char* gtfePtr)
const unsigned char* gtfeExtPtr = gtfePtr + gtfeWord.getSize();

const cms_uint64_t* payload =
reinterpret_cast<cms_uint64_t*>(const_cast<unsigned char*>(gtfeExtPtr));
reinterpret_cast<cms_uint64_t const*>(gtfeExtPtr);

int BlockSizeExt = this->getSize()/8;
int NumberBstBlocks = m_bst.size();
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/L1GlobalTrigger/src/L1GtfeWord.cc
Expand Up @@ -384,7 +384,7 @@ void L1GtfeWord::unpack(const unsigned char* gtfePtr)
<< std::endl;

const cms_uint64_t* payload =
reinterpret_cast<cms_uint64_t*>(const_cast<unsigned char*>(gtfePtr));
reinterpret_cast<cms_uint64_t const*>(gtfePtr);

setBoardId(payload[BoardIdWord]);
setRecordLength1(payload[RecordLength1Word]);
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/L1GlobalTrigger/src/L1TcsWord.cc
Expand Up @@ -504,7 +504,7 @@ void L1TcsWord::unpack(const unsigned char* tcsPtr)
<< std::endl;

const cms_uint64_t* payload =
reinterpret_cast<cms_uint64_t*>(const_cast<unsigned char*>(tcsPtr));
reinterpret_cast<cms_uint64_t const*>(tcsPtr);

setBoardId(payload[BoardIdWord]);
setBxNr(payload[BxNrWord]);
Expand Down

0 comments on commit c520df4

Please sign in to comment.