1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-18 02:55:12 +00:00

tcp_portmon: drop useless function pointer cast, use OBJ_ARG

This commit is contained in:
Phil Sutter 2009-10-04 17:08:08 +02:00
parent 4d70cf07b8
commit da7876468f
3 changed files with 3 additions and 7 deletions

View File

@ -1685,7 +1685,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->data.s = strndup(arg, text_buffer_size);
#endif /* HDDTEMP */
#ifdef TCP_PORT_MONITOR
END OBJ(tcp_portmon, (void (*)(void))&tcp_portmon_update)
END OBJ_ARG(tcp_portmon, &tcp_portmon_update, "tcp_portmon: needs arguments")
tcp_portmon_init(arg, &obj->data.tcp_port_monitor);
#endif /* TCP_PORT_MONITOR */
END OBJ(entropy_avail, &update_entropy)

View File

@ -34,9 +34,6 @@ int tcp_portmon_init(const char *arg, struct tcp_port_monitor_data *pmd)
memset(itembuf, 0, sizeof(itembuf));
connection_index = 0;
/* massive argument checking */
if (!arg) {
CRIT_ERR(NULL, NULL, "tcp_portmon: needs arguments");
}
argc = sscanf(arg, "%d %d %31s %d", &port_begin, &port_end, itembuf,
&connection_index);
if ((argc != 3) && (argc != 4)) {
@ -133,10 +130,9 @@ int tcp_portmon_action(char *p, int p_max_size, struct tcp_port_monitor_data *pm
return 0;
}
int tcp_portmon_update(void)
void tcp_portmon_update(void)
{
update_tcp_port_monitor_collection(pmc);
return 0;
}
int tcp_portmon_clear(void)

View File

@ -37,7 +37,7 @@ struct tcp_port_monitor_data {
int tcp_portmon_init(const char *, struct tcp_port_monitor_data *);
int tcp_portmon_action(char *, int, struct tcp_port_monitor_data *);
int tcp_portmon_update(void);
void tcp_portmon_update(void);
int tcp_portmon_clear(void);
int tcp_portmon_set_max_connections(int);