1
mirror of https://github.com/flipperdevices/flipperzero-firmware.git synced 2025-12-12 04:41:26 +04:00

cleanup of various warnings from clangd (#3682)

* cleanup of various warnings from clangs
* lfrfid_debug: cast fixes
* subghz: binraw: round->roundf
* furi: thread: updated internal stack size variable to size_t
* github: fail faster on unsuccessful build
* unit_tests: double trouble
This commit is contained in:
hedger
2024-06-03 17:43:23 +04:00
committed by GitHub
parent 0d4ead8fbd
commit 03196fa110
136 changed files with 127 additions and 196 deletions

View File

@@ -1 +0,0 @@
#include "const.h"

View File

@@ -529,7 +529,8 @@ static bool
bin_raw_type = BinRAWTypeGap;
//looking for the last occurrence of gap
ind = instance->data_raw_ind - 1;
while((ind > 0) && (DURATION_DIFF(abs(instance->data_raw[ind]), gap) > gap_delta)) {
while((ind > 0) &&
(DURATION_DIFF(abs(instance->data_raw[ind]), (int32_t)gap) > gap_delta)) {
ind--;
}
gap_ind = ind;
@@ -544,10 +545,10 @@ static bool
uint16_t bit_count = 0;
do {
gap_ind--;
data_temp = (int)(round((float)(instance->data_raw[gap_ind]) / instance->te));
data_temp = (int)(roundf((float)(instance->data_raw[gap_ind]) / instance->te));
bin_raw_debug("%d ", data_temp);
if(data_temp == 0) bit_count++; //there is noise in the package
for(size_t i = 0; i < abs(data_temp); i++) {
for(size_t i = 0; i < (size_t)abs(data_temp); i++) {
bit_count++;
if(ind) {
ind--;
@@ -563,7 +564,7 @@ static bool
}
}
//split into full bytes if gap is caught
if(DURATION_DIFF(abs(instance->data_raw[gap_ind]), gap) < gap_delta) {
if(DURATION_DIFF(abs(instance->data_raw[gap_ind]), (int32_t)gap) < gap_delta) {
instance->data_markup[data_markup_ind].byte_bias = ind >> 3;
instance->data_markup[data_markup_ind++].bit_count = bit_count;
bit_count = 0;
@@ -807,11 +808,11 @@ static bool
bin_raw_debug_tag(TAG, "Sequence analysis without gap\r\n");
ind = 0;
for(size_t i = 0; i < instance->data_raw_ind; i++) {
int data_temp = (int)(round((float)(instance->data_raw[i]) / instance->te));
int data_temp = (int)(roundf((float)(instance->data_raw[i]) / instance->te));
if(data_temp == 0) break; //found an interval 2 times shorter than TE, this is noise
bin_raw_debug("%d ", data_temp);
for(size_t k = 0; k < abs(data_temp); k++) {
for(size_t k = 0; k < (size_t)abs(data_temp); k++) {
if(data_temp > 0) {
subghz_protocol_blocks_set_bit_array(
true, instance->data, ind++, BIN_RAW_BUF_DATA_SIZE);

View File

@@ -470,6 +470,6 @@ void subghz_protocol_decoder_intertechno_v3_get_string(void* context, FuriString
output,
"Ch:" CH_PATTERN " Dimm:%d%%\r\n",
CNT_TO_CH(instance->generic.cnt),
(int)(6.67 * (float)instance->generic.btn));
(int)(6.67f * (float)instance->generic.btn));
}
}

View File

@@ -267,7 +267,7 @@ void subghz_protocol_decoder_princeton_feed(void* context, bool level, uint32_t
instance->generic.data = instance->decoder.decode_data;
instance->generic.data_count_bit = instance->decoder.decode_count_bit;
instance->guard_time = round((float)duration / instance->te);
instance->guard_time = roundf((float)duration / instance->te);
if(instance->base.callback)
instance->base.callback(&instance->base, instance->base.context);

View File

@@ -1,4 +1,4 @@
#include "protocol_items.h"
#include "protocol_items.h" // IWYU pragma: keep
const SubGhzProtocol* subghz_protocol_registry_items[] = {
&subghz_protocol_gate_tx,

View File

@@ -3,10 +3,7 @@
#include "../subghz_file_encoder_worker.h"
#include "../blocks/const.h"
#include "../blocks/decoder.h"
#include "../blocks/encoder.h"
#include "../blocks/generic.h"
#include "../blocks/math.h"
#include <flipper_format/flipper_format_i.h>
#include <lib/toolbox/stream/stream.h>

View File

@@ -1,7 +1,6 @@
#include "receiver.h"
#include "registry.h"
#include "protocols/protocol_items.h"
#include <m-array.h>

View File

@@ -1,6 +1,5 @@
#include "subghz_setting.h"
#include "types.h"
//#include "subghz_i.h"
#include "types.h" // IWYU pragma: keep
#include <furi.h>
#include <m-list.h>

View File

@@ -2,7 +2,6 @@
#include "protocols/base.h"
#include "registry.h"
#include "protocols/protocol_items.h"
struct SubGhzTransmitter {
const SubGhzProtocol* protocol;