remove a bunch of duplicate includes
authorLuigi Rizzo <rizzo@icir.org>
Fri, 16 Nov 2007 23:54:45 +0000 (23:54 +0000)
committerLuigi Rizzo <rizzo@icir.org>
Fri, 16 Nov 2007 23:54:45 +0000 (23:54 +0000)
Reproduce with

grep -r #include . | grep -v .svn | grep -v Binary | sort | uniq -c | sort -nr

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89348 65c4cc65-6c06-0410-ace0-fbb531ad65f3

20 files changed:
apps/app_dumpchan.c
apps/app_parkandannounce.c
apps/app_rpt.c
channels/chan_agent.c
channels/chan_features.c
funcs/func_blacklist.c
funcs/func_lock.c
funcs/func_module.c
funcs/func_strings.c
main/asterisk.c
main/logger.c
main/rtp.c
main/udptl.c
pbx/dundi-parser.c
pbx/pbx_dundi.c
pbx/pbx_loopback.c
pbx/pbx_realtime.c
res/res_adsi.c
res/res_agi.c
res/res_features.c

index 1561091..768f3e2 100644 (file)
@@ -40,7 +40,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/options.h"
 #include "asterisk/utils.h"
 #include "asterisk/lock.h"
-#include "asterisk/utils.h"
 
 static char *app = "DumpChan";
 static char *synopsis = "Dump Info About The Calling Channel";
index c13ea5a..9ae1f2e 100644 (file)
@@ -40,7 +40,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/module.h"
 #include "asterisk/features.h"
 #include "asterisk/options.h"
-#include "asterisk/logger.h"
 #include "asterisk/say.h"
 #include "asterisk/lock.h"
 #include "asterisk/utils.h"
index 0b149c6..e9c9d73 100644 (file)
@@ -214,7 +214,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include <errno.h>
 #include <dirent.h>
 #include <ctype.h>
-#include <sys/stat.h>
 #include <sys/time.h>
 #include <sys/file.h>
 #include <sys/ioctl.h>
index 5f6fc29..cc202a5 100644 (file)
@@ -50,7 +50,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/module.h"
 #include "asterisk/pbx.h"
 #include "asterisk/options.h"
-#include "asterisk/lock.h"
 #include "asterisk/sched.h"
 #include "asterisk/io.h"
 #include "asterisk/rtp.h"
index 6bb9bbe..f1b251f 100644 (file)
@@ -49,7 +49,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/module.h"
 #include "asterisk/pbx.h"
 #include "asterisk/options.h"
-#include "asterisk/lock.h"
 #include "asterisk/sched.h"
 #include "asterisk/io.h"
 #include "asterisk/rtp.h"
index b0a42a4..331af81 100644 (file)
@@ -41,7 +41,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/image.h"
 #include "asterisk/callerid.h"
 #include "asterisk/astdb.h"
