Misc formatting cleanups
authorJames Golovich <james@gnuinter.net>
Tue, 22 Jun 2004 20:11:15 +0000 (20:11 +0000)
committerJames Golovich <james@gnuinter.net>
Tue, 22 Jun 2004 20:11:15 +0000 (20:11 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3279 65c4cc65-6c06-0410-ace0-fbb531ad65f3

acl.c
cdr.c
channel.c
config.c
dns.c
frame.c
indications.c
srv.c
translate.c
utils.c

diff --git a/acl.c b/acl.c
index 3f0afb9..ae2e938 100755 (executable)
--- a/acl.c
+++ b/acl.c
@@ -67,13 +67,11 @@ void ast_free_ha(struct ast_ha *ha)
 
 /* Copy HA structure */
 static void ast_copy_ha(struct ast_ha *from, struct ast_ha *to)
- {
-
-        memcpy(&to->netaddr, &from->netaddr, sizeof(from->netaddr));
-       memcpy(&to->netmask, &from->netmask, sizeof(from->netmask));
-        to->sense = from->sense;
-
- }
+{
+       memcpy(&to->netaddr, &from->netaddr, sizeof(from->netaddr));
+       memcpy(&to->netmask, &from->netmask, sizeof(from->netmask));
+       to->sense = from->sense;
+}
 
 /* Create duplicate of ha structure */
 static struct ast_ha *ast_duplicate_ha(struct ast_ha *original)
@@ -103,13 +101,12 @@ struct ast_ha *ast_duplicate_ha_list(struct ast_ha *original)
                if (!ret) 
                        ret = link;             /* Save starting point */
 
-               start = start->next;            /* Go to next object */
-               prev = link;                    /* Save pointer to this object */
-       }
-       return (ret);                           /* Return start of list */
+               start = start->next;            /* Go to next object */
+               prev = link;                    /* Save pointer to this object */
+       }
+       return (ret);                           /* Return start of list */
 }
 
-
 struct ast_ha *ast_append_ha(char *sense, char *stuff, struct ast_ha *path)
 {
        struct ast_ha *ha = malloc(sizeof(struct ast_ha));
diff --git a/cdr.c b/cdr.c
index 0c6796d..fb948f7 100755 (executable)
--- a/cdr.c
+++ b/cdr.c
@@ -503,11 +503,10 @@ void ast_cdr_reset(struct ast_cdr *cdr, int post)
 }
 
 void ast_cdr_append(struct ast_cdr *cdr, struct ast_cdr *newcdr) {
-       if(cdr) {
+       if (cdr) {
                while(cdr->next)
                        cdr = cdr->next;
                cdr->next = newcdr;
-    } else
-        ast_log(LOG_ERROR, "Can't append a CDR to NULL!\n");
-
+       } else
+               ast_log(LOG_ERROR, "Can't append a CDR to NULL!\n");
 }
index 638ecfe..89ebcbb 100755 (executable)
--- a/channel.c
+++ b/channel.c
@@ -143,20 +143,20 @@ int ast_shutting_down(void)
 
 void ast_channel_setwhentohangup(struct ast_channel *chan, time_t offset)
 {
-time_t myt;
+       time_t  myt;
 
        time(&myt);
-        if (offset)
-         chan->whentohangup = myt + offset;
-        else
-          chan->whentohangup = 0;
+       if (offset)
+               chan->whentohangup = myt + offset;
+       else
+               chan->whentohangup = 0;
        return;
 }
 
 int ast_channel_register(char *type, char *description, int capabilities,
                struct ast_channel *(*requester)(char *type, int format, void *data))
 {
-    return ast_channel_register_ex(type, description, capabilities, requester, NULL);
+       return ast_channel_register_ex(type, description, capabilities, requester, NULL);
 }
 
 int ast_channel_register_ex(char *type, char *description, int capabilities,
@@ -169,7 +169,7 @@ int ast_channel_register_ex(char *type, char *description, int capabilities,
                return -1;
        }
        chan = backends;
-       while(chan) {
+       while (chan) {
                if (!strcasecmp(type, chan->type)) {
                        ast_log(LOG_WARNING, "Already have a handler for type '%s'\n", type);
                        ast_mutex_unlock(&chlock);
@@ -711,9 +711,9 @@ int ast_hangup(struct ast_channel *chan)
        ast_mutex_unlock(&chan->lock);
        manager_event(EVENT_FLAG_CALL, "Hangup", 
                        "Channel: %s\r\n"
-                        "Uniqueid: %s\r\n"
-                        "Cause: %i\r\n",
-                        chan->name, chan->uniqueid, chan->hangupcause);
+                       "Uniqueid: %s\r\n"
+                       "Cause: %i\r\n",
+                       chan->name, chan->uniqueid, chan->hangupcause);
        ast_channel_free(chan);
        return res;
 }
index 4e3355b..11c930b 100755 (executable)
--- a/config.c
+++ b/config.c
@@ -441,12 +441,11 @@ static int cfg_process(struct ast_config *tmp, struct ast_category **_tmpc, stru
        char *cur;
        char *arg=NULL;
        struct ast_config_reg *reg=NULL;
-    struct ast_config *(*load_func)(char *, struct ast_config *,struct ast_category **,struct ast_variable **,int
+       struct ast_config *(*load_func)(char *, struct ast_config *,struct ast_category **,struct ast_variable **,int
 #ifdef PRESERVE_COMMENTS
 ,struct ast_comment_struct *
 #endif
-);
-       
+       );
        struct ast_variable *v;
 #ifdef PRESERVE_COMMENTS
        struct ast_comment *com = NULL;
diff --git a/dns.c b/dns.c
index dbd918d..349bd2e 100755 (executable)
--- a/dns.c
+++ b/dns.c
@@ -99,7 +99,7 @@ static int dns_parse_answer(void *context,
        int res;
        int x;
 
-    h = (dns_HEADER *)answer;
+       h = (dns_HEADER *)answer;
        answer += sizeof(dns_HEADER);
        len -= sizeof(dns_HEADER);
 
diff --git a/frame.c b/frame.c
index 7ee6c77..c93d2ab 100755 (executable)
--- a/frame.c
+++ b/frame.c
@@ -502,7 +502,7 @@ char *ast_codec2str(int codec) {
                "undefined",                  /* 13 */
                "undefined",                  /* 14 */
                "Maximum audio format",       /* 15 */
-        /* Image formats */
+               /* Image formats */
                "JPEG image",                 /* 16 */
                "PNG image",                  /* 17 */
                "H.261 Video",                /* 18 */
@@ -511,7 +511,7 @@ char *ast_codec2str(int codec) {
                "undefined",                  /* 21 */
                "undefined",                  /* 22 */
                "undefined",                  /* 23 */
-        "Maximum video format",       /* 24 */
+               "Maximum video format",       /* 24 */
                };
        if ((codec >= 0) && (codec <= 24))
                return codecs[codec];
index b4ba6d3..a626d17 100755 (executable)
@@ -167,7 +167,7 @@ int ast_playtones_start(struct ast_channel *chan, int vol, const char *playlst,
        else
                separator = ",";
        s = strsep(&stringp,separator);
-        while(s && *s) {
+       while (s && *s) {
                int freq1, freq2, time, modulate=0;
 
                if (s[0]=='!')
diff --git a/srv.c b/srv.c
index 98df484..3d70307 100755 (executable)
--- a/srv.c
+++ b/srv.c
@@ -88,7 +88,7 @@ static int srv_callback(void *context, u_char *answer, int len, u_char *fullansw
        if (!ast_strlen_zero(c->host))
                return 1;
 
-    return 0;
+       return 0;
 }
 
 int ast_get_srv(struct ast_channel *chan, char *host, int hostlen, int *port, const char *service)
@@ -110,7 +110,7 @@ int ast_get_srv(struct ast_channel *chan, char *host, int hostlen, int *port, co
 
        if (ret <= 0) {
                strcpy(host, "");
-               *port = -1;
+               *port = -1;
                return ret;
        }
        return ret;
index 0e6d19b..2ddcba0 100755 (executable)
@@ -326,26 +326,25 @@ static void rebuild_matrix(int samples)
 static int show_translation(int fd, int argc, char *argv[])
 {
 #define SHOW_TRANS 11
-        int x,y,z;
+       int x, y, z;
        char line[80];
        if (argc > 4) 
                return RESULT_SHOWUSAGE;
 
-       if(argv[2] && !strcasecmp(argv[2],"recalc")) {
-         z = argv[3] ? atoi(argv[3]) : 1;
+       if (argv[2] && !strcasecmp(argv[2],"recalc")) {
+               z = argv[3] ? atoi(argv[3]) : 1;
 
-         if(z <= 0) {
-           ast_cli(fd,"         C'mon let's be serious here... defaulting to 1.\n");
-           z = 1;
-         }
-         
-         if(z > MAX_RECALC) {
-           ast_cli(fd,"         Maximum limit of recalc exceeded by %d, truncating value to %d\n",z-MAX_RECALC,MAX_RECALC);
-           z = MAX_RECALC;
-         }
-         ast_cli(fd,"         Recalculating Codec Translation (number of sample seconds: %d)\n\n",z);
-         rebuild_matrix(z);
+               if (z <= 0) {
+                       ast_cli(fd,"         C'mon let's be serious here... defaulting to 1.\n");
+                       z = 1;
+               }
 
+               if (z > MAX_RECALC) {
+                       ast_cli(fd,"         Maximum limit of recalc exceeded by %d, truncating value to %d\n",z-MAX_RECALC,MAX_RECALC);
+                       z = MAX_RECALC;
+               }
+               ast_cli(fd,"         Recalculating Codec Translation (number of sample seconds: %d)\n\n",z);
+               rebuild_matrix(z);
        }
 
        ast_cli(fd, "         Translation times between formats (in milliseconds)\n");
diff --git a/utils.c b/utils.c
index f2a9b5b..839b6f5 100755 (executable)
--- a/utils.c
+++ b/utils.c
@@ -24,8 +24,8 @@
 AST_MUTEX_DEFINE_STATIC(__mutex);
 
 static int gethostbyname_r (const char *name, struct hostent *ret, char *buf,
-                            size_t buflen, struct hostent **result, 
-                            int *h_errnop) 
+                               size_t buflen, struct hostent **result, 
+                               int *h_errnop) 
 {
        int hsave;
        struct hostent *ph;