From 3f9c34f4152a9287419deb53bca8732ff056600e Mon Sep 17 00:00:00 2001 From: James Golovich Date: Tue, 22 Jun 2004 20:11:15 +0000 Subject: Misc formatting cleanups git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3279 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- acl.c | 21 +++++++++------------ cdr.c | 7 +++---- channel.c | 20 ++++++++++---------- config.c | 5 ++--- dns.c | 2 +- frame.c | 4 ++-- indications.c | 2 +- srv.c | 4 ++-- translate.c | 27 +++++++++++++-------------- utils.c | 4 ++-- 10 files changed, 45 insertions(+), 51 deletions(-) diff --git a/acl.c b/acl.c index 3f0afb9ab..ae2e93886 100755 --- 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 0c6796daf..fb948f7e8 100755 --- 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"); } diff --git a/channel.c b/channel.c index 638ecfeec..89ebcbb4b 100755 --- 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; } diff --git a/config.c b/config.c index 4e3355bcf..11c930b01 100755 --- 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 dbd918d6f..349bd2ebd 100755 --- 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 7ee6c77ae..c93d2abff 100755 --- 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]; diff --git a/indications.c b/indications.c index b4ba6d33c..a626d17f3 100755 --- a/indications.c +++ b/indications.c @@ -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 98df484dd..3d7030737 100755 --- 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; diff --git a/translate.c b/translate.c index 0e6d19b26..2ddcba0b0 100755 --- a/translate.c +++ b/translate.c @@ -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 f2a9b5bfd..839b6f505 100755 --- 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; -- cgit v1.2.3