From: Vincent Bernat Date: Thu, 24 Sep 2009 08:27:15 +0000 (+0200) Subject: Use "void" instead of empty parameter list for function prototypes. X-Git-Tag: 0.5.0~37^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6f1046d1b9ee6dd4f85564ddbaf2fb79d2d930e7;p=thirdparty%2Flldpd.git Use "void" instead of empty parameter list for function prototypes. Using empty parameter list means that we don't know what are the parameters of a function, while using "void" means that there is no parameter for this function. Some compilers are ticky about this. See C99 6.11.6 and 6.7.5.3 ยง14. This also allows to fix a little bug: priv_ctl_create was called with a parameter. --- diff --git a/src/lldpd.c b/src/lldpd.c index 19edad42..2d1b336a 100644 --- a/src/lldpd.c +++ b/src/lldpd.c @@ -73,7 +73,7 @@ static void lldpd_update_localports(struct lldpd *); static void lldpd_cleanup(struct lldpd *); static void lldpd_loop(struct lldpd *); static void lldpd_shutdown(int); -static void lldpd_exit(); +static void lldpd_exit(void); static void lldpd_send_all(struct lldpd *); static void lldpd_recv_all(struct lldpd *); static int lldpd_guess_type(struct lldpd *, char *, int); @@ -888,7 +888,7 @@ lldpd_main(int argc, char *argv[]) #endif /* USE_SNMP */ /* Create socket */ - if ((cfg->g_ctl = priv_ctl_create(cfg)) == -1) + if ((cfg->g_ctl = priv_ctl_create()) == -1) fatalx("unable to create control socket " LLDPD_CTL_SOCKET); if (lldpd_callback_add(cfg, cfg->g_ctl, ctl_accept, NULL) != 0) fatalx("unable to add callback for control socket"); diff --git a/src/lldpd.h b/src/lldpd.h index 51772413..f0af0341 100644 --- a/src/lldpd.h +++ b/src/lldpd.h @@ -403,12 +403,12 @@ void lldpd_ifh_mgmt(struct lldpd *, struct ifaddrs *); /* dmi.c */ #ifdef ENABLE_LLDPMED -char *dmi_hw(); -char *dmi_fw(); -char *dmi_sn(); -char *dmi_manuf(); -char *dmi_model(); -char *dmi_asset(); +char *dmi_hw(void); +char *dmi_fw(void); +char *dmi_sn(void); +char *dmi_manuf(void); +char *dmi_model(void); +char *dmi_asset(void); #endif /* log.c */ @@ -425,11 +425,11 @@ void fatal(const char *); void fatalx(const char *); /* agent.c */ -void agent_shutdown(); +void agent_shutdown(void); void agent_init(struct lldpd *, int); /* agent_priv.c */ -void agent_priv_register_domain(); +void agent_priv_register_domain(void); /* client.c */ struct client_handle { @@ -450,9 +450,9 @@ void client_handle_shutdown(struct lldpd *, struct hmsg *, /* priv.c */ void priv_init(char*); -int priv_ctl_create(); -void priv_ctl_cleanup(); -char *priv_gethostbyname(); +int priv_ctl_create(void); +void priv_ctl_cleanup(void); +char *priv_gethostbyname(void); int priv_open(char*); int priv_ethtool(char*, struct ethtool_cmd*); int priv_iface_init(const char *);