Kaynağa Gözat

master:core Continue cleaning erroneous definition of functions with no arguments

After testing with gcc 4.5.2, seems that not prototyping function cases extra assembler code regardles of optimization level
Marius Zbihlei 13 yıl önce
ebeveyn
işleme
b264d2c6ec
7 değiştirilmiş dosya ile 15 ekleme ve 15 silme
  1. 1 1
      pt.c
  2. 3 3
      resolve.c
  3. 2 2
      rpc_lookup.c
  4. 1 1
      select_buf.c
  5. 5 5
      tcp_main.c
  6. 1 1
      tcp_read.c
  7. 2 2
      timer.c

+ 1 - 1
pt.c

@@ -80,7 +80,7 @@ unsigned int set_fork_delay(unsigned int v)
 }
 
 /* number of known "common" used fds */
-static int calc_common_open_fds_no()
+static int calc_common_open_fds_no(void)
 {
 	int max_fds_no;
 	

+ 3 - 3
resolve.c

@@ -128,7 +128,7 @@ int register_resolv_reinit_cb(on_resolv_reinit cb)
 /* counter init function
   must be called before fork
 */
-static int stat_init()
+static int stat_init(void)
 {
 	if (counter_register_array("dns", dns_cnt_defs) < 0)
 		goto error;
@@ -151,7 +151,7 @@ error:
  * will be used. See also resolv.conf(5).
  * returns: 0 on success, -1 on error
  */
-static int _resolv_init()
+static int _resolv_init(void)
 {
 	res_init();
 #ifdef HAVE_RESOLV_RES
@@ -173,7 +173,7 @@ static int _resolv_init()
 }
 
 /* wrapper function to initialize the resolver at startup */
-int resolv_init()
+int resolv_init(void)
 {
 	int res = -1;
 	_resolv_init();

+ 2 - 2
rpc_lookup.c

@@ -52,7 +52,7 @@ static int rpc_sarray_max_size; /* number of entries alloc'ed */
 /** init the rpc hash table.
   * @return 0 on success, -1 on error
   */
-int init_rpcs()
+int init_rpcs(void)
 {
 	if (str_hash_alloc(&rpc_hash_table, RPC_HASH_SIZE)<0)
 		return -1;
@@ -65,7 +65,7 @@ int init_rpcs()
 
 
 
-void destroy_rpcs()
+void destroy_rpcs(void)
 {
 	int r;
 	struct str_hash_entry* e;

+ 1 - 1
select_buf.c

@@ -136,7 +136,7 @@ char* get_static_buffer(int req_size) {
  * Reset offset to unused space
  */
 
-int reset_static_buffer() {
+int reset_static_buffer(void) {
 	int i;
 
 	if (active_buffer == -1) {

+ 5 - 5
tcp_main.c

@@ -1725,7 +1725,7 @@ error:
 
 #ifdef TCP_FD_CACHE
 
-static void tcp_fd_cache_init()
+static void tcp_fd_cache_init(void)
 {
 	int r;
 	for (r=0; r<TCP_FD_CACHE_SIZE; r++)
@@ -3174,7 +3174,7 @@ static void send_fd_queue_destroy(struct tcp_send_fd_q *q)
 
 
 
-static int init_send_fd_queues()
+static int init_send_fd_queues(void)
 {
 	if (send_fd_queue_init(&send2child_q, SEND_FD_QUEUE_SIZE)!=0)
 		goto error;
@@ -3186,7 +3186,7 @@ error:
 
 
 
-static void destroy_send_fd_queues()
+static void destroy_send_fd_queues(void)
 {
 	send_fd_queue_destroy(&send2child_q);
 }
@@ -4462,7 +4462,7 @@ static ticks_t tcpconn_main_timeout(ticks_t t, struct timer_ln* tl, void* data)
 
 
 
-static inline void tcp_timer_run()
+static inline void tcp_timer_run(void)
 {
 	ticks_t ticks;
 	
@@ -4480,7 +4480,7 @@ static inline void tcp_timer_run()
  * cleanup(). However it's also safe to call it from the tcp_main process.
  * => with the ser shutdown exception, it cannot execute in parallel
  * with tcpconn_add() or tcpconn_destroy()*/
-static inline void tcpconn_destroy_all()
+static inline void tcpconn_destroy_all(void)
 {
 	struct tcp_connection *c, *next;
 	unsigned h;

+ 1 - 1
tcp_read.c

@@ -1509,7 +1509,7 @@ error:
 
 
 
-inline static void tcp_reader_timer_run()
+inline static void tcp_reader_timer_run(void)
 {
 	ticks_t ticks;
 	

+ 2 - 2
timer.c

@@ -411,7 +411,7 @@ void check_ser_drift();
  *        - it works ok as long as the adjustment interval < MAX_TICKS_T
  * -- andrei
  */
-inline static void adjust_ticks()
+inline static void adjust_ticks(void)
 {
 	struct timeval crt_time;
 	long long diff_time;
@@ -924,7 +924,7 @@ inline static void timer_list_expire(ticks_t t, struct timer_head* h
  * WARNING: it should never be called twice for the same *ticks value
  * (it could cause too fast expires for long timers), *ticks must be also
  *  always increasing */
-static void timer_handler()
+static void timer_handler(void)
 {
 	ticks_t saved_ticks;
 #ifdef USE_SLOW_TIMER