Skip to content

Commit 77ed6f6

Browse files
dlechdpgeorge
authored andcommitted
tools/uncrustify: Enable more opts to remove space between func and '('.
With only `sp_func_proto_paren = remove` set there are some cases where uncrustify misses removing a space between the function name and the opening '('. This sets all of the related options to `force` as well.
1 parent 026fda6 commit 77ed6f6

File tree

6 files changed

+45
-45
lines changed

6 files changed

+45
-45
lines changed

extmod/vfs_fat_diskio.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ STATIC fs_user_mount_t *disk_get_device(void *bdev) {
5252
/* Read Sector(s) */
5353
/*-----------------------------------------------------------------------*/
5454

55-
DRESULT disk_read (
55+
DRESULT disk_read(
5656
bdev_t pdrv, /* Physical drive nmuber (0..) */
5757
BYTE *buff, /* Data buffer to store read data */
5858
DWORD sector, /* Sector address (LBA) */
@@ -72,7 +72,7 @@ DRESULT disk_read (
7272
/* Write Sector(s) */
7373
/*-----------------------------------------------------------------------*/
7474

75-
DRESULT disk_write (
75+
DRESULT disk_write(
7676
bdev_t pdrv, /* Physical drive nmuber (0..) */
7777
const BYTE *buff, /* Data to be written */
7878
DWORD sector, /* Sector address (LBA) */
@@ -98,7 +98,7 @@ DRESULT disk_write (
9898
/* Miscellaneous Functions */
9999
/*-----------------------------------------------------------------------*/
100100

101-
DRESULT disk_ioctl (
101+
DRESULT disk_ioctl(
102102
bdev_t pdrv, /* Physical drive nmuber (0..) */
103103
BYTE cmd, /* Control code */
104104
void *buff /* Buffer to send/receive control data */

lib/utils/printf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ STATIC void strn_print_strn(void *data, const char *str, size_t len) {
104104
// when linkings against it statically.
105105
// GCC 9 gives a warning about missing attributes so it's excluded until
106106
// uClibc+GCC9 support is needed.
107-
int __GI_vsnprintf(char *str, size_t size, const char *fmt, va_list ap) __attribute__((weak, alias ("vsnprintf")));
107+
int __GI_vsnprintf(char *str, size_t size, const char *fmt, va_list ap) __attribute__((weak, alias("vsnprintf")));
108108
#endif
109109

110110
int vsnprintf(char *str, size_t size, const char *fmt, va_list ap) {

ports/cc3200/main.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
******************************************************************************/
5252

5353
// This is the static memory (TCB and stack) for the idle task
54-
static StaticTask_t xIdleTaskTCB __attribute__ ((section (".rtos_heap")));
55-
static StackType_t uxIdleTaskStack[configMINIMAL_STACK_SIZE] __attribute__ ((section (".rtos_heap"))) __attribute__((aligned (8)));
54+
static StaticTask_t xIdleTaskTCB __attribute__ ((section(".rtos_heap")));
55+
static StackType_t uxIdleTaskStack[configMINIMAL_STACK_SIZE] __attribute__ ((section(".rtos_heap"))) __attribute__((aligned(8)));
5656

5757
/******************************************************************************
5858
DECLARE PUBLIC DATA
@@ -62,18 +62,18 @@ OsiTaskHandle mpTaskHandle;
6262
#endif
6363

6464
// This is the FreeRTOS heap, defined here so we can put it in a special segment
65-
uint8_t ucHeap[ configTOTAL_HEAP_SIZE ] __attribute__ ((section (".rtos_heap"))) __attribute__((aligned (8)));
65+
uint8_t ucHeap[ configTOTAL_HEAP_SIZE ] __attribute__ ((section(".rtos_heap"))) __attribute__((aligned(8)));
6666

6767
// This is the static memory (TCB and stack) for the main MicroPython task
68-
StaticTask_t mpTaskTCB __attribute__ ((section (".rtos_heap")));
69-
StackType_t mpTaskStack[MICROPY_TASK_STACK_LEN] __attribute__ ((section (".rtos_heap"))) __attribute__((aligned (8)));
68+
StaticTask_t mpTaskTCB __attribute__ ((section(".rtos_heap")));
69+
StackType_t mpTaskStack[MICROPY_TASK_STACK_LEN] __attribute__ ((section(".rtos_heap"))) __attribute__((aligned(8)));
7070

7171
/******************************************************************************
7272
DEFINE PUBLIC FUNCTIONS
7373
******************************************************************************/
7474

75-
__attribute__ ((section (".boot")))
76-
int main (void) {
75+
__attribute__ ((section(".boot")))
76+
int main(void) {
7777

7878
// Initialize the clocks and the interrupt system
7979
HAL_SystemInit();

ports/cc3200/mptask.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static const char fresh_boot_py[] = "# boot.py -- run on boot-up\r\n"
113113

114114
uintptr_t cortex_m3_get_sp(void);
115115

116-
void TASK_MicroPython (void *pvParameters) {
116+
void TASK_MicroPython(void *pvParameters) {
117117
// get the top of the stack to initialize the garbage collector
118118
uint32_t sp = cortex_m3_get_sp();
119119

@@ -262,16 +262,16 @@ void TASK_MicroPython (void *pvParameters) {
262262
/******************************************************************************
263263
DEFINE PRIVATE FUNCTIONS
264264
******************************************************************************/
265-
__attribute__ ((section (".boot")))
266-
STATIC void mptask_pre_init (void) {
265+
__attribute__ ((section(".boot")))
266+
STATIC void mptask_pre_init(void) {
267267
// this one only makes sense after a poweron reset
268268
pyb_rtc_pre_init();
269269

270270
// Create the simple link spawn task
271-
ASSERT (OSI_OK == VStartSimpleLinkSpawnTask(SIMPLELINK_SPAWN_TASK_PRIORITY));
271+
ASSERT(OSI_OK == VStartSimpleLinkSpawnTask(SIMPLELINK_SPAWN_TASK_PRIORITY));
272272

273273
// Allocate memory for the flash file system
274-
ASSERT ((sflash_vfs_fat = mem_Malloc(sizeof(*sflash_vfs_fat))) != NULL);
274+
ASSERT((sflash_vfs_fat = mem_Malloc(sizeof(*sflash_vfs_fat))) != NULL);
275275

276276
// this one allocates memory for the nvic vault
277277
pyb_sleep_pre_init();
@@ -295,7 +295,7 @@ STATIC void mptask_pre_init (void) {
295295
ASSERT(svTaskHandle != NULL);
296296
}
297297

298-
STATIC void mptask_init_sflash_filesystem (void) {
298+
STATIC void mptask_init_sflash_filesystem(void) {
299299
FILINFO fno;
300300

301301
// Initialise the local flash filesystem.
@@ -378,16 +378,16 @@ STATIC void mptask_init_sflash_filesystem (void) {
378378
}
379379
}
380380

381-
STATIC void mptask_enter_ap_mode (void) {
381+
STATIC void mptask_enter_ap_mode(void) {
382382
// append the mac only if it's not the first boot
383383
bool add_mac = !PRCMGetSpecialBit(PRCM_FIRST_BOOT_BIT);
384384
// enable simplelink in ap mode (use the MAC address to make the ssid unique)
385-
wlan_sl_init (ROLE_AP, MICROPY_PORT_WLAN_AP_SSID, strlen(MICROPY_PORT_WLAN_AP_SSID),
385+
wlan_sl_init(ROLE_AP, MICROPY_PORT_WLAN_AP_SSID, strlen(MICROPY_PORT_WLAN_AP_SSID),
386386
MICROPY_PORT_WLAN_AP_SECURITY, MICROPY_PORT_WLAN_AP_KEY, strlen(MICROPY_PORT_WLAN_AP_KEY),
387387
MICROPY_PORT_WLAN_AP_CHANNEL, ANTENNA_TYPE_INTERNAL, add_mac);
388388
}
389389

390-
STATIC void mptask_create_main_py (void) {
390+
STATIC void mptask_create_main_py(void) {
391391
// create empty main.py
392392
FIL fp;
393393
f_open(&sflash_vfs_fat->fatfs, &fp, "/main.py", FA_WRITE | FA_CREATE_ALWAYS);

ports/cc3200/serverstask.c

+15-15
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,21 @@ static volatile bool sleep_sockets = false;
6868
******************************************************************************/
6969

7070
// This is the static memory (TCB and stack) for the servers task
71-
StaticTask_t svTaskTCB __attribute__ ((section (".rtos_heap")));
72-
StackType_t svTaskStack[SERVERS_STACK_LEN] __attribute__ ((section (".rtos_heap"))) __attribute__((aligned (8)));
71+
StaticTask_t svTaskTCB __attribute__ ((section(".rtos_heap")));
72+
StackType_t svTaskStack[SERVERS_STACK_LEN] __attribute__ ((section(".rtos_heap"))) __attribute__((aligned(8)));
7373

7474
char servers_user[SERVERS_USER_PASS_LEN_MAX + 1];
7575
char servers_pass[SERVERS_USER_PASS_LEN_MAX + 1];
7676

7777
/******************************************************************************
7878
DECLARE PUBLIC FUNCTIONS
7979
******************************************************************************/
80-
void TASK_Servers (void *pvParameters) {
80+
void TASK_Servers(void *pvParameters) {
8181

8282
bool cycle = false;
8383

84-
strcpy (servers_user, SERVERS_DEF_USER);
85-
strcpy (servers_pass, SERVERS_DEF_PASS);
84+
strcpy(servers_user, SERVERS_DEF_USER);
85+
strcpy(servers_pass, SERVERS_DEF_PASS);
8686

8787
telnet_init();
8888
ftp_init();
@@ -143,61 +143,61 @@ void TASK_Servers (void *pvParameters) {
143143
}
144144
}
145145

146-
void servers_start (void) {
146+
void servers_start(void) {
147147
servers_data.do_enable = true;
148148
mp_hal_delay_ms(SERVERS_CYCLE_TIME_MS * 3);
149149
}
150150

151-
void servers_stop (void) {
151+
void servers_stop(void) {
152152
servers_data.do_disable = true;
153153
do {
154154
mp_hal_delay_ms(SERVERS_CYCLE_TIME_MS);
155155
} while (servers_are_enabled());
156156
mp_hal_delay_ms(SERVERS_CYCLE_TIME_MS * 3);
157157
}
158158

159-
void servers_reset (void) {
159+
void servers_reset(void) {
160160
servers_data.do_reset = true;
161161
}
162162

163-
void servers_wlan_cycle_power (void) {
163+
void servers_wlan_cycle_power(void) {
164164
servers_data.do_wlan_cycle_power = true;
165165
}
166166

167-
bool servers_are_enabled (void) {
167+
bool servers_are_enabled(void) {
168168
return servers_data.enabled;
169169
}
170170

171-
void server_sleep_sockets (void) {
171+
void server_sleep_sockets(void) {
172172
sleep_sockets = true;
173173
mp_hal_delay_ms(SERVERS_CYCLE_TIME_MS + 1);
174174
}
175175

176-
void servers_close_socket (int16_t *sd) {
176+
void servers_close_socket(int16_t *sd) {
177177
if (*sd > 0) {
178178
modusocket_socket_delete(*sd);
179179
sl_Close(*sd);
180180
*sd = -1;
181181
}
182182
}
183183

184-
void servers_set_login (char *user, char *pass) {
184+
void servers_set_login(char *user, char *pass) {
185185
if (strlen(user) > SERVERS_USER_PASS_LEN_MAX || strlen(pass) > SERVERS_USER_PASS_LEN_MAX) {
186186
mp_raise_ValueError(MP_ERROR_TEXT("invalid argument(s) value"));
187187
}
188188
memcpy(servers_user, user, SERVERS_USER_PASS_LEN_MAX);
189189
memcpy(servers_pass, pass, SERVERS_USER_PASS_LEN_MAX);
190190
}
191191

192-
void servers_set_timeout (uint32_t timeout) {
192+
void servers_set_timeout(uint32_t timeout) {
193193
if (timeout < SERVERS_MIN_TIMEOUT_MS) {
194194
// timeout is too low
195195
mp_raise_ValueError(MP_ERROR_TEXT("invalid argument(s) value"));
196196
}
197197
servers_data.timeout = timeout;
198198
}
199199

200-
uint32_t servers_get_timeout (void) {
200+
uint32_t servers_get_timeout(void) {
201201
return servers_data.timeout;
202202
}
203203

tools/uncrustify.cfg

+10-10
Original file line numberDiff line numberDiff line change
@@ -512,35 +512,35 @@ sp_func_proto_paren = remove # ignore/add/remove/force
512512

513513
# Add or remove space between function name and '()' on function declaration
514514
# without parameters.
515-
sp_func_proto_paren_empty = ignore # ignore/add/remove/force
515+
sp_func_proto_paren_empty = remove # ignore/add/remove/force
516516

517517
# Add or remove space between function name and '(' with a typedef specifier.
518-
sp_func_type_paren = ignore # ignore/add/remove/force
518+
sp_func_type_paren = remove # ignore/add/remove/force
519519

520520
# Add or remove space between alias name and '(' of a non-pointer function type typedef.
521-
sp_func_def_paren = ignore # ignore/add/remove/force
521+
sp_func_def_paren = remove # ignore/add/remove/force
522522

523523
# Add or remove space between function name and '()' on function definition
524524
# without parameters.
525-
sp_func_def_paren_empty = ignore # ignore/add/remove/force
525+
sp_func_def_paren_empty = remove # ignore/add/remove/force
526526

527527
# Add or remove space inside empty function '()'.
528528
# Overrides sp_after_angle unless use_sp_after_angle_always is set to true.
529-
sp_inside_fparens = ignore # ignore/add/remove/force
529+
sp_inside_fparens = remove # ignore/add/remove/force
530530

531531
# Add or remove space inside function '(' and ')'.
532532
sp_inside_fparen = remove # ignore/add/remove/force
533533

534534
# Add or remove space inside the first parentheses in a function type, as in
535535
# 'void (*x)(...)'.
536-
sp_inside_tparen = ignore # ignore/add/remove/force
536+
sp_inside_tparen = remove # ignore/add/remove/force
537537

538538
# Add or remove space between the ')' and '(' in a function type, as in
539539
# 'void (*x)(...)'.
540-
sp_after_tparen_close = ignore # ignore/add/remove/force
540+
sp_after_tparen_close = remove # ignore/add/remove/force
541541

542542
# Add or remove space between ']' and '(' when part of a function call.
543-
sp_square_fparen = ignore # ignore/add/remove/force
543+
sp_square_fparen = remove # ignore/add/remove/force
544544

545545
# Add or remove space between ')' and '{' of function.
546546
sp_fparen_brace = force # ignore/add/remove/force
@@ -555,11 +555,11 @@ sp_fparen_brace_initializer = ignore # ignore/add/remove/force
555555
sp_fparen_dbrace = ignore # ignore/add/remove/force
556556

557557
# Add or remove space between function name and '(' on function calls.
558-
sp_func_call_paren = ignore # ignore/add/remove/force
558+
sp_func_call_paren = remove # ignore/add/remove/force
559559

560560
# Add or remove space between function name and '()' on function calls without
561561
# parameters. If set to ignore (the default), sp_func_call_paren is used.
562-
sp_func_call_paren_empty = ignore # ignore/add/remove/force
562+
sp_func_call_paren_empty = remove # ignore/add/remove/force
563563

564564
# Add or remove space between the user function name and '(' on function
565565
# calls. You need to set a keyword to be a user function in the config file,

0 commit comments

Comments
 (0)