Wunused-but-set-variable: Fixed all unused but set variables

This commit addresses all warnings emitted from
-Wunused-but-set-variable in the C++ src.

Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
Noel Eck
2016-11-02 22:45:52 -07:00
parent ee27485218
commit 33471436bf
3 changed files with 3 additions and 8 deletions

View File

@ -60,13 +60,11 @@ LPD8806::LPD8806 (uint16_t pixelCount, uint8_t csn) : m_csnPinCtx(csn), m_spi(0)
uint8_t latchBytes;
uint16_t dataBytes, totalBytes;
uint16_t numBytes = 0;
dataBytes = m_pixelsCount * 3;
latchBytes = (m_pixelsCount + 31) / 32;
totalBytes = dataBytes + latchBytes;
if ((m_pixels = (uint8_t *) malloc(totalBytes))) {
numBytes = totalBytes;
memset ( m_pixels , 0x80, dataBytes); // Init to RGB 'off' state
memset (&m_pixels[dataBytes], 0 , latchBytes); // Clear latch bytes
}