Commit 2a541175 authored by Dmitry Frank's avatar Dmitry Frank Committed by Cesanta Bot

Use void arguments list consistently in C code

On my way, fixed a couple of cases where we had `()` in the header, and
non-empty argument list in the source file.

PUBLISHED_FROM=5519526cf84e2bbd425a726fcc112fea1a95cbf1
parent 5f93f716
...@@ -3,7 +3,7 @@ title: "mg_time()" ...@@ -3,7 +3,7 @@ title: "mg_time()"
decl_name: "mg_time" decl_name: "mg_time"
symbol_kind: "func" symbol_kind: "func"
signature: | signature: |
double mg_time(); double mg_time(void);
--- ---
A sub-second precision version of time(). A sub-second precision version of time().
......
...@@ -186,7 +186,7 @@ static void mg_init(struct mg_mgr *mgr) { ...@@ -186,7 +186,7 @@ static void mg_init(struct mg_mgr *mgr) {
extern void (*const g_pfnVectors[])(void); extern void (*const g_pfnVectors[])(void);
#endif #endif
int main() { int main(void) {
#ifndef USE_TIRTOS #ifndef USE_TIRTOS
MAP_IntVTableBaseSet((unsigned long) &g_pfnVectors[0]); MAP_IntVTableBaseSet((unsigned long) &g_pfnVectors[0]);
#endif #endif
...@@ -223,10 +223,10 @@ int main() { ...@@ -223,10 +223,10 @@ int main() {
} }
/* These are FreeRTOS hooks for various life situations. */ /* These are FreeRTOS hooks for various life situations. */
void vApplicationMallocFailedHook() { void vApplicationMallocFailedHook(void) {
} }
void vApplicationIdleHook() { void vApplicationIdleHook(void) {
} }
void vApplicationStackOverflowHook(OsiTaskHandle *th, signed char *tn) { void vApplicationStackOverflowHook(OsiTaskHandle *th, signed char *tn) {
......
...@@ -47,7 +47,7 @@ void data_init_sensors(int tmp006_addr, int bm222_addr) { ...@@ -47,7 +47,7 @@ void data_init_sensors(int tmp006_addr, int bm222_addr) {
} }
} }
void data_collect() { void data_collect(void) {
double volt = tmp006_read_sensor_voltage(s_tmp006_addr); double volt = tmp006_read_sensor_voltage(s_tmp006_addr);
double temp = tmp006_read_die_temp(s_tmp006_addr); double temp = tmp006_read_die_temp(s_tmp006_addr);
if (volt != TMP006_INVALID_READING && temp != TMP006_INVALID_READING) { if (volt != TMP006_INVALID_READING && temp != TMP006_INVALID_READING) {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "mongoose.h" #include "mongoose.h"
void data_collect(); void data_collect(void);
void data_init_sensors(int tmp006_addr, int bm222_addr); void data_init_sensors(int tmp006_addr, int bm222_addr);
void data_conn_handler(struct mg_connection *nc, int ev, void *p); void data_conn_handler(struct mg_connection *nc, int ev, void *p);
......
...@@ -222,7 +222,7 @@ static void mg_init(struct mg_mgr *mgr) { ...@@ -222,7 +222,7 @@ static void mg_init(struct mg_mgr *mgr) {
extern void (*const g_pfnVectors[])(void); extern void (*const g_pfnVectors[])(void);
#endif #endif
int main() { int main(void) {
#ifndef USE_TIRTOS #ifndef USE_TIRTOS
MAP_IntVTableBaseSet((unsigned long) &g_pfnVectors[0]); MAP_IntVTableBaseSet((unsigned long) &g_pfnVectors[0]);
#endif #endif
...@@ -274,10 +274,10 @@ int main() { ...@@ -274,10 +274,10 @@ int main() {
} }
/* These are FreeRTOS hooks for various life situations. */ /* These are FreeRTOS hooks for various life situations. */
void vApplicationMallocFailedHook() { void vApplicationMallocFailedHook(void) {
} }
void vApplicationIdleHook() { void vApplicationIdleHook(void) {
} }
void vApplicationStackOverflowHook(OsiTaskHandle *th, signed char *tn) { void vApplicationStackOverflowHook(OsiTaskHandle *th, signed char *tn) {
......
...@@ -10,6 +10,6 @@ ...@@ -10,6 +10,6 @@
bool wifi_setup_ap(const char *ssid, const char *pass, int channel); bool wifi_setup_ap(const char *ssid, const char *pass, int channel);
bool wifi_setup_sta(const char *ssid, const char *pass); bool wifi_setup_sta(const char *ssid, const char *pass);
void stop_nwp(); void stop_nwp(void);
#endif /* CS_MONGOOSE_EXAMPLES_CC3200_WIFI_H_ */ #endif /* CS_MONGOOSE_EXAMPLES_CC3200_WIFI_H_ */
...@@ -54,7 +54,7 @@ void ev_handler(struct mg_connection *nc, int ev, void *p) { ...@@ -54,7 +54,7 @@ void ev_handler(struct mg_connection *nc, int ev, void *p) {
} }
} }
void setup_ap() { void setup_ap(void) {
int off = 0; int off = 0;
struct ip_info info; struct ip_info info;
struct softap_config cfg; struct softap_config cfg;
......
...@@ -42,7 +42,7 @@ static void coap_handler(struct mg_connection *nc, int ev, void *p) { ...@@ -42,7 +42,7 @@ static void coap_handler(struct mg_connection *nc, int ev, void *p) {
} }
} }
int main() { int main(void) {
struct mg_mgr mgr; struct mg_mgr mgr;
struct mg_connection *nc; struct mg_connection *nc;
......
...@@ -183,7 +183,7 @@ static void logout_handler(struct mg_connection *nc, int ev, void *p) { ...@@ -183,7 +183,7 @@ static void logout_handler(struct mg_connection *nc, int ev, void *p) {
} }
/* Cleans up sessions that have been idle for too long. */ /* Cleans up sessions that have been idle for too long. */
void check_sessions() { void check_sessions(void) {
double threshold = mg_time() - SESSION_TTL; double threshold = mg_time() - SESSION_TTL;
for (int i = 0; i < NUM_SESSIONS; i++) { for (int i = 0; i < NUM_SESSIONS; i++) {
struct session *s = &s_sessions[i]; struct session *s = &s_sessions[i];
......
...@@ -40,7 +40,7 @@ static void event_handler(struct mg_connection *nc, int event, void *data) { ...@@ -40,7 +40,7 @@ static void event_handler(struct mg_connection *nc, int event, void *data) {
} }
} }
int main() { int main(void) {
struct mg_mgr mgr; struct mg_mgr mgr;
mg_mgr_init(&mgr, NULL); mg_mgr_init(&mgr, NULL);
......
...@@ -672,7 +672,7 @@ typedef int cs_dirent_dummy; ...@@ -672,7 +672,7 @@ typedef int cs_dirent_dummy;
#include <windows.h> #include <windows.h>
#endif #endif
double cs_time() { double cs_time(void) {
double now; double now;
#ifndef _WIN32 #ifndef _WIN32
struct timeval tv; struct timeval tv;
...@@ -2721,7 +2721,7 @@ struct mg_connection *mg_add_sock(struct mg_mgr *s, sock_t sock, ...@@ -2721,7 +2721,7 @@ struct mg_connection *mg_add_sock(struct mg_mgr *s, sock_t sock,
return mg_add_sock_opt(s, sock, callback, opts); return mg_add_sock_opt(s, sock, callback, opts);
} }
double mg_time() { double mg_time(void) {
return cs_time(); return cs_time();
} }
#ifdef MG_MODULE_LINES #ifdef MG_MODULE_LINES
...@@ -10408,7 +10408,7 @@ int mkdir(const char *path, mode_t mode) { ...@@ -10408,7 +10408,7 @@ int mkdir(const char *path, mode_t mode) {
} }
#endif #endif
int sl_fs_init() { int sl_fs_init(void) {
int ret = 1; int ret = 1;
#ifdef __TI_COMPILER_VERSION__ #ifdef __TI_COMPILER_VERSION__
#ifdef MG_FS_SLFS #ifdef MG_FS_SLFS
......
...@@ -788,7 +788,7 @@ bool mg_start_task(int priority, int stack_size, mg_init_cb mg_init); ...@@ -788,7 +788,7 @@ bool mg_start_task(int priority, int stack_size, mg_init_cb mg_init);
void mg_run_in_task(void (*cb)(struct mg_mgr *mgr, void *arg), void *cb_arg); void mg_run_in_task(void (*cb)(struct mg_mgr *mgr, void *arg), void *cb_arg);
int sl_fs_init(); int sl_fs_init(void);
void sl_restart_cb(struct mg_mgr *mgr); void sl_restart_cb(struct mg_mgr *mgr);
...@@ -814,7 +814,7 @@ extern "C" { ...@@ -814,7 +814,7 @@ extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
/* Sub-second granularity time(). */ /* Sub-second granularity time(). */
double cs_time(); double cs_time(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
...@@ -1631,7 +1631,7 @@ double mg_set_timer(struct mg_connection *c, double timestamp); ...@@ -1631,7 +1631,7 @@ double mg_set_timer(struct mg_connection *c, double timestamp);
/* /*
* A sub-second precision version of time(). * A sub-second precision version of time().
*/ */
double mg_time(); double mg_time(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment