Преглед изворни кода

Clang formatter: add indent to wrapped functions names. (#548)

あく пре 4 година
родитељ
комит
8211432685

+ 1 - 1
.clang-format

@@ -41,7 +41,7 @@ IncludeIsMainRegex: '(Test)?$'
 IndentCaseLabels: false
 IndentPPDirectives: None
 IndentWidth: 4
-IndentWrappedFunctionNames: false
+IndentWrappedFunctionNames: true
 JavaScriptQuotes: Leave
 JavaScriptWrapImports: true
 KeepEmptyLinesAtTheStartOfBlocks: false

+ 4 - 2
applications/accessor/helpers/wiegand.h

@@ -15,8 +15,10 @@ public:
 
 private:
     static bool DoWiegandConversion();
-    static unsigned long
-    GetCardId(volatile unsigned long* codehigh, volatile unsigned long* codelow, char bitlength);
+    static unsigned long GetCardId(
+        volatile unsigned long* codehigh,
+        volatile unsigned long* codelow,
+        char bitlength);
 
     static volatile unsigned long _cardTempHigh;
     static volatile unsigned long _cardTemp;

+ 1 - 1
applications/irda/irda-app-file-parser.cpp

@@ -11,7 +11,7 @@ std::unique_ptr<IrdaAppFileParser::IrdaFileMessage> IrdaAppFileParser::read_mess
 }
 
 std::unique_ptr<IrdaAppFileParser::IrdaFileMessage>
-IrdaAppFileParser::parse_message(const std::string& str) const {
+    IrdaAppFileParser::parse_message(const std::string& str) const {
     char protocol_name[32];
     uint32_t address;
     uint32_t command;

+ 1 - 1
applications/irda/irda-app-remote-manager.cpp

@@ -21,7 +21,7 @@ static bool find_string(const std::vector<std::string>& strings, const std::stri
 }
 
 static std::string
-find_vacant_name(const std::vector<std::string>& strings, const std::string& name) {
+    find_vacant_name(const std::vector<std::string>& strings, const std::string& name) {
     // if suggested name is occupied, try another one (name2, name3, etc)
     if(find_string(strings, name)) {
         int i = 1;

+ 5 - 2
applications/menu/menu_item.c

@@ -37,8 +37,11 @@ MenuItem* menu_item_alloc_menu(const char* label, Icon* icon) {
     return menu_item;
 }
 
-MenuItem*
-menu_item_alloc_function(const char* label, Icon* icon, MenuItemCallback callback, void* context) {
+MenuItem* menu_item_alloc_function(
+    const char* label,
+    Icon* icon,
+    MenuItemCallback callback,
+    void* context) {
     MenuItem* menu_item = menu_item_alloc();
 
     menu_item->type = MenuItemTypeFunction;

+ 5 - 2
applications/menu/menu_item.h

@@ -16,8 +16,11 @@ ARRAY_DEF(MenuItemArray, MenuItem*, M_PTR_OPLIST);
 
 MenuItem* menu_item_alloc_menu(const char* label, Icon* icon);
 
-MenuItem*
-menu_item_alloc_function(const char* label, Icon* icon, MenuItemCallback callback, void* context);
+MenuItem* menu_item_alloc_function(
+    const char* label,
+    Icon* icon,
+    MenuItemCallback callback,
+    void* context);
 
 void menu_item_release(MenuItem* menu_item);
 

+ 1 - 1
applications/sd-card-test/sd-card-test.cpp

@@ -71,7 +71,7 @@ public:
     void free_benchmark_data();
     void write_benchmark();
     uint32_t
-    write_benchmark_internal(const uint32_t size, const uint32_t tcount, bool silent = false);
+        write_benchmark_internal(const uint32_t size, const uint32_t tcount, bool silent = false);
 
     void read_benchmark();
     uint32_t read_benchmark_internal(

+ 1 - 1
applications/sd-filesystem/sd-filesystem-api.c

@@ -473,7 +473,7 @@ bool fs_dir_rewind(File* file) {
 
 // Get info about file/dir
 FS_Error
-fs_common_info(const char* path, FileInfo* fileinfo, char* name, const uint16_t name_length) {
+    fs_common_info(const char* path, FileInfo* fileinfo, char* name, const uint16_t name_length) {
     SDFileInfo _fileinfo;
     SDError fresult = _fs_status(fs_info);
 

+ 1 - 1
applications/sd-filesystem/sd-filesystem.h

@@ -132,7 +132,7 @@ bool fs_dir_rewind(File* file);
 
 /* common api */
 FS_Error
-fs_common_info(const char* path, FileInfo* fileinfo, char* name, const uint16_t name_length);
+    fs_common_info(const char* path, FileInfo* fileinfo, char* name, const uint16_t name_length);
 FS_Error fs_common_remove(const char* path);
 FS_Error fs_common_rename(const char* old_path, const char* new_path);
 FS_Error fs_common_set_attr(const char* path, uint8_t attr, uint8_t mask);

+ 3 - 2
applications/tests/irda_decoder/irda_decoder_test.c

@@ -18,8 +18,9 @@ static void test_teardown(void) {
     irda_free_decoder(decoder);
 }
 
-static void
-compare_message_results(const IrdaMessage* message_decoded, const IrdaMessage* message_expected) {
+static void compare_message_results(
+    const IrdaMessage* message_decoded,
+    const IrdaMessage* message_expected) {
     mu_check(message_decoded->protocol == message_expected->protocol);
     mu_check(message_decoded->command == message_expected->command);
     mu_check(message_decoded->address == message_expected->address);

+ 1 - 1
core/api-hal/api-spi.h

@@ -31,7 +31,7 @@ bool spi_xfer(
 Blocking verison:
 */
 static inline bool
-spi_xfer_block(SPI_HandleTypeDef* spi, uint8_t* tx_data, uint8_t* rx_data, size_t len) {
+    spi_xfer_block(SPI_HandleTypeDef* spi, uint8_t* tx_data, uint8_t* rx_data, size_t len) {
     semaphoreInfo s;
     osSemaphore block = createSemaphoreStatic(s);
     if(!spi_xfer(spi, tx_data, rx_data, len, RELEASE_SEMAPHORE, (void*)block)) {