]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
smatch: extern keyword is needed only in header
authorSami Kerola <kerolasa@iki.fi>
Sun, 1 Jan 2017 19:19:22 +0000 (19:19 +0000)
committerSami Kerola <kerolasa@iki.fi>
Fri, 6 Jan 2017 22:05:10 +0000 (22:05 +0000)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
12 files changed:
ui/asn.c
ui/curses.c
ui/display.c
ui/dns.c
ui/gtk.c
ui/mtr.c
ui/net.c
ui/raw.c
ui/report.c
ui/select.c
ui/split.c
ui/utils.c

index 4239ad0f0a0823428627ba6beb21748991bc31c8..c38034b1ba88c95debe3f28623d392717cf567b8 100644 (file)
--- a/ui/asn.c
+++ b/ui/asn.c
@@ -256,11 +256,11 @@ static char *get_ipinfo(struct mtr_ctl *ctl, ip_t *addr){
     return val;
 }
 
-extern ATTRIBUTE_CONST size_t get_iiwidth_len(void) {
+ATTRIBUTE_CONST size_t get_iiwidth_len(void) {
     return (sizeof(iiwidth) / sizeof((iiwidth)[0]));
 }
 
-extern ATTRIBUTE_CONST int get_iiwidth(int ipinfo_no) {
+ATTRIBUTE_CONST int get_iiwidth(int ipinfo_no) {
     static const int len = (sizeof(iiwidth) / sizeof((iiwidth)[0]));
 
     if (ipinfo_no < len)
@@ -268,7 +268,7 @@ extern ATTRIBUTE_CONST int get_iiwidth(int ipinfo_no) {
     return iiwidth[ipinfo_no % len];
 }
 
-extern char *fmt_ipinfo(struct mtr_ctl *ctl, ip_t *addr){
+char *fmt_ipinfo(struct mtr_ctl *ctl, ip_t *addr){
     char *ipinfo = get_ipinfo(ctl, addr);
     char fmt[8];
     snprintf(fmt, sizeof(fmt), "%s%%-%ds", ctl->ipinfo_no?"":"AS", get_iiwidth(ctl->ipinfo_no));
@@ -276,11 +276,11 @@ extern char *fmt_ipinfo(struct mtr_ctl *ctl, ip_t *addr){
     return fmtinfo;
 }
 
-extern int is_printii(struct mtr_ctl *ctl) {
+int is_printii(struct mtr_ctl *ctl) {
     return ((ctl->ipinfo_no >= 0) && (ctl->ipinfo_no != ctl->ipinfo_max));
 }
 
-extern void asn_open(struct mtr_ctl *ctl) {
+void asn_open(struct mtr_ctl *ctl) {
     if (ctl->ipinfo_no >= 0) {
         DEB_syslog(LOG_INFO, "hcreate(%d)", IIHASH_HI);
         if (!(iihash = hcreate(IIHASH_HI)))
@@ -288,7 +288,7 @@ extern void asn_open(struct mtr_ctl *ctl) {
     }
 }
 
-extern void asn_close(struct mtr_ctl *ctl) {
+void asn_close(struct mtr_ctl *ctl) {
     if ((ctl->ipinfo_no >= 0) && iihash) {
         DEB_syslog(LOG_INFO, "hdestroy()");
         hdestroy();
index 214f27dfbc4ad4f7d7f8d0b2a52c0214bad92c47..0ec2e56571b5778160dfc57db68422ada52cc7eb 100644 (file)
@@ -117,7 +117,7 @@ static char *format_number (int n, int w, char *buf)
 }
 
 
-extern int mtr_curses_keyaction(struct mtr_ctl *ctl)
+int mtr_curses_keyaction(struct mtr_ctl *ctl)
 {
   int c = getch();
   int i = 0;
@@ -608,7 +608,7 @@ static void mtr_curses_graph(struct mtr_ctl *ctl, int startstat, int cols)
 }
 
 
-extern void mtr_curses_redraw(struct mtr_ctl *ctl)
+void mtr_curses_redraw(struct mtr_ctl *ctl)
 {
   int maxx;
   int startstat;
@@ -707,7 +707,7 @@ extern void mtr_curses_redraw(struct mtr_ctl *ctl)
 }
 
 
-extern void mtr_curses_open(struct mtr_ctl *ctl)
+void mtr_curses_open(struct mtr_ctl *ctl)
 {
   int bg_col = 0;
   int i;
@@ -726,14 +726,14 @@ extern void mtr_curses_open(struct mtr_ctl *ctl)
 }
 
 
-extern void mtr_curses_close(void)
+void mtr_curses_close(void)
 {  
   printw("\n");
   endwin();
 }
 
 
-extern void mtr_curses_clear(struct mtr_ctl *ctl)
+void mtr_curses_clear(struct mtr_ctl *ctl)
 {
   mtr_curses_close();
   mtr_curses_open(ctl);
index 58ba2c07df28ac72fbe0f4441b7a2d36c6e53607..00fa5d552e173548f50a0cc81904861dbbfe68ec 100644 (file)
@@ -53,7 +53,7 @@
 # define UNUSED_IF_NO_GTK ATTRIBUTE_UNUSED
 #endif
 
-extern void display_detect(struct mtr_ctl *ctl, int *argc UNUSED_IF_NO_GTK,
+void display_detect(struct mtr_ctl *ctl, int *argc UNUSED_IF_NO_GTK,
                           char ***argv UNUSED_IF_NO_GTK)
 {
   ctl->DisplayMode = DEFAULT_DISPLAY;
@@ -66,7 +66,7 @@ extern void display_detect(struct mtr_ctl *ctl, int *argc UNUSED_IF_NO_GTK,
 }
 
 
-extern void display_open(struct mtr_ctl *ctl)
+void display_open(struct mtr_ctl *ctl)
 {
   switch(ctl->DisplayMode) {
 
@@ -108,7 +108,7 @@ extern void display_open(struct mtr_ctl *ctl)
 }
 
 
-extern void display_close(struct mtr_ctl *ctl)
+void display_close(struct mtr_ctl *ctl)
 {
   time_t now;
 
@@ -150,7 +150,7 @@ extern void display_close(struct mtr_ctl *ctl)
 }
 
 
-extern void display_redraw(struct mtr_ctl *ctl)
+void display_redraw(struct mtr_ctl *ctl)
 {
   switch(ctl->DisplayMode) {
 
@@ -173,7 +173,7 @@ extern void display_redraw(struct mtr_ctl *ctl)
 }
 
 
-extern int display_keyaction(struct mtr_ctl *ctl)
+int display_keyaction(struct mtr_ctl *ctl)
 {
   switch(ctl->DisplayMode) {
 #ifdef HAVE_CURSES
@@ -193,28 +193,28 @@ extern int display_keyaction(struct mtr_ctl *ctl)
 }
 
 
-extern void display_rawxmit(struct mtr_ctl *ctl, int host, int seq)
+void display_rawxmit(struct mtr_ctl *ctl, int host, int seq)
 {
   if (ctl->DisplayMode == DisplayRaw)
     raw_rawxmit (host, seq);
 }
 
 
-extern void display_rawping(struct mtr_ctl *ctl, int host, int msec, int seq)
+void display_rawping(struct mtr_ctl *ctl, int host, int msec, int seq)
 {
   if (ctl->DisplayMode == DisplayRaw)
     raw_rawping (ctl, host, msec, seq);
 }
 
 
-extern void display_rawhost(struct mtr_ctl *ctl, int host, ip_t *ip_addr)
+void display_rawhost(struct mtr_ctl *ctl, int host, ip_t *ip_addr)
 {
   if (ctl->DisplayMode == DisplayRaw)
     raw_rawhost (ctl, host, ip_addr);
 }
 
 
-extern void display_loop(struct mtr_ctl *ctl)
+void display_loop(struct mtr_ctl *ctl)
 {
 #ifdef HAVE_GTK
   if (ctl->DisplayMode == DisplayGTK)
@@ -225,7 +225,7 @@ extern void display_loop(struct mtr_ctl *ctl)
 }
 
 
-extern void display_clear(struct mtr_ctl *ctl)
+void display_clear(struct mtr_ctl *ctl)
 {
 #ifdef HAVE_CURSES
   if (ctl->DisplayMode == DisplayCurses)
index 7e976cffc3f5c5f5f2ca3a4822096ddcde304de3..df0e8c3bb768e53d4a9565725063c7f4ad1412dc 100644 (file)
--- a/ui/dns.c
+++ b/ui/dns.c
@@ -48,9 +48,9 @@ struct dns_results {
   struct dns_results *next;
 };
 
-struct dns_results *results;
+static struct dns_results *results;
 
-extern char *strlongip(struct mtr_ctl *ctl, ip_t * ip)
+char *strlongip(struct mtr_ctl *ctl, ip_t * ip)
 {
 #ifdef ENABLE_IPV6
   static char addrstr[INET6_ADDRSTRLEN];
@@ -81,7 +81,7 @@ static int longipstr( char *s, ip_t *dst, int family UNUSED_IF_NO_IPV6)
 }
 
 
-extern struct hostent * dns_forward(const char *name)
+struct hostent * dns_forward(const char *name)
 {
   struct hostent *host;
 
@@ -124,7 +124,7 @@ static void set_sockaddr_ip (struct mtr_ctl *ctl, struct sockaddr_storage *sa, i
   }
 }
 
-extern void dns_open(struct mtr_ctl *ctl)
+void dns_open(struct mtr_ctl *ctl)
 {
   int pid; 
  
@@ -205,13 +205,13 @@ extern void dns_open(struct mtr_ctl *ctl)
   }
 }
 
-extern int dns_waitfd (void)
+int dns_waitfd (void)
 {
   return fromdns[0];
 }
 
 
-extern void dns_ack(struct mtr_ctl *ctl)
+void dns_ack(struct mtr_ctl *ctl)
 {
   char buf[2048], host[NI_MAXHOST], name[NI_MAXHOST];  
   ip_t hostip; 
@@ -233,12 +233,12 @@ extern void dns_ack(struct mtr_ctl *ctl)
 
 #ifdef ENABLE_IPV6
 
-extern int dns_waitfd6 (void)
+int dns_waitfd6 (void)
 {
   return  -1;
 }
 
-extern void dns_ack6(void)
+void dns_ack6(void)
 {
   return;
 }
@@ -246,7 +246,7 @@ extern void dns_ack6(void)
 #endif
 
 
-extern char *dns_lookup2(struct mtr_ctl *ctl, ip_t * ip)
+char *dns_lookup2(struct mtr_ctl *ctl, ip_t * ip)
 {
   struct dns_results *r;
   char buf[INET6_ADDRSTRLEN + 1];
@@ -274,7 +274,7 @@ extern char *dns_lookup2(struct mtr_ctl *ctl, ip_t * ip)
 }
 
 
-extern char *dns_lookup(struct mtr_ctl *ctl, ip_t * ip)
+char *dns_lookup(struct mtr_ctl *ctl, ip_t * ip)
 {
   char *t;
 
@@ -287,7 +287,7 @@ extern char *dns_lookup(struct mtr_ctl *ctl, ip_t * ip)
 /* XXX check if necessary/exported. */
 
 /* Resolve an IP address to a hostname. */ 
-extern struct hostent *addr2host( const char *addr, int family ) {
+struct hostent *addr2host( const char *addr, int family ) {
   int len = 0;
   switch ( family ) {
   case AF_INET:
index 97ab0a3c4865a280e14deccb6dd07109924cfe9d..c84ef369173dc8edd65433099e64ecb3b4952693 100644 (file)
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -76,7 +76,7 @@ static void gtk_do_init(int *argc, char ***argv)
 }
 
 
-extern int gtk_detect(ATTRIBUTE_UNUSED int *argc, ATTRIBUTE_UNUSED char ***argv)
+int gtk_detect(ATTRIBUTE_UNUSED int *argc, ATTRIBUTE_UNUSED char ***argv)
 {
   if(getenv("DISPLAY") != NULL) {
     /* If we do this here, gtk_init exits on an error. This happens
@@ -504,7 +504,7 @@ static void update_tree_row(struct mtr_ctl *ctl, int row, GtkTreeIter *iter)
 #endif
 }
 
-extern void gtk_redraw(struct mtr_ctl *ctl)
+void gtk_redraw(struct mtr_ctl *ctl)
 {
   int max = net_max(ctl);
   
@@ -555,7 +555,7 @@ static void Window_fill(struct mtr_ctl *ctl, GtkWidget *Window)
 }
 
 
-extern void gtk_open(struct mtr_ctl *ctl)
+void gtk_open(struct mtr_ctl *ctl)
 {
   GdkPixbuf *icon;
   int argc = 1;
@@ -586,12 +586,12 @@ extern void gtk_open(struct mtr_ctl *ctl)
 }
 
 
-extern void gtk_close(void)
+void gtk_close(void)
 {
 }
 
 
-extern int gtk_keyaction(void)
+int gtk_keyaction(void)
 {
   return 0;
 }
@@ -642,7 +642,7 @@ static gboolean gtk_dns_data6(ATTRIBUTE_UNUSED GIOChannel *channel,
 #endif
 
 
-extern void gtk_loop(struct mtr_ctl *ctl)
+void gtk_loop(struct mtr_ctl *ctl)
 {
   GIOChannel *net_iochannel, *dns_iochannel;
 
index c9f48b433411ac832475c00e7327e9d1d7ae35d4..c635aec4e2b79b4f0c1fc3f667d87265ee8a1765 100644 (file)
--- a/ui/mtr.c
+++ b/ui/mtr.c
@@ -617,7 +617,7 @@ static void init_rand(void)
   srand((getpid() << 16) ^ getuid() ^ tv.tv_sec ^ tv.tv_usec);
 }
 
-extern int main(int argc, char **argv)
+int main(int argc, char **argv)
 {
   struct hostent *  host                = NULL;
   struct addrinfo       hints, *res;
index e49de8e7a809d445ed6e3f219808993ebe7b5711..bf64d5f651c98c9f3b7bfcd198ea28d942c58ca4 100644 (file)
--- a/ui/net.c
+++ b/ui/net.c
@@ -114,7 +114,7 @@ static int numhosts = 10;
 
 /* return the number of microseconds to wait before sending the next
    ping */
-extern int calc_deltatime (float waittime)
+int calc_deltatime (float waittime)
 {
   waittime /= numhosts;
   return 1000000 * waittime;
@@ -262,79 +262,79 @@ static void net_process_ping(
     Invoked when the read pipe from the mtr-packet subprocess is readable.
     If we have received a complete reply, process it.
 */
-extern void net_process_return(struct mtr_ctl *ctl)
+void net_process_return(struct mtr_ctl *ctl)
 {
   handle_command_replies(ctl, &packet_command_pipe, net_process_ping);
 }
 
 
-extern ip_t *net_addr(int at) 
+ip_t *net_addr(int at)
 {
   return (ip_t *)&(host[at].addr);
 }
 
 
-extern ip_t *net_addrs(int at, int i) 
+ip_t *net_addrs(int at, int i)
 {
   return (ip_t *)&(host[at].addrs[i]);
 }
 
-extern void *net_mpls(int at)
+void *net_mpls(int at)
 {
   return (struct mplslen *)&(host[at].mplss);
 }
 
-extern void *net_mplss(int at, int i)
+void *net_mplss(int at, int i)
 {
   return (struct mplslen *)&(host[at].mplss[i]);
 }
 
-extern int net_loss(int at) 
+int net_loss(int at)
 {
-  if ((host[at].xmit - host[at].transit) == 0) 
+  if ((host[at].xmit - host[at].transit) == 0)
     return 0;
   /* times extra 1000 */
   return 1000*(100 - (100.0 * host[at].returned / (host[at].xmit - host[at].transit)) );
 }
 
 
-extern int net_drop(int at) 
+int net_drop(int at)
 {
   return (host[at].xmit - host[at].transit) - host[at].returned;
 }
 
 
-extern int net_last(int at) 
+int net_last(int at)
 {
   return (host[at].last);
 }
 
 
-extern int net_best(int at) 
+int net_best(int at)
 {
   return (host[at].best);
 }
 
 
-extern int net_worst(int at) 
+int net_worst(int at)
 {
   return (host[at].worst);
 }
 
 
-extern int net_avg(int at) 
+int net_avg(int at)
 {
   return (host[at].avg);
 }
 
 
-extern int net_gmean(int at) 
+int net_gmean(int at)
 {
   return (host[at].gmean);
 }
 
 
-extern int net_stdev(int at) 
+int net_stdev(int at)
 {
   if( host[at].returned > 1 ) {
     return ( sqrt( host[at].ssd/(host[at].returned -1.0) ) );
@@ -344,31 +344,31 @@ extern int net_stdev(int at)
 }
 
 
-extern int net_jitter(int at) 
+int net_jitter(int at)
 { 
   return (host[at].jitter); 
 }
 
 
-extern int net_jworst(int at) 
+int net_jworst(int at)
 { 
   return (host[at].jworst); 
 }
 
 
-extern int net_javg(int at) 
+int net_javg(int at)
 { 
   return (host[at].javg); 
 }
 
 
-extern int net_jinta(int at) 
+int net_jinta(int at)
 { 
   return (host[at].jinta); 
 }
 
 
-extern int net_max(struct mtr_ctl *ctl)
+int net_max(struct mtr_ctl *ctl)
 {
   int at;
   int max;
@@ -388,37 +388,37 @@ extern int net_max(struct mtr_ctl *ctl)
 }
 
 
-extern int net_min (struct mtr_ctl *ctl)
+int net_min (struct mtr_ctl *ctl)
 {
   return ( ctl->fstTTL - 1 );
 }
 
 
-extern int net_returned(int at) 
+int net_returned(int at)
 { 
   return host[at].returned;
 }
 
 
-extern int net_xmit(int at) 
+int net_xmit(int at)
 { 
   return host[at].xmit;
 }
 
 
-extern int net_up(int at) 
+int net_up(int at)
 {
    return host[at].up;
 }
 
 
-extern char * net_localaddr (void)
+char * net_localaddr (void)
 {
   return localaddr;
 }
 
 
-extern void net_end_transit(void) 
+void net_end_transit(void)
 {
   int at;
   
@@ -427,7 +427,7 @@ extern void net_end_transit(void)
   }
 }
 
-extern int net_send_batch(struct mtr_ctl *ctl)
+int net_send_batch(struct mtr_ctl *ctl)
 {
   int n_unknown=0, i;
 
@@ -556,7 +556,7 @@ static void net_find_local_address(void)
 }
 
 
-extern int net_open(struct mtr_ctl *ctl, struct hostent * hostent)
+int net_open(struct mtr_ctl *ctl, struct hostent * hostent)
 {
   int err;
 
@@ -597,7 +597,7 @@ extern int net_open(struct mtr_ctl *ctl, struct hostent * hostent)
 }
 
 
-extern void net_reopen(struct mtr_ctl *ctl, struct hostent * addr)
+void net_reopen(struct mtr_ctl *ctl, struct hostent * addr)
 {
   int at;
 
@@ -626,7 +626,7 @@ extern void net_reopen(struct mtr_ctl *ctl, struct hostent * addr)
 }
 
 
-extern void net_reset(struct mtr_ctl *ctl)
+void net_reset(struct mtr_ctl *ctl)
 {
   static struct nethost template = {
     .saved_seq_offset = 2 - SAVED_PINGS
@@ -652,19 +652,19 @@ extern void net_reset(struct mtr_ctl *ctl)
 
 
 /*  Close the pipe to the packet generator process, and kill the process  */
-extern void net_close(void)
+void net_close(void)
 {
   close_command_pipe(&packet_command_pipe);
 }
 
 
-extern int net_waitfd(void)
+int net_waitfd(void)
 {
   return packet_command_pipe.read_fd;
 }
 
 
-extern int* net_saved_pings(int at)
+int* net_saved_pings(int at)
 {
   return host[at].saved;
 }
@@ -681,15 +681,15 @@ static void net_save_increment(void)
 }
 
 
-extern void net_save_xmit(int at)
+void net_save_xmit(int at)
 {
-  if (host[at].saved[SAVED_PINGS-1] != -2) 
+  if (host[at].saved[SAVED_PINGS-1] != -2)
     net_save_increment();
   host[at].saved[SAVED_PINGS-1] = -1;
 }
 
 
-extern void net_save_return(int at, int seq, int ms)
+void net_save_return(int at, int seq, int ms)
 {
   int idx;
   idx = seq - host[at].saved_seq_offset;
@@ -727,7 +727,7 @@ static void sockaddrtop( struct sockaddr * saddr, char * strptr, size_t len ) {
 
 
 /* Address comparison. */
-extern int addrcmp( char * a, char * b, int family ) {
+int addrcmp( char * a, char * b, int family ) {
   int rc = -1;
 
   switch ( family ) {
@@ -745,7 +745,7 @@ extern int addrcmp( char * a, char * b, int family ) {
 }
 
 /* Address copy. */
-extern void addrcpy( char * a, char * b, int family ) {
+void addrcpy( char * a, char * b, int family ) {
 
   switch ( family ) {
   case AF_INET:
@@ -760,7 +760,7 @@ extern void addrcpy( char * a, char * b, int family ) {
 }
 
 /* for GTK frontend */
-extern void net_harvest_fds(struct mtr_ctl *ctl)
+void net_harvest_fds(struct mtr_ctl *ctl)
 {
   fd_set writefd;
   int maxfd = 0;
index 89cb2bb3c1c467668ba43afa2eb78dc9721bbc3b..a745cd72a37d89c91aece4c5f41a2ec4d5541612 100644 (file)
--- a/ui/raw.c
+++ b/ui/raw.c
 
 
 /* Log an echo request, or a "ping" */
-extern void raw_rawxmit (int host, int seq)
+void raw_rawxmit (int host, int seq)
 {
   printf ("x %d %d\n", host, seq);
   fflush (stdout);
 }
 
 /* Log an echo reply, or a "pong" */
-extern void raw_rawping (struct mtr_ctl *ctl, int host, int msec, int seq)
+void raw_rawping (struct mtr_ctl *ctl, int host, int msec, int seq)
 {
   static int havename[MaxHost];
   char *name;
@@ -59,7 +59,7 @@ extern void raw_rawping (struct mtr_ctl *ctl, int host, int msec, int seq)
 }
 
 
-extern void raw_rawhost (struct mtr_ctl *ctl, int host, ip_t * ip_addr)
+void raw_rawhost (struct mtr_ctl *ctl, int host, ip_t * ip_addr)
 {
   printf ("h %d %s\n", host, strlongip(ctl, ip_addr));
   fflush (stdout); 
index b8fbf41237904c35b5879504272aa62b721d8087..4e85c8fc3ff26dba3636f44bbf9aeedb951d427b 100644 (file)
@@ -38,7 +38,7 @@
 #define MAX_FORMAT_STR 81
 
 
-extern void report_open(void)
+void report_open(void)
 {
   const time_t now = time(NULL);
   const char *t = iso_time (&now);
@@ -66,7 +66,7 @@ static void print_mpls(struct mplslen *mpls) {
 }
 #endif
 
-extern void report_close(struct mtr_ctl *ctl)
+void report_close(struct mtr_ctl *ctl)
 {
   int i, j, at, max, z, w;
   struct mplslen *mpls, *mplss;
@@ -233,23 +233,23 @@ extern void report_close(struct mtr_ctl *ctl)
 }
 
 
-extern void txt_open(void)
+void txt_open(void)
 {
 }
 
 
-extern void txt_close(struct mtr_ctl *ctl)
+void txt_close(struct mtr_ctl *ctl)
 {
   report_close(ctl);
 }
 
 
-extern void json_open(void)
+void json_open(void)
 {
 }
 
 
-extern void json_close(struct mtr_ctl *ctl)
+void json_close(struct mtr_ctl *ctl)
 {
   int i, j, at, first, max;
   ip_t *addr;
@@ -338,12 +338,12 @@ extern void json_close(struct mtr_ctl *ctl)
 
 
 
-extern void xml_open(void)
+void xml_open(void)
 {
 }
 
 
-extern void xml_close(struct mtr_ctl *ctl)
+void xml_close(struct mtr_ctl *ctl)
 {
   int i, j, at, max;
   ip_t *addr;
@@ -404,11 +404,11 @@ extern void xml_close(struct mtr_ctl *ctl)
 }
 
 
-extern void csv_open(void)
+void csv_open(void)
 {
 }
 
-extern void csv_close(struct mtr_ctl *ctl, time_t now)
+void csv_close(struct mtr_ctl *ctl, time_t now)
 {
   int i, j, at, max;
   ip_t *addr;
index c9de0faa882f3331b4b99cb7af89eff56c80c09e..6e1431a78d7c2d4366e1a2c92c0db48ccea99440 100644 (file)
@@ -41,7 +41,7 @@
 #include "display.h"
 #include "select.h"
 
-extern void select_loop(struct mtr_ctl *ctl){
+void select_loop(struct mtr_ctl *ctl){
   fd_set readfd;
   fd_set writefd;
   int anyset = 0;
index dc4b34e0bfc895e143f03eceb1fcc5d8813ca5d8..e75ca9db0fea6cedfbf34e7bda83c7477b04a0bc 100644 (file)
@@ -64,7 +64,7 @@ static int  LineCount;
 #define DEBUG 0
 
 
-extern void split_redraw(struct mtr_ctl *ctl)
+void split_redraw(struct mtr_ctl *ctl)
 {
   int   max;
   int   at;
@@ -126,7 +126,7 @@ extern void split_redraw(struct mtr_ctl *ctl)
 }
 
 
-extern void split_open(void)
+void split_open(void)
 {
   int i;
 #if DEBUG
@@ -139,7 +139,7 @@ extern void split_open(void)
 }
 
 
-extern void split_close(void)
+void split_close(void)
 {
 #if DEBUG
   printf("split_close()\n");
@@ -147,7 +147,7 @@ extern void split_close(void)
 }
 
 
-extern int split_keyaction(void) 
+int split_keyaction(void) 
 {
 #ifdef HAVE_CURSES
   unsigned char c = getch();
index af12b1e2eaa8bd232ff28c6598ec1647d87d6b7d..d8259a8ecb9183e2afb623a8f3f0f224ee71ddb5 100644 (file)
@@ -40,7 +40,7 @@
 
 #include "utils.h"
 
-extern char *trim(char *str, const char c)
+char *trim(char *str, const char c)
 {
   char *p = str;
   size_t len;
@@ -68,7 +68,7 @@ extern char *trim(char *str, const char c)
 }
 
 /* Parse string, and return positive signed int. */
-extern int strtonum_or_err(const char *str, const char *errmesg, const int type)
+int strtonum_or_err(const char *str, const char *errmesg, const int type)
 {
   unsigned long int num;
   char *end = NULL;
@@ -93,7 +93,7 @@ extern int strtonum_or_err(const char *str, const char *errmesg, const int type)
   return 0;
 }
 
-extern float strtofloat_or_err(const char *str, const char *errmesg)
+float strtofloat_or_err(const char *str, const char *errmesg)
 {
   double num;
   char *end = NULL;
@@ -112,7 +112,7 @@ extern float strtofloat_or_err(const char *str, const char *errmesg)
   return 0;
 }
 
-extern void *xmalloc(const size_t size)
+void *xmalloc(const size_t size)
 {
   void *ret = malloc(size);
 
@@ -121,7 +121,7 @@ extern void *xmalloc(const size_t size)
   return ret;
 }
 
-extern char *xstrdup(const char *str)
+char *xstrdup(const char *str)
 {
   char *ret;
 
@@ -153,7 +153,7 @@ static inline int close_stream(FILE *stream)
   return 0;
 }
 /* Meant to be used atexit(close_stdout); */
-extern void close_stdout(void)
+void close_stdout(void)
 {
   if (close_stream(stdout) != 0 && !(errno == EPIPE)) {
     error(0, errno, "write error");
@@ -165,7 +165,7 @@ extern void close_stdout(void)
 
 /* ctime() replacement that will reteturn ISO-8601 timestamp string such as:
  * 2016-08-29T19:25:02+01:00 */
-extern const char *iso_time(const time_t *t)
+const char *iso_time(const time_t *t)
 {
   static char s[32];
   struct tm *tm;