Updated cpplint.py and fixed its regexes for C-style casts (#193)

Additional C-style cast warnings thrown were also fixed.
This commit is contained in:
Tyler Veness
2016-08-11 23:38:45 -07:00
committed by Peter Johnson
parent e8f1fdda44
commit 3819cd0768
24 changed files with 109 additions and 68 deletions

View File

@@ -49,7 +49,7 @@ void ADXL345_SPI::SetRange(Range range) {
// Specify the data format to read
commands[0] = kDataFormatRegister;
commands[1] = kDataFormat_FullRes | (uint8_t)(range & 0x03);
commands[1] = kDataFormat_FullRes | static_cast<uint8_t>(range & 0x03);
m_spi.Transaction(commands, commands, 2);
}
@@ -68,8 +68,8 @@ double ADXL345_SPI::GetZ() { return GetAcceleration(kAxis_Z); }
double ADXL345_SPI::GetAcceleration(ADXL345_SPI::Axes axis) {
uint8_t buffer[3];
uint8_t command[3] = {0, 0, 0};
command[0] =
(kAddress_Read | kAddress_MultiByte | kDataRegister) + (uint8_t)axis;
command[0] = (kAddress_Read | kAddress_MultiByte | kDataRegister) +
static_cast<uint8_t>(axis);
m_spi.Transaction(command, buffer, 3);
// Sensor is little endian... swap bytes