From: Anton Maklakov Date: Tue, 30 Jul 2019 04:53:48 +0000 (+0700) Subject: Fix remaining -Wstrict-prototypes warnings X-Git-Tag: v4.1-dev~31^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75c0066f93d054cdd16000c428aded6e119c78d7;p=esp-idf Fix remaining -Wstrict-prototypes warnings --- diff --git a/components/app_trace/app_trace.c b/components/app_trace/app_trace.c index c85ad6a2ac..bc0d0c20b5 100644 --- a/components/app_trace/app_trace.c +++ b/components/app_trace/app_trace.c @@ -379,10 +379,10 @@ static inline void esp_apptrace_log_unlock(void) #endif } -static inline esp_err_t esp_apptrace_lock_initialize(void) +static inline esp_err_t esp_apptrace_lock_initialize(esp_apptrace_lock_t *lock) { #if CONFIG_ESP32_APPTRACE_LOCK_ENABLE - esp_apptrace_lock_init(&s_trace_buf.lock); + esp_apptrace_lock_init(lock); #endif return ESP_OK; } diff --git a/components/app_update/test/test_switch_ota.c b/components/app_update/test/test_switch_ota.c index 232bfbc88e..f0d056d9bd 100644 --- a/components/app_update/test/test_switch_ota.c +++ b/components/app_update/test/test_switch_ota.c @@ -264,19 +264,19 @@ static void test_flow1(void) case 2: ESP_LOGI(TAG, "Factory"); TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_FACTORY, cur_app->subtype); - copy_current_app_to_next_part_and_reboot(cur_app); + copy_current_app_to_next_part_and_reboot(); break; case 3: ESP_LOGI(TAG, "OTA0"); TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_OTA_0, cur_app->subtype); mark_app_valid(); - copy_current_app_to_next_part_and_reboot(cur_app); + copy_current_app_to_next_part_and_reboot(); break; case 4: ESP_LOGI(TAG, "OTA1"); TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_OTA_1, cur_app->subtype); mark_app_valid(); - copy_current_app_to_next_part_and_reboot(cur_app); + copy_current_app_to_next_part_and_reboot(); break; case 5: ESP_LOGI(TAG, "OTA0"); @@ -307,7 +307,7 @@ static void test_flow2(void) case 2: ESP_LOGI(TAG, "Factory"); TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_FACTORY, cur_app->subtype); - copy_current_app_to_next_part_and_reboot(cur_app); + copy_current_app_to_next_part_and_reboot(); break; case 3: ESP_LOGI(TAG, "OTA0"); @@ -344,13 +344,13 @@ static void test_flow3(void) case 2: ESP_LOGI(TAG, "Factory"); TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_FACTORY, cur_app->subtype); - copy_current_app_to_next_part_and_reboot(cur_app); + copy_current_app_to_next_part_and_reboot(); break; case 3: ESP_LOGI(TAG, "OTA0"); TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_OTA_0, cur_app->subtype); mark_app_valid(); - copy_current_app_to_next_part_and_reboot(cur_app); + copy_current_app_to_next_part_and_reboot(); break; case 4: ESP_LOGI(TAG, "OTA1"); @@ -402,7 +402,7 @@ static void test_flow4(void) nvs_close(handle); nvs_flash_deinit(); - copy_current_app_to_next_part_and_reboot(cur_app); + copy_current_app_to_next_part_and_reboot(); break; case 3: ESP_LOGI(TAG, "OTA0"); diff --git a/components/driver/test/param_test/include/param_test.h b/components/driver/test/param_test/include/param_test.h index 879e2e5e92..e04a2bee6f 100644 --- a/components/driver/test/param_test/include/param_test.h +++ b/components/driver/test/param_test/include/param_test.h @@ -159,6 +159,6 @@ void test_serializer(const param_group_t *param_group, const ptest_func_t* test_ * @param slave_func ``ptest_func_t`` to be executed by slave. */ #define TEST_MASTER_SLAVE(name, param_group, tag, master_func, slave_func) \ - static void PTEST_MASTER_NAME(name) () { test_serializer(&PGROUP_NAME(param_group), master_func); } \ - static void PTEST_SLAVE_NAME(name) () { test_serializer(&PGROUP_NAME(param_group), slave_func); } \ + static void PTEST_MASTER_NAME(name) (void) { test_serializer(&PGROUP_NAME(param_group), master_func); } \ + static void PTEST_SLAVE_NAME(name) (void) { test_serializer(&PGROUP_NAME(param_group), slave_func); } \ TEST_CASE_MULTIPLE_DEVICES("master slave test: "#name, tag, PTEST_MASTER_NAME(name), PTEST_SLAVE_NAME(name)) diff --git a/components/fatfs/vfs/vfs_fat_sdmmc.c b/components/fatfs/vfs/vfs_fat_sdmmc.c index ac1a37a7fa..83cc0aee5b 100644 --- a/components/fatfs/vfs/vfs_fat_sdmmc.c +++ b/components/fatfs/vfs/vfs_fat_sdmmc.c @@ -171,7 +171,7 @@ esp_err_t esp_vfs_fat_sdmmc_unmount(void) char drv[3] = {(char)('0' + s_pdrv), ':', 0}; f_mount(0, drv, 0); // release SD driver - esp_err_t (*host_deinit)() = s_card->host.deinit; + esp_err_t (*host_deinit)(void) = s_card->host.deinit; ff_diskio_unregister(s_pdrv); free(s_card); s_card = NULL; diff --git a/components/freertos/include/freertos/deprecated_definitions.h b/components/freertos/include/freertos/deprecated_definitions.h index fb031cdde6..dc061f33f3 100644 --- a/components/freertos/include/freertos/deprecated_definitions.h +++ b/components/freertos/include/freertos/deprecated_definitions.h @@ -82,12 +82,12 @@ projects should not use them. */ #ifdef OPEN_WATCOM_INDUSTRIAL_PC_PORT #include "..\..\Source\portable\owatcom\16bitdos\pc\portmacro.h" - typedef void ( __interrupt __far *pxISR )(); + typedef void ( __interrupt __far *pxISR )(void); #endif #ifdef OPEN_WATCOM_FLASH_LITE_186_PORT #include "..\..\Source\portable\owatcom\16bitdos\flsh186\portmacro.h" - typedef void ( __interrupt __far *pxISR )(); + typedef void ( __interrupt __far *pxISR )(void); #endif #ifdef GCC_MEGA_AVR @@ -255,7 +255,7 @@ projects should not use them. */ FreeRTOSConfig.h when using the Borland compiler. */ #include "frconfig.h" #include "..\portable\BCC\16BitDOS\PC\prtmacro.h" - typedef void ( __interrupt __far *pxISR )(); + typedef void ( __interrupt __far *pxISR )(void); #endif #ifdef BCC_FLASH_LITE_186_PORT @@ -263,7 +263,7 @@ projects should not use them. */ FreeRTOSConfig.h when using the Borland compiler. */ #include "frconfig.h" #include "..\portable\BCC\16BitDOS\flsh186\prtmacro.h" - typedef void ( __interrupt __far *pxISR )(); + typedef void ( __interrupt __far *pxISR )(void); #endif #ifdef __GNUC__ diff --git a/components/freertos/tasks.c b/components/freertos/tasks.c index 8c4fd61a36..634e64e486 100644 --- a/components/freertos/tasks.c +++ b/components/freertos/tasks.c @@ -2149,7 +2149,7 @@ void vTaskSuspendAll( void ) #if ( portNUM_PROCESSORS > 1 ) - static BaseType_t xHaveReadyTasks() + static BaseType_t xHaveReadyTasks( void ) { for (int i = tskIDLE_PRIORITY + 1; i < configMAX_PRIORITIES; ++i) { diff --git a/components/freertos/test/test_freertos_backported_functions.c b/components/freertos/test/test_freertos_backported_functions.c index 5071ce1fe9..f3fab9a8e6 100644 --- a/components/freertos/test/test_freertos_backported_functions.c +++ b/components/freertos/test/test_freertos_backported_functions.c @@ -221,7 +221,7 @@ static void del_cb(int index, void *ptr) *((uint32_t *)ptr) = (TLSP_DEL_BASE << index); //Indicate deletion by setting task storage element to a unique value } -static void task_cb(void) +static void task_cb(void *arg) { int core = xPortGetCoreID(); for(int i = 0; i < NO_OF_TLSP; i++){ diff --git a/components/freertos/test/test_freertos_eventgroups.c b/components/freertos/test/test_freertos_eventgroups.c index c2672fe27c..9b86f759fb 100644 --- a/components/freertos/test/test_freertos_eventgroups.c +++ b/components/freertos/test/test_freertos_eventgroups.c @@ -135,7 +135,7 @@ static timer_isr_handle_t isr_handle; static bool test_set_bits; static bool test_clear_bits; -static void IRAM_ATTR event_group_isr(void) +static void IRAM_ATTR event_group_isr(void *arg) { portBASE_TYPE task_woken = pdFALSE; TIMERG0.int_clr_timers.t0 = 1; diff --git a/components/freertos/test/test_freertos_task_notify.c b/components/freertos/test/test_freertos_task_notify.c index fd230d1623..8179cef9b4 100644 --- a/components/freertos/test/test_freertos_task_notify.c +++ b/components/freertos/test/test_freertos_task_notify.c @@ -94,7 +94,7 @@ static void receiver_task (void* arg){ vTaskDelete(NULL); } -static void IRAM_ATTR sender_ISR (void) +static void IRAM_ATTR sender_ISR (void *arg) { int curcore = xPortGetCoreID(); if(curcore == 0){ //Clear timer interrupt diff --git a/components/unity/include/unity_test_runner.h b/components/unity/include/unity_test_runner.h index a9a1fae49d..e9e46ebd43 100644 --- a/components/unity/include/unity_test_runner.h +++ b/components/unity/include/unity_test_runner.h @@ -84,7 +84,7 @@ void unity_testcase_register(test_desc_t* desc); #define TEST_CASE(name_, desc_) \ static void UNITY_TEST_UID(test_func_) (void); \ - static void __attribute__((constructor)) UNITY_TEST_UID(test_reg_helper_) () \ + static void __attribute__((constructor)) UNITY_TEST_UID(test_reg_helper_) (void) \ { \ static test_func test_fn_[] = {&UNITY_TEST_UID(test_func_)}; \ static test_desc_t UNITY_TEST_UID(test_desc_) = { \ @@ -115,7 +115,7 @@ void unity_testcase_register(test_desc_t* desc); #define TEST_CASE_MULTIPLE_STAGES(name_, desc_, ...) \ UNITY_TEST_FN_SET(__VA_ARGS__); \ - static void __attribute__((constructor)) UNITY_TEST_UID(test_reg_helper_) () \ + static void __attribute__((constructor)) UNITY_TEST_UID(test_reg_helper_) (void) \ { \ static test_desc_t UNITY_TEST_UID(test_desc_) = { \ .name = name_, \ @@ -140,7 +140,7 @@ void unity_testcase_register(test_desc_t* desc); #define TEST_CASE_MULTIPLE_DEVICES(name_, desc_, ...) \ UNITY_TEST_FN_SET(__VA_ARGS__); \ - static void __attribute__((constructor)) UNITY_TEST_UID(test_reg_helper_) () \ + static void __attribute__((constructor)) UNITY_TEST_UID(test_reg_helper_) (void) \ { \ static test_desc_t UNITY_TEST_UID(test_desc_) = { \ .name = name_, \ diff --git a/components/wpa_supplicant/src/rsn_supp/wpa_i.h b/components/wpa_supplicant/src/rsn_supp/wpa_i.h index 3a09eff1d2..69fc1a5e3d 100644 --- a/components/wpa_supplicant/src/rsn_supp/wpa_i.h +++ b/components/wpa_supplicant/src/rsn_supp/wpa_i.h @@ -81,7 +81,7 @@ struct wpa_sm { int (*get_ppkey) (uint8_t *ifx, int *alg, uint8_t *addr, int *key_idx, uint8_t *key, size_t key_len, int key_entry_valid); void (*wpa_deauthenticate)(u8 reason_code); - void (*wpa_neg_complete)(); + void (*wpa_neg_complete)(void); struct wpa_gtk_data gd; //used for calllback save param u16 key_info; //used for txcallback param u16 txcb_flags; @@ -145,7 +145,7 @@ typedef int (*WPA_GET_KEY) (u8 *ifx, int *alg, u8 *addt, int *keyidx, u8 *key, s typedef void (*WPA_DEAUTH_FUNC)(u8 reason_code); -typedef void (*WPA_NEG_COMPLETE)(); +typedef void (*WPA_NEG_COMPLETE)(void); void wpa_register(char * payload, WPA_SEND_FUNC snd_func, \ WPA_SET_ASSOC_IE set_assoc_ie_func, \ diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_node/main/ble_mesh_register_node_cmd.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_node/main/ble_mesh_register_node_cmd.c index 6dc356cdab..375c224c6c 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_node/main/ble_mesh_register_node_cmd.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_node/main/ble_mesh_register_node_cmd.c @@ -97,7 +97,7 @@ void ble_mesh_register_mesh_node(void) ble_mesh_register_node_cmd(); } -int ble_mesh_register_node_cb(void) +int ble_mesh_register_node_cb(int argc, char** argv) { ESP_LOGD(TAG, "enter %s\n", __func__); ble_mesh_node_init(); @@ -364,7 +364,7 @@ int ble_mesh_node_enable_bearer(int argc, char **argv) return err; } -int ble_mesh_node_reset(void) +int ble_mesh_node_reset(int argc, char** argv) { esp_err_t err; ESP_LOGD(TAG, "enter %s\n", __func__); diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_node/main/register_bluetooth.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_node/main/register_bluetooth.c index 0489388ec1..64358ba606 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_node/main/register_bluetooth.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_node/main/register_bluetooth.c @@ -25,7 +25,7 @@ void register_bluetooth(void) register_ble_address(); } -int bt_mac(void) +int bt_mac(int argc, char** argv) { const uint8_t *mac = esp_bt_dev_get_address(); printf("+BTMAC:"MACSTR"\n", MAC2STR(mac)); @@ -38,7 +38,7 @@ void register_ble_address(void) .command = "btmac", .help = "get BT mac address", .hint = NULL, - .func = (esp_console_cmd_func_t)&bt_mac, + .func = &bt_mac, }; ESP_ERROR_CHECK(esp_console_cmd_register(&cmd)); } diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_provisioner/main/ble_mesh_register_node_cmd.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_provisioner/main/ble_mesh_register_node_cmd.c index dc96f79079..b9bd565c40 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_provisioner/main/ble_mesh_register_node_cmd.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_provisioner/main/ble_mesh_register_node_cmd.c @@ -76,7 +76,7 @@ void ble_mesh_register_mesh_node(void) ble_mesh_register_node_cmd(); } -int ble_mesh_register_node_cb(void) +int ble_mesh_register_node_cb(int argc, char** argv) { ESP_LOGD(TAG, "enter %s\n", __func__); ble_mesh_node_init(); diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_provisioner/main/ble_mesh_register_provisioner_cmd.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_provisioner/main/ble_mesh_register_provisioner_cmd.c index 4c95d45b28..6b74255d37 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_provisioner/main/ble_mesh_register_provisioner_cmd.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_console/ble_mesh_provisioner/main/ble_mesh_register_provisioner_cmd.c @@ -101,7 +101,7 @@ void ble_mesh_prov_adv_cb(const esp_bd_addr_t addr, const esp_ble_addr_type_t ad ESP_LOGD(TAG, "exit %s\n", __func__); } -int ble_mesh_provisioner_register(void) +int ble_mesh_provisioner_register(int argc, char** argv) { ESP_LOGD(TAG, "enter %s \n", __func__); // esp_ble_mesh_register_unprov_adv_pkt_callback(ble_mesh_prov_adv_cb); diff --git a/examples/peripherals/mcpwm/mcpwm_bldc_control/main/mcpwm_bldc_control_hall_sensor_example.c b/examples/peripherals/mcpwm/mcpwm_bldc_control/main/mcpwm_bldc_control_hall_sensor_example.c index c8bfe00010..6784b63991 100644 --- a/examples/peripherals/mcpwm/mcpwm_bldc_control/main/mcpwm_bldc_control_hall_sensor_example.c +++ b/examples/peripherals/mcpwm/mcpwm_bldc_control/main/mcpwm_bldc_control_hall_sensor_example.c @@ -162,7 +162,7 @@ static void disp_captured_signal(void *arg) /** * @brief this is ISR handler function, here we check for interrupt that triggers rising edge on CAP0 signal and according take action */ -static void IRAM_ATTR isr_handler(void) +static void IRAM_ATTR isr_handler(void *arg) { uint32_t mcpwm_intr_status; capture evt; diff --git a/examples/peripherals/rmt_nec_tx_rx/main/infrared_nec_main.c b/examples/peripherals/rmt_nec_tx_rx/main/infrared_nec_main.c index 1dc28e5acc..df5a6b08d9 100644 --- a/examples/peripherals/rmt_nec_tx_rx/main/infrared_nec_main.c +++ b/examples/peripherals/rmt_nec_tx_rx/main/infrared_nec_main.c @@ -276,7 +276,7 @@ static void nec_rx_init(void) * @brief RMT receiver demo, this task will print each received NEC data. * */ -static void rmt_example_nec_rx_task(void) +static void rmt_example_nec_rx_task(void *arg) { int channel = RMT_RX_CHANNEL; nec_rx_init(); @@ -317,7 +317,7 @@ static void rmt_example_nec_rx_task(void) * @brief RMT transmitter demo, this task will periodically send NEC data. (100 * 32 bits each time.) * */ -static void rmt_example_nec_tx_task(void) +static void rmt_example_nec_tx_task(void *arg) { vTaskDelay(10); nec_tx_init(); diff --git a/examples/peripherals/uart/uart_async_rxtxtasks/main/uart_async_rxtxtasks_main.c b/examples/peripherals/uart/uart_async_rxtxtasks/main/uart_async_rxtxtasks_main.c index f4f4eb18da..3b4a5872ea 100644 --- a/examples/peripherals/uart/uart_async_rxtxtasks/main/uart_async_rxtxtasks_main.c +++ b/examples/peripherals/uart/uart_async_rxtxtasks/main/uart_async_rxtxtasks_main.c @@ -41,7 +41,7 @@ int sendData(const char* logName, const char* data) return txBytes; } -static void tx_task(void) +static void tx_task(void *arg) { static const char *TX_TASK_TAG = "TX_TASK"; esp_log_level_set(TX_TASK_TAG, ESP_LOG_INFO); @@ -51,7 +51,7 @@ static void tx_task(void) } } -static void rx_task(void) +static void rx_task(void *arg) { static const char *RX_TASK_TAG = "RX_TASK"; esp_log_level_set(RX_TASK_TAG, ESP_LOG_INFO); diff --git a/examples/peripherals/uart/uart_echo/main/uart_echo_example_main.c b/examples/peripherals/uart/uart_echo/main/uart_echo_example_main.c index 6e6a77a749..c9b5dbc7b3 100644 --- a/examples/peripherals/uart/uart_echo/main/uart_echo_example_main.c +++ b/examples/peripherals/uart/uart_echo/main/uart_echo_example_main.c @@ -31,7 +31,7 @@ #define BUF_SIZE (1024) -static void echo_task(void) +static void echo_task(void *arg) { /* Configure parameters of an UART driver, * communication pins and install the driver */ diff --git a/examples/peripherals/uart/uart_echo_rs485/main/rs485_example.c b/examples/peripherals/uart/uart_echo_rs485/main/rs485_example.c index c68c22edf0..e2d53dac4d 100644 --- a/examples/peripherals/uart/uart_echo_rs485/main/rs485_example.c +++ b/examples/peripherals/uart/uart_echo_rs485/main/rs485_example.c @@ -52,7 +52,7 @@ static const char *TAG = "RS485_ECHO_APP"; // An example of echo test with hardware flow control on UART -static void echo_task(void) +static void echo_task(void *arg) { const int uart_num = ECHO_UART_PORT; uart_config_t uart_config = { diff --git a/examples/peripherals/uart/uart_select/main/uart_select_example_main.c b/examples/peripherals/uart/uart_select/main/uart_select_example_main.c index 2c46a3d114..d7b3c88491 100644 --- a/examples/peripherals/uart/uart_select/main/uart_select_example_main.c +++ b/examples/peripherals/uart/uart_select/main/uart_select_example_main.c @@ -20,7 +20,7 @@ static const char* TAG = "uart_select_example"; -static void uart_select_task(void) +static void uart_select_task(void *arg) { uart_config_t uart_config = { .baud_rate = 115200, diff --git a/examples/system/select/main/select_example.c b/examples/system/select/main/select_example.c index 9629024295..5da28c7dde 100644 --- a/examples/system/select/main/select_example.c +++ b/examples/system/select/main/select_example.c @@ -128,7 +128,7 @@ static void uart1_write_task(void *param) } } - uart1_deinit(uart_fd); + uart1_deinit(); vTaskDelete(NULL); }