[FL-2811] Fix PVS-Studio warnings (#2142)
Co-authored-by: あく <alleteam@gmail.com> Co-authored-by: gornekich <n.gorbadey@gmail.com>
This commit is contained in:
@@ -353,4 +353,4 @@ const ProtocolBase protocol_indala26 = {
|
||||
.render_data = (ProtocolRenderData)protocol_indala26_render_data,
|
||||
.render_brief_data = (ProtocolRenderData)protocol_indala26_render_brief_data,
|
||||
.write_data = (ProtocolWriteData)protocol_indala26_write_data,
|
||||
};
|
||||
};
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#define PAC_STANLEY_ENCODED_BYTE_FULL_SIZE \
|
||||
(PAC_STANLEY_ENCODED_BYTE_SIZE + PAC_STANLEY_PREAMBLE_BYTE_SIZE)
|
||||
#define PAC_STANLEY_BYTE_LENGTH (10) // start bit, 7 data bits, parity bit, stop bit
|
||||
#define PAC_STANLEY_DATA_START_INDEX 8 + (3 * PAC_STANLEY_BYTE_LENGTH) + 1
|
||||
#define PAC_STANLEY_DATA_START_INDEX (8 + (3 * PAC_STANLEY_BYTE_LENGTH) + 1)
|
||||
|
||||
#define PAC_STANLEY_DECODED_DATA_SIZE (4)
|
||||
#define PAC_STANLEY_ENCODED_DATA_SIZE (sizeof(ProtocolPACStanley))
|
||||
@@ -128,7 +128,7 @@ bool protocol_pac_stanley_decoder_feed(ProtocolPACStanley* protocol, bool level,
|
||||
}
|
||||
|
||||
bool protocol_pac_stanley_encoder_start(ProtocolPACStanley* protocol) {
|
||||
memset(protocol->encoded_data, 0, PAC_STANLEY_ENCODED_BYTE_SIZE);
|
||||
memset(protocol->encoded_data, 0, sizeof(protocol->encoded_data));
|
||||
|
||||
uint8_t idbytes[10];
|
||||
idbytes[0] = '2';
|
||||
@@ -137,7 +137,7 @@ bool protocol_pac_stanley_encoder_start(ProtocolPACStanley* protocol) {
|
||||
uint8_to_hex_chars(protocol->data, &idbytes[2], 8);
|
||||
|
||||
// insert start and stop bits
|
||||
for(size_t i = 0; i < 16; i++) protocol->encoded_data[i] = 0x40 >> (i + 3) % 5 * 2;
|
||||
for(size_t i = 0; i < 16; i++) protocol->encoded_data[i] = 0x40 >> ((i + 3) % 5 * 2);
|
||||
|
||||
protocol->encoded_data[0] = 0xFF; // mark + stop
|
||||
protocol->encoded_data[1] = 0x20; // start + reflect8(STX)
|
||||
@@ -228,4 +228,4 @@ const ProtocolBase protocol_pac_stanley = {
|
||||
.render_data = (ProtocolRenderData)protocol_pac_stanley_render_data,
|
||||
.render_brief_data = (ProtocolRenderData)protocol_pac_stanley_render_data,
|
||||
.write_data = (ProtocolWriteData)protocol_pac_stanley_write_data,
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user