]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Use "void" instead of empty parameter list for function prototypes.
authorVincent Bernat <bernat@luffy.cx>
Thu, 24 Sep 2009 08:27:15 +0000 (10:27 +0200)
committerVincent Bernat <bernat@luffy.cx>
Tue, 29 Sep 2009 14:44:58 +0000 (16:44 +0200)
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.

src/lldpd.c
src/lldpd.h

index 19edad42deef6cc4872141bfbb65d13e05f6e5e1..2d1b336a162a67d5fda242ad2963e242e8e72173 100644 (file)
@@ -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");
index 51772413142102ee2a6a5a4363e28f7b736faf80..f0af03412a04dc3bd5a2df2ecbaeaa0e088f5b90 100644 (file)
@@ -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 *);