diff --git a/.clang-format b/.clang-format index 4b76f7fa43..ad3484ba01 100644 --- a/.clang-format +++ b/.clang-format @@ -3,22 +3,55 @@ Language: Cpp AccessModifierOffset: -4 AlignAfterOpenBracket: AlwaysBreak AlignArrayOfStructures: None -AlignConsecutiveMacros: None -AlignConsecutiveAssignments: None -AlignConsecutiveBitFields: None -AlignConsecutiveDeclarations: None +AlignConsecutiveAssignments: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveBitFields: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveDeclarations: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveMacros: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveShortCaseStatements: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCaseColons: false AlignEscapedNewlines: Left AlignOperands: Align -AlignTrailingComments: false +AlignTrailingComments: + Kind: Never + OverEmptyLines: 0 AllowAllArgumentsOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: false -AllowShortEnumsOnASingleLine: true +AllowBreakBeforeNoexceptSpecifier: Never AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: false +AllowShortCompoundRequirementOnASingleLine: true +AllowShortEnumsOnASingleLine: true AllowShortFunctionsOnASingleLine: None -AllowShortLambdasOnASingleLine: All AllowShortIfStatementsOnASingleLine: WithoutElse -AllowShortLoopsOnASingleLine: true +AllowShortLambdasOnASingleLine: All +AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false @@ -27,17 +60,18 @@ AttributeMacros: - __capability BinPackArguments: false BinPackParameters: false +BitFieldColonSpacing: Both BraceWrapping: AfterCaseLabel: false AfterClass: false AfterControlStatement: Never AfterEnum: false + AfterExternBlock: false AfterFunction: false AfterNamespace: false AfterObjCDeclaration: false AfterStruct: false AfterUnion: false - AfterExternBlock: false BeforeCatch: false BeforeElse: false BeforeLambdaBody: false @@ -46,33 +80,29 @@ BraceWrapping: SplitEmptyFunction: true SplitEmptyRecord: true SplitEmptyNamespace: true -BreakBeforeBinaryOperators: None -BreakBeforeConceptDeclarations: true -BreakBeforeBraces: Attach -BreakBeforeInheritanceComma: false -BreakInheritanceList: BeforeColon -BreakBeforeTernaryOperators: false -BreakConstructorInitializersBeforeComma: false -BreakConstructorInitializers: BeforeComma +BreakAdjacentStringLiterals: true +BreakAfterAttributes: Leave BreakAfterJavaFieldAnnotations: false +BreakArrays: true +BreakBeforeBinaryOperators: None +BreakBeforeConceptDeclarations: Always +BreakBeforeBraces: Attach +BreakBeforeInlineASMColon: OnlyMultiline +BreakBeforeTernaryOperators: false +BreakConstructorInitializers: BeforeComma +BreakInheritanceList: BeforeColon BreakStringLiterals: false ColumnLimit: 99 CommentPragmas: '^ IWYU pragma:' -QualifierAlignment: Leave CompactNamespaces: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true -DeriveLineEnding: true DerivePointerAlignment: false DisableFormat: false EmptyLineAfterAccessModifier: Never EmptyLineBeforeAccessModifier: LogicalBlock ExperimentalAutoDetectBinPacking: false -PackConstructorInitializers: BinPack -BasedOnStyle: '' -ConstructorInitializerAllOnOneLineOrOnePerLine: false -AllowAllConstructorInitializersOnNextLine: true FixNamespaceComments: false ForEachMacros: - foreach @@ -97,19 +127,30 @@ IncludeCategories: IncludeIsMainRegex: '(Test)?$' IncludeIsMainSourceRegex: '' IndentAccessModifiers: false -IndentCaseLabels: false IndentCaseBlocks: false +IndentCaseLabels: false +IndentExternBlock: AfterExternBlock IndentGotoLabels: true IndentPPDirectives: None -IndentExternBlock: AfterExternBlock -IndentRequires: false +IndentRequiresClause: false IndentWidth: 4 IndentWrappedFunctionNames: true +InsertBraces: false +InsertNewlineAtEOF: false InsertTrailingCommas: None +IntegerLiteralSeparator: + Binary: 0 + BinaryMinDigits: 0 + Decimal: 0 + DecimalMinDigits: 0 + Hex: 0 + HexMinDigits: 0 JavaScriptQuotes: Leave JavaScriptWrapImports: true KeepEmptyLinesAtTheStartOfBlocks: false +KeepEmptyLinesAtEOF: false LambdaBodyIndentation: Signature +LineEnding: DeriveLF MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 @@ -119,34 +160,44 @@ ObjCBlockIndentWidth: 4 ObjCBreakBeforeNestedBlockParam: true ObjCSpaceAfterProperty: true ObjCSpaceBeforeProtocolList: true +PackConstructorInitializers: BinPack PenaltyBreakAssignment: 10 PenaltyBreakBeforeFirstCallParameter: 30 PenaltyBreakComment: 10 PenaltyBreakFirstLessLess: 0 PenaltyBreakOpenParenthesis: 0 +PenaltyBreakScopeResolution: 500 PenaltyBreakString: 10 PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 100 -PenaltyReturnTypeOnItsOwnLine: 60 PenaltyIndentedWhitespace: 0 +PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Left PPIndentWidth: -1 +QualifierAlignment: Leave ReferenceAlignment: Pointer ReflowComments: false RemoveBracesLLVM: false +RemoveParentheses: Leave +RemoveSemicolon: false +RequiresClausePosition: OwnLine +RequiresExpressionIndentation: OuterScope SeparateDefinitionBlocks: Leave ShortNamespaceLines: 1 +SkipMacroDefinitionBody: false SortIncludes: Never SortJavaStaticImport: Before -SortUsingDeclarations: false +SortUsingDeclarations: Never SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: true +SpaceAroundPointerQualifiers: Default SpaceBeforeAssignmentOperators: true SpaceBeforeCaseColon: false SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true +SpaceBeforeJsonColon: false SpaceBeforeParens: Never SpaceBeforeParensOptions: AfterControlStatements: false @@ -155,23 +206,26 @@ SpaceBeforeParensOptions: AfterFunctionDeclarationName: false AfterIfMacros: false AfterOverloadedOperator: false + AfterPlacementOperator: true + AfterRequiresInClause: false + AfterRequiresInExpression: false BeforeNonEmptyParentheses: false -SpaceAroundPointerQualifiers: Default SpaceBeforeRangeBasedForLoopColon: true +SpaceBeforeSquareBrackets: false SpaceInEmptyBlock: false -SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: Never -SpacesInConditionalStatement: false SpacesInContainerLiterals: false -SpacesInCStyleCastParentheses: false SpacesInLineCommentPrefix: Minimum: 1 Maximum: -1 -SpacesInParentheses: false +SpacesInParens: Never +SpacesInParensOptions: + InCStyleCasts: false + InConditionalStatements: false + InEmptyParentheses: false + Other: false SpacesInSquareBrackets: false -SpaceBeforeSquareBrackets: false -BitFieldColonSpacing: Both Standard: c++03 StatementAttributeLikeMacros: - Q_EMIT @@ -179,8 +233,8 @@ StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION TabWidth: 4 -UseCRLF: false UseTab: Never +VerilogBreakBetweenInstancePorts: true WhitespaceSensitiveMacros: - STRINGIZE - PP_STRINGIZE diff --git a/applications/debug/bt_debug_app/views/bt_test.c b/applications/debug/bt_debug_app/views/bt_test.c index 792ebfd8f8..c59c7f09a0 100644 --- a/applications/debug/bt_debug_app/views/bt_test.c +++ b/applications/debug/bt_debug_app/views/bt_test.c @@ -384,8 +384,7 @@ BtTestParam* bt_test_param_add( void bt_test_set_rssi(BtTest* bt_test, float rssi) { furi_assert(bt_test); - with_view_model( - bt_test->view, BtTestModel * model, { model->rssi = rssi; }, true); + with_view_model(bt_test->view, BtTestModel * model, { model->rssi = rssi; }, true); } void bt_test_set_packets_tx(BtTest* bt_test, uint32_t packets_num) { diff --git a/applications/debug/display_test/view_display_test.c b/applications/debug/display_test/view_display_test.c index d4fe433efe..31003ae0b3 100644 --- a/applications/debug/display_test/view_display_test.c +++ b/applications/debug/display_test/view_display_test.c @@ -150,8 +150,7 @@ static void view_display_test_exit(void* context) { static void view_display_test_timer_callback(void* context) { ViewDisplayTest* instance = context; - with_view_model( - instance->view, ViewDisplayTestModel * model, { model->counter++; }, true); + with_view_model(instance->view, ViewDisplayTestModel * model, { model->counter++; }, true); } ViewDisplayTest* view_display_test_alloc(void) { diff --git a/applications/debug/lfrfid_debug/views/lfrfid_debug_view_tune.c b/applications/debug/lfrfid_debug/views/lfrfid_debug_view_tune.c index ddca372e38..7b28b66bfe 100644 --- a/applications/debug/lfrfid_debug/views/lfrfid_debug_view_tune.c +++ b/applications/debug/lfrfid_debug/views/lfrfid_debug_view_tune.c @@ -223,16 +223,14 @@ bool lfrfid_debug_view_tune_is_dirty(LfRfidTuneView* tune_view) { uint32_t lfrfid_debug_view_tune_get_arr(LfRfidTuneView* tune_view) { uint32_t result = false; - with_view_model( - tune_view->view, LfRfidTuneViewModel * model, { result = model->ARR; }, false); + with_view_model(tune_view->view, LfRfidTuneViewModel * model, { result = model->ARR; }, false); return result; } uint32_t lfrfid_debug_view_tune_get_ccr(LfRfidTuneView* tune_view) { uint32_t result = false; - with_view_model( - tune_view->view, LfRfidTuneViewModel * model, { result = model->CCR; }, false); + with_view_model(tune_view->view, LfRfidTuneViewModel * model, { result = model->CCR; }, false); return result; } diff --git a/applications/debug/uart_echo/uart_echo.c b/applications/debug/uart_echo/uart_echo.c index 0291c9e79d..2d38089d4c 100644 --- a/applications/debug/uart_echo/uart_echo.c +++ b/applications/debug/uart_echo/uart_echo.c @@ -206,8 +206,7 @@ static int32_t uart_echo_worker(void* context) { } while(length > 0); notification_message(app->notification, &sequence_notification); - with_view_model( - app->view, UartDumpModel * model, { UNUSED(model); }, true); + with_view_model(app->view, UartDumpModel * model, { UNUSED(model); }, true); } if(events & WorkerEventRxIdle) { diff --git a/applications/debug/unit_tests/tests/furi_hal/furi_hal_tests.c b/applications/debug/unit_tests/tests/furi_hal/furi_hal_tests.c index 4b515206c9..a2af1d1b92 100644 --- a/applications/debug/unit_tests/tests/furi_hal/furi_hal_tests.c +++ b/applications/debug/unit_tests/tests/furi_hal/furi_hal_tests.c @@ -74,7 +74,8 @@ MU_TEST(furi_hal_i2c_int_3b) { DATA_SIZE - 1, LP5562_I2C_TIMEOUT); mu_assert(ret, "4 rx failed"); - for(size_t i = 0; i < DATA_SIZE; i++) mu_assert(data_many[i] != 0, "4 invalid data_many"); + for(size_t i = 0; i < DATA_SIZE; i++) + mu_assert(data_many[i] != 0, "4 invalid data_many"); ret = furi_hal_i2c_tx( &furi_hal_i2c_handle_power, LP5562_ADDRESS, data_many, DATA_SIZE, LP5562_I2C_TIMEOUT); @@ -90,7 +91,8 @@ MU_TEST(furi_hal_i2c_int_3b) { DATA_SIZE - 1, LP5562_I2C_TIMEOUT); mu_assert(ret, "7 rx failed"); - for(size_t i = 0; i < DATA_SIZE; i++) mu_assert(data_many[i] != 0, "7 invalid data_many"); + for(size_t i = 0; i < DATA_SIZE; i++) + mu_assert(data_many[i] != 0, "7 invalid data_many"); } MU_TEST(furi_hal_i2c_int_1b_fail) { diff --git a/applications/debug/unit_tests/tests/lfrfid/lfrfid_protocols.c b/applications/debug/unit_tests/tests/lfrfid/lfrfid_protocols.c index 8bf7753c0e..56ff64c097 100644 --- a/applications/debug/unit_tests/tests/lfrfid/lfrfid_protocols.c +++ b/applications/debug/unit_tests/tests/lfrfid/lfrfid_protocols.c @@ -6,8 +6,7 @@ #define LF_RFID_READ_TIMING_MULTIPLIER 8 -#define EM_TEST_DATA \ - { 0x58, 0x00, 0x85, 0x64, 0x02 } +#define EM_TEST_DATA {0x58, 0x00, 0x85, 0x64, 0x02} #define EM_TEST_DATA_SIZE 5 #define EM_TEST_EMULATION_TIMINGS_COUNT (64 * 2) @@ -21,8 +20,7 @@ const int8_t em_test_timings[EM_TEST_EMULATION_TIMINGS_COUNT] = { -32, 32, 32, -32, -32, 32, -32, 32, -32, 32, -32, 32, -32, 32, }; -#define HID10301_TEST_DATA \ - { 0x8D, 0x48, 0xA8 } +#define HID10301_TEST_DATA {0x8D, 0x48, 0xA8} #define HID10301_TEST_DATA_SIZE 3 #define HID10301_TEST_EMULATION_TIMINGS_COUNT (541 * 2) @@ -71,8 +69,7 @@ const int8_t hid10301_test_timings[HID10301_TEST_EMULATION_TIMINGS_COUNT] = { 5, -5, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, }; -#define IOPROX_XSF_TEST_DATA \ - { 0x65, 0x01, 0x05, 0x39 } +#define IOPROX_XSF_TEST_DATA {0x65, 0x01, 0x05, 0x39} #define IOPROX_XSF_TEST_DATA_SIZE 4 #define IOPROX_XSF_TEST_EMULATION_TIMINGS_COUNT (468 * 2) @@ -116,8 +113,7 @@ const int8_t ioprox_xsf_test_timings[IOPROX_XSF_TEST_EMULATION_TIMINGS_COUNT] = }; #define INDALA26_EMULATION_TIMINGS_COUNT (1024 * 2) -#define INDALA26_TEST_DATA \ - { 0x3B, 0x73, 0x64, 0xA8 } +#define INDALA26_TEST_DATA {0x3B, 0x73, 0x64, 0xA8} #define INDALA26_TEST_DATA_SIZE 4 const int8_t indala26_test_timings[INDALA26_EMULATION_TIMINGS_COUNT] = { @@ -209,8 +205,7 @@ const int8_t indala26_test_timings[INDALA26_EMULATION_TIMINGS_COUNT] = { -1, 1, -1, 1, -1, 1, -1, 1, }; -#define FDXB_TEST_DATA \ - { 0x44, 0x88, 0x23, 0xF2, 0x5A, 0x6F, 0x00, 0x01, 0x00, 0x00, 0x00 } +#define FDXB_TEST_DATA {0x44, 0x88, 0x23, 0xF2, 0x5A, 0x6F, 0x00, 0x01, 0x00, 0x00, 0x00} #define FDXB_TEST_DATA_SIZE 11 #define FDXB_TEST_EMULATION_TIMINGS_COUNT (206) diff --git a/applications/main/u2f/views/u2f_view.c b/applications/main/u2f/views/u2f_view.c index bdbe8bcecd..a110b3f4f7 100644 --- a/applications/main/u2f/views/u2f_view.c +++ b/applications/main/u2f/views/u2f_view.c @@ -97,6 +97,5 @@ void u2f_view_set_ok_callback(U2fView* u2f, U2fOkCallback callback, void* contex } void u2f_view_set_state(U2fView* u2f, U2fViewMsg msg) { - with_view_model( - u2f->view, U2fModel * model, { model->display_msg = msg; }, true); + with_view_model(u2f->view, U2fModel * model, { model->display_msg = msg; }, true); } diff --git a/applications/services/cli/cli_commands.c b/applications/services/cli/cli_commands.c index 7bf86c90cf..ea13bb8b7e 100644 --- a/applications/services/cli/cli_commands.c +++ b/applications/services/cli/cli_commands.c @@ -65,7 +65,8 @@ void cli_command_help(Cli* cli, FuriString* args, void* context) { CliCommandTree_it(it_left, cli->commands); CliCommandTree_it_t it_right; CliCommandTree_it(it_right, cli->commands); - for(size_t i = 0; i < commands_count_mid; i++) CliCommandTree_next(it_right); + for(size_t i = 0; i < commands_count_mid; i++) + CliCommandTree_next(it_right); // Iterate throw tree for(size_t i = 0; i < commands_count_mid; i++) { diff --git a/applications/services/gui/modules/button_menu.c b/applications/services/gui/modules/button_menu.c index ed76bd2b3a..df3e4ca4a5 100644 --- a/applications/services/gui/modules/button_menu.c +++ b/applications/services/gui/modules/button_menu.c @@ -321,8 +321,7 @@ void button_menu_reset(ButtonMenu* button_menu) { void button_menu_set_header(ButtonMenu* button_menu, const char* header) { furi_check(button_menu); - with_view_model( - button_menu->view, ButtonMenuModel * model, { model->header = header; }, true); + with_view_model(button_menu->view, ButtonMenuModel * model, { model->header = header; }, true); } ButtonMenuItem* button_menu_add_item( diff --git a/applications/services/gui/modules/byte_input.c b/applications/services/gui/modules/byte_input.c index c33ad3e07f..6e85401dab 100644 --- a/applications/services/gui/modules/byte_input.c +++ b/applications/services/gui/modules/byte_input.c @@ -868,6 +868,5 @@ void byte_input_set_result_callback( void byte_input_set_header_text(ByteInput* byte_input, const char* text) { furi_check(byte_input); - with_view_model( - byte_input->view, ByteInputModel * model, { model->header = text; }, true); + with_view_model(byte_input->view, ByteInputModel * model, { model->header = text; }, true); } diff --git a/applications/services/gui/modules/dialog_ex.c b/applications/services/gui/modules/dialog_ex.c index 5fd42be6c6..7171f6892b 100644 --- a/applications/services/gui/modules/dialog_ex.c +++ b/applications/services/gui/modules/dialog_ex.c @@ -257,20 +257,17 @@ void dialog_ex_set_icon(DialogEx* dialog_ex, uint8_t x, uint8_t y, const Icon* i void dialog_ex_set_left_button_text(DialogEx* dialog_ex, const char* text) { furi_check(dialog_ex); - with_view_model( - dialog_ex->view, DialogExModel * model, { model->left_text = text; }, true); + with_view_model(dialog_ex->view, DialogExModel * model, { model->left_text = text; }, true); } void dialog_ex_set_center_button_text(DialogEx* dialog_ex, const char* text) { furi_check(dialog_ex); - with_view_model( - dialog_ex->view, DialogExModel * model, { model->center_text = text; }, true); + with_view_model(dialog_ex->view, DialogExModel * model, { model->center_text = text; }, true); } void dialog_ex_set_right_button_text(DialogEx* dialog_ex, const char* text) { furi_check(dialog_ex); - with_view_model( - dialog_ex->view, DialogExModel * model, { model->right_text = text; }, true); + with_view_model(dialog_ex->view, DialogExModel * model, { model->right_text = text; }, true); } void dialog_ex_reset(DialogEx* dialog_ex) { diff --git a/applications/services/gui/modules/file_browser.c b/applications/services/gui/modules/file_browser.c index 9e0a7560dd..6fa8e4bb91 100644 --- a/applications/services/gui/modules/file_browser.c +++ b/applications/services/gui/modules/file_browser.c @@ -142,15 +142,13 @@ static void browser_long_load_cb(void* context); static void file_browser_scroll_timer_callback(void* context) { furi_check(context); FileBrowser* browser = context; - with_view_model( - browser->view, FileBrowserModel * model, { model->scroll_counter++; }, true); + with_view_model(browser->view, FileBrowserModel * model, { model->scroll_counter++; }, true); } static void file_browser_view_enter_callback(void* context) { furi_check(context); FileBrowser* browser = context; - with_view_model( - browser->view, FileBrowserModel * model, { model->scroll_counter = 0; }, true); + with_view_model(browser->view, FileBrowserModel * model, { model->scroll_counter = 0; }, true); furi_timer_start(browser->scroll_timer, SCROLL_INTERVAL); } diff --git a/applications/services/gui/modules/menu.c b/applications/services/gui/modules/menu.c index 8452951933..4c526bf926 100644 --- a/applications/services/gui/modules/menu.c +++ b/applications/services/gui/modules/menu.c @@ -149,8 +149,7 @@ void menu_free(Menu* menu) { furi_check(menu); menu_reset(menu); - with_view_model( - menu->view, MenuModel * model, { MenuItemArray_clear(model->items); }, false); + with_view_model(menu->view, MenuModel * model, { MenuItemArray_clear(model->items); }, false); view_free(menu->view); free(menu); diff --git a/applications/services/gui/modules/text_box.c b/applications/services/gui/modules/text_box.c index c3bff00d08..86455dd5c4 100644 --- a/applications/services/gui/modules/text_box.c +++ b/applications/services/gui/modules/text_box.c @@ -355,13 +355,11 @@ void text_box_set_text(TextBox* text_box, const char* text) { void text_box_set_font(TextBox* text_box, TextBoxFont font) { furi_check(text_box); - with_view_model( - text_box->view, TextBoxModel * model, { model->font = font; }, true); + with_view_model(text_box->view, TextBoxModel * model, { model->font = font; }, true); } void text_box_set_focus(TextBox* text_box, TextBoxFocus focus) { furi_check(text_box); - with_view_model( - text_box->view, TextBoxModel * model, { model->focus = focus; }, true); + with_view_model(text_box->view, TextBoxModel * model, { model->focus = focus; }, true); } diff --git a/applications/services/gui/modules/text_input.c b/applications/services/gui/modules/text_input.c index da391628d1..a14f8ba58e 100644 --- a/applications/services/gui/modules/text_input.c +++ b/applications/services/gui/modules/text_input.c @@ -570,6 +570,5 @@ void* text_input_get_validator_callback_context(TextInput* text_input) { void text_input_set_header_text(TextInput* text_input, const char* text) { furi_check(text_input); - with_view_model( - text_input->view, TextInputModel * model, { model->header = text; }, true); + with_view_model(text_input->view, TextInputModel * model, { model->header = text; }, true); } diff --git a/applications/services/gui/view_holder.c b/applications/services/gui/view_holder.c index d9b382c17b..ca2f9b04e1 100644 --- a/applications/services/gui/view_holder.c +++ b/applications/services/gui/view_holder.c @@ -104,7 +104,8 @@ void view_holder_start(ViewHolder* view_holder) { } void view_holder_stop(ViewHolder* view_holder) { - while(view_holder->ongoing_input) furi_delay_tick(1); + while(view_holder->ongoing_input) + furi_delay_tick(1); view_port_enabled_set(view_holder->view_port, false); } diff --git a/applications/services/input/input.c b/applications/services/input/input.c index a7610688e6..ec9384e761 100644 --- a/applications/services/input/input.c +++ b/applications/services/input/input.c @@ -137,7 +137,8 @@ int32_t input_srv(void* p) { } else { event.sequence_counter = pin_states[i].counter; furi_timer_stop(pin_states[i].press_timer); - while(furi_timer_is_running(pin_states[i].press_timer)) furi_delay_tick(1); + while(furi_timer_is_running(pin_states[i].press_timer)) + furi_delay_tick(1); if(pin_states[i].press_counter < INPUT_LONG_PRESS_COUNTS) { event.type = InputTypeShort; furi_pubsub_publish(event_pubsub, &event); diff --git a/applications/system/hid_app/views/hid_keyboard.c b/applications/system/hid_app/views/hid_keyboard.c index 9dd2ad6552..429f223c12 100644 --- a/applications/system/hid_app/views/hid_keyboard.c +++ b/applications/system/hid_app/views/hid_keyboard.c @@ -400,8 +400,7 @@ HidKeyboard* hid_keyboard_alloc(Hid* bt_hid) { view_set_draw_callback(hid_keyboard->view, hid_keyboard_draw_callback); view_set_input_callback(hid_keyboard->view, hid_keyboard_input_callback); - with_view_model( - hid_keyboard->view, HidKeyboardModel * model, { model->y = 1; }, true); + with_view_model(hid_keyboard->view, HidKeyboardModel * model, { model->y = 1; }, true); return hid_keyboard; } diff --git a/applications/system/updater/util/update_task.c b/applications/system/updater/util/update_task.c index 17f1a26805..0eae0eaf52 100644 --- a/applications/system/updater/util/update_task.c +++ b/applications/system/updater/util/update_task.c @@ -237,7 +237,10 @@ typedef struct { } UpdateTaskStageGroupMap; #define STAGE_DEF(GROUP, WEIGHT) \ - { .group = (GROUP), .weight = (WEIGHT), } + { \ + .group = (GROUP), \ + .weight = (WEIGHT), \ + } static const UpdateTaskStageGroupMap update_task_stage_progress[] = { [UpdateTaskStageProgress] = STAGE_DEF(UpdateTaskStageGroupMisc, 0), diff --git a/furi/core/string.h b/furi/core/string.h index 324135e96d..bcdf9336c7 100644 --- a/furi/core/string.h +++ b/furi/core/string.h @@ -17,7 +17,7 @@ extern "C" { /** * @brief Furi string failure constant. */ -#define FURI_STRING_FAILURE ((size_t)-1) +#define FURI_STRING_FAILURE ((size_t) - 1) /** * @brief Furi string primitive. diff --git a/lib/app-scened-template/generic_scene.hpp b/lib/app-scened-template/generic_scene.hpp index bcdf0b4641..580346c8c0 100644 --- a/lib/app-scened-template/generic_scene.hpp +++ b/lib/app-scened-template/generic_scene.hpp @@ -4,7 +4,7 @@ public: virtual void on_enter(TApp* app, bool need_restore) = 0; virtual bool on_event(TApp* app, typename TApp::Event* event) = 0; virtual void on_exit(TApp* app) = 0; - virtual ~GenericScene(){}; + virtual ~GenericScene() {}; private: }; diff --git a/lib/app-scened-template/scene_controller.hpp b/lib/app-scened-template/scene_controller.hpp index 052eca7316..eb43109584 100644 --- a/lib/app-scened-template/scene_controller.hpp +++ b/lib/app-scened-template/scene_controller.hpp @@ -175,7 +175,8 @@ public: bool switch_to_previous_scene(uint8_t count = 1) { auto previous_scene_index = TApp::SceneType::Start; - for(uint8_t i = 0; i < count; i++) previous_scene_index = get_previous_scene_index(); + for(uint8_t i = 0; i < count; i++) + previous_scene_index = get_previous_scene_index(); if(previous_scene_index == TApp::SceneType::Exit) return true; @@ -198,7 +199,8 @@ public: * */ ~SceneController() { - for(auto& it : scenes) delete it.second; + for(auto& it : scenes) + delete it.second; } private: diff --git a/lib/app-scened-template/view_modules/generic_view_module.h b/lib/app-scened-template/view_modules/generic_view_module.h index 8b74ea3add..f6c56a9110 100644 --- a/lib/app-scened-template/view_modules/generic_view_module.h +++ b/lib/app-scened-template/view_modules/generic_view_module.h @@ -3,8 +3,8 @@ class GenericViewModule { public: - GenericViewModule(){}; - virtual ~GenericViewModule(){}; + GenericViewModule() {}; + virtual ~GenericViewModule() {}; virtual View* get_view() = 0; virtual void clean() = 0; }; diff --git a/lib/bit_lib/bit_lib.h b/lib/bit_lib/bit_lib.h index 7d23cf0636..b8cc092c81 100644 --- a/lib/bit_lib/bit_lib.h +++ b/lib/bit_lib/bit_lib.h @@ -7,7 +7,7 @@ extern "C" { #endif -#define TOPBIT(X) (1 << ((X)-1)) +#define TOPBIT(X) (1 << ((X) - 1)) typedef enum { BitLibParityEven, diff --git a/lib/lfrfid/protocols/protocol_pac_stanley.c b/lib/lfrfid/protocols/protocol_pac_stanley.c index 4eabe36592..c59b0871da 100644 --- a/lib/lfrfid/protocols/protocol_pac_stanley.c +++ b/lib/lfrfid/protocols/protocol_pac_stanley.c @@ -137,7 +137,8 @@ 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) diff --git a/lib/lfrfid/protocols/protocol_pyramid.c b/lib/lfrfid/protocols/protocol_pyramid.c index 8711fe13a0..7143a3acc8 100644 --- a/lib/lfrfid/protocols/protocol_pyramid.c +++ b/lib/lfrfid/protocols/protocol_pyramid.c @@ -126,7 +126,8 @@ bool protocol_pyramid_decoder_feed(ProtocolPyramid* protocol, bool level, uint32 bool protocol_pyramid_get_parity(const uint8_t* bits, uint8_t type, int length) { int x; - for(x = 0; length > 0; --length) x += bit_lib_get_bit(bits, length - 1); + for(x = 0; length > 0; --length) + x += bit_lib_get_bit(bits, length - 1); x %= 2; return x ^ type; } diff --git a/lib/nanopb b/lib/nanopb index afc499f9a4..6cfe48d6f1 160000 --- a/lib/nanopb +++ b/lib/nanopb @@ -1 +1 @@ -Subproject commit afc499f9a410fc9bbf6c9c48cdd8d8b199d49eb4 +Subproject commit 6cfe48d6f1593f8fa5c0f90437f5e6522587745e diff --git a/lib/nfc/helpers/crypto1.c b/lib/nfc/helpers/crypto1.c index 938d2765a3..571c4ac31b 100644 --- a/lib/nfc/helpers/crypto1.c +++ b/lib/nfc/helpers/crypto1.c @@ -84,7 +84,8 @@ uint32_t crypto1_word(Crypto1* crypto1, uint32_t in, int is_encrypted) { uint32_t prng_successor(uint32_t x, uint32_t n) { SWAPENDIAN(x); - while(n--) x = x >> 1 | (x >> 16 ^ x >> 18 ^ x >> 19 ^ x >> 21) << 31; + while(n--) + x = x >> 1 | (x >> 16 ^ x >> 18 ^ x >> 19 ^ x >> 21) << 31; return SWAPENDIAN(x); } diff --git a/lib/nfc/nfc_poller.c b/lib/nfc/nfc_poller.c index 114ff36951..2fe50b3fc5 100644 --- a/lib/nfc/nfc_poller.c +++ b/lib/nfc/nfc_poller.c @@ -190,7 +190,8 @@ void nfc_poller_start_ex(NfcPoller* instance, NfcGenericCallbackEx callback, voi NfcProtocol parent_protocol = nfc_protocol_get_parent(instance->protocol); if(parent_protocol != NfcProtocolInvalid) { NfcPollerListElement* iter = instance->list.head; - while(iter->protocol != parent_protocol) iter = iter->child; + while(iter->protocol != parent_protocol) + iter = iter->child; iter->poller_api->set_callback(iter->poller, nfc_poller_start_ex_tail_callback, instance); } @@ -254,7 +255,8 @@ bool nfc_poller_detect(NfcPoller* instance) { NfcPollerListElement* iter = instance->list.head; if(tail_poller != instance->list.head) { - while(iter->child != tail_poller) iter = iter->child; + while(iter->child != tail_poller) + iter = iter->child; iter->poller_api->set_callback(iter->poller, nfc_poller_detect_tail_callback, instance); } diff --git a/lib/nfc/protocols/mf_ultralight/mf_ultralight_listener_i.c b/lib/nfc/protocols/mf_ultralight/mf_ultralight_listener_i.c index 3a9b893aa5..d84630b99d 100644 --- a/lib/nfc/protocols/mf_ultralight/mf_ultralight_listener_i.c +++ b/lib/nfc/protocols/mf_ultralight/mf_ultralight_listener_i.c @@ -155,7 +155,8 @@ static void mf_ultralight_format_mirror_data( FuriString* str, const uint8_t* const data, const uint8_t data_len) { - for(uint8_t i = 0; i < data_len; i++) furi_string_cat_printf(str, "%02X", data[i]); + for(uint8_t i = 0; i < data_len; i++) + furi_string_cat_printf(str, "%02X", data[i]); } void mf_ultralight_mirror_read_prepare(uint8_t start_page, MfUltralightListener* instance) { diff --git a/lib/one_wire/one_wire_host.c b/lib/one_wire/one_wire_host.c index 9383e0f15d..f3f3d953ed 100644 --- a/lib/one_wire/one_wire_host.c +++ b/lib/one_wire/one_wire_host.c @@ -224,7 +224,8 @@ void onewire_host_target_search(OneWireHost* host, uint8_t family_code) { furi_check(host); host->saved_rom[0] = family_code; - for(uint8_t i = 1; i < 8; i++) host->saved_rom[i] = 0; + for(uint8_t i = 1; i < 8; i++) + host->saved_rom[i] = 0; host->last_discrepancy = 64; host->last_family_discrepancy = 0; host->last_device_flag = false; @@ -341,7 +342,8 @@ bool onewire_host_search(OneWireHost* host, uint8_t* new_addr, OneWireHostSearch host->last_family_discrepancy = 0; search_result = false; } else { - for(int i = 0; i < 8; i++) new_addr[i] = host->saved_rom[i]; + for(int i = 0; i < 8; i++) + new_addr[i] = host->saved_rom[i]; } return search_result; diff --git a/lib/print/printf_tiny.c b/lib/print/printf_tiny.c index 54f192a609..a1332529c5 100644 --- a/lib/print/printf_tiny.c +++ b/lib/print/printf_tiny.c @@ -616,7 +616,8 @@ static size_t _etoa( FLAGS_ZEROPAD | FLAGS_PLUS); // might need to right-pad spaces if(flags & FLAGS_LEFT) { - while(idx - start_idx < width) out(' ', buffer, idx++, maxlen); + while(idx - start_idx < width) + out(' ', buffer, idx++, maxlen); } } return idx; diff --git a/lib/toolbox/keys_dict.c b/lib/toolbox/keys_dict.c index 09fc241eeb..602653e8ff 100644 --- a/lib/toolbox/keys_dict.c +++ b/lib/toolbox/keys_dict.c @@ -176,7 +176,8 @@ static bool keys_dict_get_next_key_str(KeysDict* instance, FuriString* key) { furi_string_reset(key); - while(!key_read && !is_endfile) key_read = keys_dict_read_key_line(instance, key, &is_endfile); + while(!key_read && !is_endfile) + key_read = keys_dict_read_key_line(instance, key, &is_endfile); return key_read; } diff --git a/lib/u8g2/u8x8_byte.c b/lib/u8g2/u8x8_byte.c index a5af75e11e..2d729711d8 100644 --- a/lib/u8g2/u8x8_byte.c +++ b/lib/u8g2/u8x8_byte.c @@ -584,7 +584,8 @@ void i2c_transfer(u8x8_t* u8x8, uint8_t adr, uint8_t cnt, uint8_t* data) { uint8_t i; i2c_start(u8x8); i2c_write_byte(u8x8, adr); - for(i = 0; i < cnt; i++) i2c_write_byte(u8x8, data[i]); + for(i = 0; i < cnt; i++) + i2c_write_byte(u8x8, data[i]); i2c_stop(u8x8); } diff --git a/lib/u8g2/u8x8_setup.c b/lib/u8g2/u8x8_setup.c index c59c68d05e..b8873fb7d6 100644 --- a/lib/u8g2/u8x8_setup.c +++ b/lib/u8g2/u8x8_setup.c @@ -109,7 +109,8 @@ void u8x8_SetupDefaults(u8x8_t* u8x8) { #ifdef U8X8_USE_PINS { uint8_t i; - for(i = 0; i < U8X8_PIN_CNT; i++) u8x8->pins[i] = U8X8_PIN_NONE; + for(i = 0; i < U8X8_PIN_CNT; i++) + u8x8->pins[i] = U8X8_PIN_NONE; } #endif } diff --git a/scripts/fbt_tools/compilation_db.py b/scripts/fbt_tools/compilation_db.py index 6bad96b2dc..2988fd67b2 100644 --- a/scripts/fbt_tools/compilation_db.py +++ b/scripts/fbt_tools/compilation_db.py @@ -32,7 +32,7 @@ which is the name that most clang tools search for by default. import fnmatch import itertools import json -from shlex import join, split +from oslex import join, split import SCons from SCons.Tool.asm import ASPPSuffixes, ASSuffixes diff --git a/scripts/toolchain/fbtenv.cmd b/scripts/toolchain/fbtenv.cmd index 29b48369a1..635affdd45 100644 --- a/scripts/toolchain/fbtenv.cmd +++ b/scripts/toolchain/fbtenv.cmd @@ -13,7 +13,7 @@ if not ["%FBT_NOENV%"] == [""] ( exit /b 0 ) -set "FLIPPER_TOOLCHAIN_VERSION=33" +set "FLIPPER_TOOLCHAIN_VERSION=37" if ["%FBT_TOOLCHAIN_PATH%"] == [""] ( set "FBT_TOOLCHAIN_PATH=%FBT_ROOT%" diff --git a/scripts/toolchain/fbtenv.sh b/scripts/toolchain/fbtenv.sh index 495cdba6f9..1093d8d2d3 100755 --- a/scripts/toolchain/fbtenv.sh +++ b/scripts/toolchain/fbtenv.sh @@ -4,7 +4,7 @@ # public variables DEFAULT_SCRIPT_PATH="$(pwd -P)"; -FBT_TOOLCHAIN_VERSION="${FBT_TOOLCHAIN_VERSION:-"33"}"; +FBT_TOOLCHAIN_VERSION="${FBT_TOOLCHAIN_VERSION:-"37"}"; if [ -z ${FBT_TOOLCHAIN_PATH+x} ] ; then FBT_TOOLCHAIN_PATH_WAS_SET=0; diff --git a/targets/f7/furi_hal/furi_hal_bt.c b/targets/f7/furi_hal/furi_hal_bt.c index 3d4e417315..2d76188da4 100644 --- a/targets/f7/furi_hal/furi_hal_bt.c +++ b/targets/f7/furi_hal/furi_hal_bt.c @@ -21,8 +21,7 @@ #define TAG "FuriHalBt" -#define furi_hal_bt_DEFAULT_MAC_ADDR \ - { 0x6c, 0x7a, 0xd8, 0xac, 0x57, 0x72 } +#define furi_hal_bt_DEFAULT_MAC_ADDR {0x6c, 0x7a, 0xd8, 0xac, 0x57, 0x72} /* Time, in ms, to wait for mode transition before crashing */ #define C2_MODE_SWITCH_TIMEOUT 10000 diff --git a/targets/f7/furi_hal/furi_hal_flash.c b/targets/f7/furi_hal/furi_hal_flash.c index e9f2e532ec..30151d8378 100644 --- a/targets/f7/furi_hal/furi_hal_flash.c +++ b/targets/f7/furi_hal/furi_hal_flash.c @@ -509,8 +509,7 @@ typedef struct { uint32_t* ob_register_address; } FuriHalFlashObMapping; -#define OB_REG_DEF(INDEX, REG) \ - { .ob_reg = INDEX, .ob_register_address = (uint32_t*)(REG) } +#define OB_REG_DEF(INDEX, REG) {.ob_reg = INDEX, .ob_register_address = (uint32_t*)(REG)} static const FuriHalFlashObMapping furi_hal_flash_ob_reg_map[FURI_HAL_FLASH_OB_TOTAL_WORDS] = { OB_REG_DEF(FuriHalFlashObRegisterUserRead, (&FLASH->OPTR)), diff --git a/targets/f7/furi_hal/furi_hal_usb_ccid.c b/targets/f7/furi_hal/furi_hal_usb_ccid.c index 5e2fe77b77..0fe5fe5d91 100644 --- a/targets/f7/furi_hal/furi_hal_usb_ccid.c +++ b/targets/f7/furi_hal/furi_hal_usb_ccid.c @@ -193,7 +193,8 @@ static void* ccid_set_string_descr(char* str) { struct usb_string_descriptor* dev_str_desc = malloc(len * 2 + 2); dev_str_desc->bLength = len * 2 + 2; dev_str_desc->bDescriptorType = USB_DTYPE_STRING; - for(size_t i = 0; i < len; i++) dev_str_desc->wString[i] = str[i]; + for(size_t i = 0; i < len; i++) + dev_str_desc->wString[i] = str[i]; return dev_str_desc; } diff --git a/targets/f7/furi_hal/furi_hal_usb_hid.c b/targets/f7/furi_hal/furi_hal_usb_hid.c index 9599aa1c12..c83261226e 100644 --- a/targets/f7/furi_hal/furi_hal_usb_hid.c +++ b/targets/f7/furi_hal/furi_hal_usb_hid.c @@ -368,7 +368,8 @@ static void* hid_set_string_descr(char* str) { struct usb_string_descriptor* dev_str_desc = malloc(len * 2 + 2); dev_str_desc->bLength = len * 2 + 2; dev_str_desc->bDescriptorType = USB_DTYPE_STRING; - for(size_t i = 0; i < len; i++) dev_str_desc->wString[i] = str[i]; + for(size_t i = 0; i < len; i++) + dev_str_desc->wString[i] = str[i]; return dev_str_desc; }