-#include "asterisk/options.h"
 
 static int blacklist_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len)
 {
index 2233996..4ed1131 100644 (file)
@@ -37,7 +37,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/channel.h"
 #include "asterisk/pbx.h"
 #include "asterisk/module.h"
-#include "asterisk/options.h"
 #include "asterisk/linkedlists.h"
 
 AST_LIST_HEAD_STATIC(locklist, lock_frame);
index 8f0521a..a745212 100644 (file)
@@ -33,7 +33,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/logger.h"
 #include "asterisk/utils.h"
 #include "asterisk/app.h"
-#include "asterisk/module.h"
 
 static int ifmodule_read(struct ast_channel *chan, const char *cmd, char *data,
                    char *buf, size_t len)
index ba7075b..39b4022 100644 (file)
@@ -39,7 +39,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/utils.h"
 #include "asterisk/app.h"
 #include "asterisk/localtime.h"
-#include "asterisk/options.h"
 
 static int function_fieldqty(struct ast_channel *chan, const char *cmd,
                             char *parse, char *buf, size_t len)
index 1f03484..3db9c0c 100644 (file)
@@ -117,7 +117,6 @@ int daemon(int, int);  /* defined in libresolv of all places */
 #include "asterisk/utils.h"
 #include "asterisk/file.h"
 #include "asterisk/io.h"
-#include "asterisk/lock.h"
 #include "editline/histedit.h"
 #include "asterisk/config.h"
 #include "asterisk/version.h"
index 83cdef3..457c2bd 100644 (file)
@@ -66,7 +66,6 @@ static int syslog_level_map[] = {
 #include "asterisk/manager.h"
 #include "asterisk/threadstorage.h"
 #include "asterisk/strings.h"
-#include "asterisk/channel.h"
 #include "asterisk/pbx.h"
 
 #if defined(__linux__) && !defined(__NR_gettid)
index a6d9c73..285d671 100644 (file)
@@ -34,7 +34,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include <signal.h>
 #include <errno.h>
 #include <netinet/in.h>
-#include <sys/time.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #include <fcntl.h>
@@ -45,7 +44,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/options.h"
 #include "asterisk/channel.h"
 #include "asterisk/acl.h"
-#include "asterisk/channel.h"
 #include "asterisk/config.h"
 #include "asterisk/lock.h"
 #include "asterisk/utils.h"
@@ -53,7 +51,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/cli.h"
 #include "asterisk/manager.h"
 #include "asterisk/unaligned.h"
-#include "asterisk/utils.h"
 
 #define MAX_TIMESTAMP_SKEW     640
 
index 4b67dc2..9ac5aff 100644 (file)
@@ -54,7 +54,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include <signal.h>
 #include <errno.h>
 #include <netinet/in.h>
-#include <sys/time.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #include <fcntl.h>
@@ -65,14 +64,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/options.h"
 #include "asterisk/channel.h"
 #include "asterisk/acl.h"
-#include "asterisk/channel.h"
 #include "asterisk/config.h"
 #include "asterisk/lock.h"
 #include "asterisk/utils.h"
 #include "asterisk/netsock.h"
 #include "asterisk/cli.h"
 #include "asterisk/unaligned.h"
-#include "asterisk/utils.h"
 
 #define UDPTL_MTU              1200
 
index 0d57cf7..bab1bfc 100644 (file)
@@ -34,7 +34,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/utils.h"
 #include "asterisk/dundi.h"
 #include "dundi-parser.h"
-#include "asterisk/dundi.h"
 
 static void internaloutput(const char *str)
 {
index 6f46921..f2c3be3 100644 (file)
@@ -40,7 +40,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #endif
 #include <netinet/ip.h>
 #include <sys/ioctl.h>
-#include <netinet/in.h>
 #include <net/if.h>
 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__Darwin__)
 #include <net/if_dl.h>
@@ -58,7 +57,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/pbx.h"
 #include "asterisk/module.h"
 #include "asterisk/frame.h"
-#include "asterisk/file.h"
 #include "asterisk/cli.h"
 #include "asterisk/lock.h"
 #include "asterisk/md5.h"
index 47ac2f8..404b456 100644 (file)
@@ -36,7 +36,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/pbx.h"
 #include "asterisk/module.h"
 #include "asterisk/frame.h"
-#include "asterisk/file.h"
 #include "asterisk/cli.h"
 #include "asterisk/lock.h"
 #include "asterisk/md5.h"
index 4ef9ea2..12bd08b 100644 (file)
@@ -39,7 +39,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/frame.h"
 #include "asterisk/term.h"
 #include "asterisk/manager.h"
-#include "asterisk/file.h"
 #include "asterisk/cli.h"
 #include "asterisk/lock.h"
 #include "asterisk/md5.h"
index 6a1cc60..5eabbd1 100644 (file)
@@ -45,7 +45,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/logger.h"
 #include "asterisk/fskmodem.h"
 #include "asterisk/channel.h"
-#include "asterisk/adsi.h"
 #include "asterisk/module.h"
 #include "asterisk/config.h"
 #include "asterisk/file.h"
index de84cbe..36ad040 100644 (file)
@@ -48,7 +48,6 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #include "asterisk/astdb.h"
 #include "asterisk/callerid.h"
 #include "asterisk/cli.h"
-#include "asterisk/logger.h"
 #include "asterisk/options.h"
 #include "asterisk/image.h"
 #include "asterisk/say.h"
index 4a73cf4..51c75e1 100644 (file)
@@ -2089,11 +2089,12 @@ static void *do_parking_thread(void *ignore)
                                if (pu->peername[0]) {
                                        char *peername = ast_strdupa(pu->peername);
                                        char *cp = strrchr(peername, '-');
+                                       char peername_flat[AST_MAX_EXTENSION]; /* using something like Zap/52 for an extension name is NOT a good idea */
+                                       int i;
+
                                        if (cp) 
                                                *cp = 0;
-                                       char peername_flat[AST_MAX_EXTENSION]; /* using something like Zap/52 for an extension name is NOT a good idea */
                                        ast_copy_string(peername_flat,peername,sizeof(peername_flat));
-                                       int i;
                                        for(i=0; peername_flat[i] && i < AST_MAX_EXTENSION; i++) {
                                                if (peername_flat[i] == '/') 
                                                        peername_flat[i]= '0';