From: Mikko Rasa Date: Tue, 22 Oct 2013 16:56:33 +0000 (+0300) Subject: Mark parameterless functions as such with a void argument list X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=5ee5a22903f8059bf38bc8b2041eb18dfc58bcf0;p=model-railway-devices.git Mark parameterless functions as such with a void argument list --- diff --git a/arducontrol/arducontrol.c b/arducontrol/arducontrol.c index 882f280..1c8cde9 100644 --- a/arducontrol/arducontrol.c +++ b/arducontrol/arducontrol.c @@ -39,7 +39,7 @@ its data to the track can start. #include "monitor.h" #include "output.h" -int main() +int main(void) { output_init(); interface_init(); diff --git a/arducontrol/interface.c b/arducontrol/interface.c index 9d21e9c..041dd67 100644 --- a/arducontrol/interface.c +++ b/arducontrol/interface.c @@ -12,17 +12,17 @@ volatile uint8_t recv_overrun = 0; uint8_t cmd_buf[15]; uint8_t cmd_length; -void process_commands(); -uint8_t process_command(); +void process_commands(void); +uint8_t process_command(void); -void interface_init() +void interface_init(void) { DDRD = (DDRD&0xFC)|0x02; serial_init(9600); } -void interface_check() +void interface_check(void) { if(recv_overrun) { @@ -34,7 +34,7 @@ void interface_check() process_commands(); } -void process_commands() +void process_commands(void) { while(recv_fill>0) { @@ -80,7 +80,7 @@ void process_commands() } } -uint8_t process_command() +uint8_t process_command(void) { uint8_t type = cmd_buf[0]>>4; if(type==0) diff --git a/arducontrol/interface.h b/arducontrol/interface.h index f95244f..7e89e2e 100644 --- a/arducontrol/interface.h +++ b/arducontrol/interface.h @@ -7,7 +7,7 @@ extern uint8_t cmd_buf[]; extern uint8_t cmd_length; -void interface_init(); -void interface_check(); +void interface_init(void); +void interface_check(void); #endif diff --git a/arducontrol/monitor.c b/arducontrol/monitor.c index 679c62a..112e1ac 100644 --- a/arducontrol/monitor.c +++ b/arducontrol/monitor.c @@ -17,15 +17,15 @@ volatile uint16_t input_voltage_sum = 0; volatile uint8_t adc_state = 0; volatile uint16_t adc_value = 0; -uint16_t track_current_milliamps(); -uint16_t input_voltage_millivolts(); +uint16_t track_current_milliamps(void); +uint16_t input_voltage_millivolts(void); -void monitor_init() +void monitor_init(void) { adc_init(); } -void monitor_check() +void monitor_check(void) { if(!(adc_state&1)) { @@ -66,7 +66,7 @@ void monitor_check() } } -uint8_t monitor_command() +uint8_t monitor_command(void) { if(cmd_buf[0]==READ_TRACK_CURRENT) { @@ -110,7 +110,7 @@ uint8_t monitor_command() return COMMAND_OK; } -uint16_t track_current_milliamps() +uint16_t track_current_milliamps(void) { uint16_t value = track_current_sum; @@ -127,7 +127,7 @@ uint16_t track_current_milliamps() } } -uint16_t input_voltage_millivolts() +uint16_t input_voltage_millivolts(void) { uint16_t value = input_voltage_sum; diff --git a/arducontrol/monitor.h b/arducontrol/monitor.h index d5761e3..b21763d 100644 --- a/arducontrol/monitor.h +++ b/arducontrol/monitor.h @@ -3,8 +3,8 @@ #include -void monitor_init(); -void monitor_check(); -uint8_t monitor_command(); +void monitor_init(void); +void monitor_check(void); +uint8_t monitor_command(void); #endif diff --git a/arducontrol/motorola.c b/arducontrol/motorola.c index 5bf15ad..33cf1c0 100644 --- a/arducontrol/motorola.c +++ b/arducontrol/motorola.c @@ -125,7 +125,7 @@ void motorola_solenoid_packet(uint8_t addr, uint8_t output, uint8_t state) packet.ready = 1; } -uint8_t motorola_command() +uint8_t motorola_command(void) { if(cmd_buf[0]==MOTOROLA_SPEED || cmd_buf[0]==MOTOROLA_SPEED_DIRECTION || cmd_buf[0]==MOTOROLA_SPEED_FUNCTION) { diff --git a/arducontrol/motorola.h b/arducontrol/motorola.h index 5a3057a..4a64d62 100644 --- a/arducontrol/motorola.h +++ b/arducontrol/motorola.h @@ -9,6 +9,6 @@ void motorola_locomotive_speed_direction_packet(uint8_t, uint8_t, uint8_t, uint8 void motorola_locomotive_speed_function_packet(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t); void motorola_solenoid_packet(uint8_t, uint8_t, uint8_t); void motorola_set_repeat_count(uint8_t); -uint8_t motorola_command(); +uint8_t motorola_command(void); #endif diff --git a/arducontrol/output.c b/arducontrol/output.c index 4b66296..748c554 100644 --- a/arducontrol/output.c +++ b/arducontrol/output.c @@ -13,7 +13,7 @@ uint8_t out_time; uint8_t out_data; uint8_t delay_time; -void output_init() +void output_init(void) { DDRD = (DDRD&0xF3)|0x0C; PORTD &= ~BIT(ENABLE); @@ -21,7 +21,7 @@ void output_init() timer_start_hz(0, 80000, 1); } -void clear_packet() +void clear_packet(void) { packet.ready = 0; packet.sending = 0; @@ -36,7 +36,7 @@ void output_set_power(uint8_t p) PORTD &= ~BIT(ENABLE); } -uint8_t output_command() +uint8_t output_command(void) { if(cmd_buf[0]==POWER_ON || cmd_buf[0]==POWER_OFF) { @@ -51,7 +51,7 @@ uint8_t output_command() return COMMAND_OK; } -static inline void output_tick() +static inline void output_tick(void) { if(delay_time && --delay_time) return; diff --git a/arducontrol/output.h b/arducontrol/output.h index b4498ad..05c9a21 100644 --- a/arducontrol/output.h +++ b/arducontrol/output.h @@ -18,9 +18,9 @@ typedef struct extern OutputPacket packet; -void output_init(); -void clear_packet(); +void output_init(void); +void clear_packet(void); void output_set_power(uint8_t); -uint8_t output_command(); +uint8_t output_command(void); #endif