Cosmetic changes. Make main source files better conform to coding guidelines and standards. (issue #8679 reported by johann8384)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51486 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Joshua Colp 19 years ago
parent dcdc6c0bc6
commit 21b53af31d

@ -399,7 +399,7 @@ static void jb_get_and_deliver(struct ast_channel *chan)
res = jbimpl->get(jbobj, &f, now, interpolation_len);
switch(res) {
switch (res) {
case JB_IMPL_OK:
/* deliver the frame */
ast_write(chan, f);

@ -42,23 +42,19 @@ static inline unsigned char linear2alaw (short int linear)
};
pcm_val = linear;
if (pcm_val >= 0)
{
/* Sign (7th) bit = 1 */
mask = AMI_MASK | 0x80;
}
else
{
/* Sign bit = 0 */
mask = AMI_MASK;
pcm_val = -pcm_val;
if (pcm_val >= 0) {
/* Sign (7th) bit = 1 */
mask = AMI_MASK | 0x80;
} else {
/* Sign bit = 0 */
mask = AMI_MASK;
pcm_val = -pcm_val;
}
/* Convert the scaled magnitude to segment number. */
for (seg = 0; seg < 8; seg++)
{
if (pcm_val <= seg_end[seg])
break;
for (seg = 0; seg < 8; seg++) {
if (pcm_val <= seg_end[seg])
break;
}
/* Combine the sign, segment, and quantization bits. */
return ((seg << 4) | ((pcm_val >> ((seg) ? (seg + 3) : 4)) & 0x0F)) ^ mask;
@ -74,7 +70,7 @@ static inline short int alaw2linear (unsigned char alaw)
i = ((alaw & 0x0F) << 4);
seg = (((int) alaw & 0x70) >> 4);
if (seg)
i = (i + 0x100) << (seg - 1);
i = (i + 0x100) << (seg - 1);
return (short int) ((alaw & 0x80) ? i : -i);
}
@ -87,15 +83,13 @@ void ast_alaw_init(void)
/*
* Set up mu-law conversion table
*/
for(i = 0;i < 256;i++)
{
for (i = 0; i < 256; i++) {
__ast_alaw[i] = alaw2linear(i);
}
/* set up the reverse (mu-law) conversion table */
for(i = -32768; i < 32768; i++)
{
}
/* set up the reverse (mu-law) conversion table */
for (i = -32768; i < 32768; i++) {
__ast_lin2a[((unsigned short)i) >> 3] = linear2alaw(i);
}
}
}

@ -1099,7 +1099,7 @@ static int ivr_dispatch(struct ast_channel *chan, struct ast_ivr_option *option,
char *c;
char *n;
switch(option->action) {
switch (option->action) {
case AST_ACTION_UPONE:
return RES_UPONE;
case AST_ACTION_EXIT:
@ -1210,8 +1210,8 @@ static int ast_ivr_menu_run_internal(struct ast_channel *chan, struct ast_ivr_me
return -1;
}
}
while(!res) {
while(menu->options[pos].option) {
while (!res) {
while (menu->options[pos].option) {
if (!strcasecmp(menu->options[pos].option, exten)) {
res = ivr_dispatch(chan, menu->options + pos, exten, cbdata);
if (option_debug)

@ -670,7 +670,7 @@ int ast_safe_system(const char *s)
execl("/bin/sh", "/bin/sh", "-c", s, (char *) NULL);
_exit(1);
} else if (pid > 0) {
for(;;) {
for (;;) {
res = wait4(pid, &status, 0, &rusage);
if (res > -1) {
res = WIFEXITED(status) ? WEXITSTATUS(status) : -1;
@ -778,7 +778,7 @@ static void *netconsole(void *vconsole)
ast_copy_string(hostname, "<Unknown>", sizeof(hostname));
snprintf(tmp, sizeof(tmp), "%s/%ld/%s\n", hostname, (long)ast_mainpid, ASTERISK_VERSION);
fdprint(con->fd, tmp);
for(;;) {
for (;;) {
fds[0].fd = con->fd;
fds[0].events = POLLIN;
fds[0].revents = 0;

@ -64,7 +64,7 @@ static pthread_t asthread = AST_PTHREADT_NULL;
static void *autoservice_run(void *ign)
{
for(;;) {
for (;;) {
struct ast_channel *mons[MAX_AUTOMONS];
struct ast_channel *chan;
struct asent *as;
@ -148,7 +148,7 @@ int ast_autoservice_stop(struct ast_channel *chan)
AST_LIST_UNLOCK(&aslist);
/* Wait for it to un-block */
while(ast_test_flag(chan, AST_FLAG_BLOCKING))
while (ast_test_flag(chan, AST_FLAG_BLOCKING))
usleep(1000);
return res;
}

@ -335,7 +335,7 @@ int callerid_feed_jp(struct callerid_state *cid, unsigned char *ubuf, int len, i
cid->skipflag = 0 ;
/* caller id retrieval */
switch(cid->sawflag) {
switch (cid->sawflag) {
case 0: /* DLE */
if (b == 0x10) {
cid->sawflag = 1;
@ -552,7 +552,7 @@ int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, int
/* Ignore invalid bytes */
if (b > 0xff)
continue;
switch(cid->sawflag) {
switch (cid->sawflag) {
case 0: /* Look for flag */
if (b == 'U')
cid->sawflag = 2;
@ -599,7 +599,7 @@ int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, int
/* MDMF */
/* Go through each element and process */
for (x = 0; x < cid->pos;) {
switch(cid->rawdata[x++]) {
switch (cid->rawdata[x++]) {
case 1:
/* Date */
break;
@ -793,24 +793,24 @@ int vmwi_generate(unsigned char *buf, int active, int mdmf, int codec)
}
}
sum = 0;
for (x=0; x<len; x++)
for (x = 0; x < len; x++)
sum += msg[x];
sum = (256 - (sum & 255));
msg[len++] = sum;
/* Wait a half a second */
for (x=0; x<4000; x++)
for (x = 0; x < 4000; x++)
PUT_BYTE(0x7f);
/* Transmit 30 0x55's (looks like a square wave) for channel seizure */
for (x=0; x<30; x++)
for (x = 0; x < 30; x++)
PUT_CLID(0x55);
/* Send 170ms of callerid marks */
for (x=0; x<170; x++)
for (x = 0; x < 170; x++)
PUT_CLID_MARKMS;
for (x=0; x<len; x++) {
for (x = 0; x < len; x++) {
PUT_CLID(msg[x]);
}
/* Send 50 more ms of marks */
for (x=0; x<50; x++)
for (x = 0; x < 50; x++)
PUT_CLID_MARKMS;
return bytes;
}
@ -829,14 +829,14 @@ int callerid_generate(unsigned char *buf, const char *number, const char *name,
len = callerid_genmsg(msg, sizeof(msg), number, name, flags);
if (!callwaiting) {
/* Wait a half a second */
for (x=0; x<4000; x++)
for (x = 0; x < 4000; x++)
PUT_BYTE(0x7f);
/* Transmit 30 0x55's (looks like a square wave) for channel seizure */
for (x=0; x<30; x++)
for (x = 0; x < 30; x++)
PUT_CLID(0x55);
}
/* Send 150ms of callerid marks */
for (x=0; x<150; x++)
for (x = 0; x < 150; x++)
PUT_CLID_MARKMS;
/* Send 0x80 indicating MDMF format */
PUT_CLID(0x80);
@ -844,7 +844,7 @@ int callerid_generate(unsigned char *buf, const char *number, const char *name,
PUT_CLID(len);
sum = 0x80 + strlen(msg);
/* Put each character of message and update checksum */
for (x=0; x<len; x++) {
for (x = 0; x < len; x++) {
PUT_CLID(msg[x]);
sum += msg[x];
}
@ -852,7 +852,7 @@ int callerid_generate(unsigned char *buf, const char *number, const char *name,
PUT_CLID(256 - (sum & 255));
/* Send 50 more ms of marks */
for (x=0; x<50; x++)
for (x = 0; x < 50; x++)
PUT_CLID_MARKMS;
return bytes;
@ -867,8 +867,8 @@ void ast_shrink_phone_number(char *n)
int x, y=0;
int bracketed = 0;
for (x=0; n[x]; x++) {
switch(n[x]) {
for (x = 0; n[x]; x++) {
switch (n[x]) {
case '[':
bracketed++;
n[y++] = n[x];
@ -904,7 +904,7 @@ static int ast_is_valid_string(const char *exten, const char *valid)
if (ast_strlen_zero(exten))
return 0;
for (x=0; exten[x]; x++)
for (x = 0; exten[x]; x++)
if (!strchr(valid, exten[x]))
return 0;
return 1;

@ -288,7 +288,7 @@ int ast_cdr_setvar(struct ast_cdr *cdr, const char *name, const char *value, int
struct varshead *headp;
int x;
for(x = 0; cdr_readonly_vars[x]; x++) {
for (x = 0; cdr_readonly_vars[x]; x++) {
if (!strcasecmp(name, cdr_readonly_vars[x])) {
ast_log(LOG_ERROR, "Attempt to set the '%s' read-only variable!.\n", name);
return -1;
@ -493,7 +493,7 @@ int ast_cdr_disposition(struct ast_cdr *cdr, int cause)
int res = 0;
for (; cdr; cdr = cdr->next) {
switch(cause) {
switch (cause) {
case AST_CAUSE_BUSY:
ast_cdr_busy(cdr);
break;
@ -624,7 +624,7 @@ char *ast_cdr_disp2str(int disposition)
/*! Converts AMA flag to printable string */
char *ast_cdr_flags2str(int flag)
{
switch(flag) {
switch (flag) {
case AST_CDR_OMIT:
return "OMIT";
case AST_CDR_BILLING:
@ -945,7 +945,7 @@ static void *do_cdr(void *data)
int schedms;
int numevents = 0;
for(;;) {
for (;;) {
struct timeval now;
schedms = ast_sched_wait(sched);
/* this shouldn't happen, but provide a 1 second default just in case */

@ -505,7 +505,7 @@ const char *ast_state2str(enum ast_channel_state state)
{
char *buf;
switch(state) {
switch (state) {
case AST_STATE_DOWN:
return "Down";
case AST_STATE_RESERVED:
@ -537,7 +537,7 @@ const char *ast_state2str(enum ast_channel_state state)
/*! \brief Gives the string form of a given transfer capability */
char *ast_transfercapability2str(int transfercapability)
{
switch(transfercapability) {
switch (transfercapability) {
case AST_TRANS_CAP_SPEECH:
return "SPEECH";
case AST_TRANS_CAP_DIGITAL:
@ -1627,7 +1627,7 @@ int __ast_answer(struct ast_channel *chan, unsigned int delay)
return -1;
}
switch(chan->_state) {
switch (chan->_state) {
case AST_STATE_RINGING:
case AST_STATE_RING:
if (chan->tech->answer)
@ -1941,13 +1941,13 @@ int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int cmdfd)
if (!f)
return -1;
switch(f->frametype) {
switch (f->frametype) {
case AST_FRAME_DTMF:
res = f->subclass;
ast_frfree(f);
return res;
case AST_FRAME_CONTROL:
switch(f->subclass) {
switch (f->subclass) {
case AST_CONTROL_HANGUP:
ast_frfree(f);
return -1;
@ -2545,7 +2545,7 @@ int ast_write(struct ast_channel *chan, struct ast_frame *fr)
if (chan->fout & DEBUGCHAN_FLAG)
ast_frame_dump(chan->name, fr, ">>");
CHECK_BLOCKING(chan);
switch(fr->frametype) {
switch (fr->frametype) {
case AST_FRAME_CONTROL:
res = (chan->tech->indicate == NULL) ? 0 :
chan->tech->indicate(chan, fr->subclass, fr->data, fr->datalen);

@ -164,7 +164,7 @@ static char *handle_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args
for (x = e->args; x < a->argc; x++) {
int res = ast_module_reload(a->argv[x]);
/* XXX reload has multiple error returns, including -1 on error and 2 on success */
switch(res) {
switch (res) {
case 0:
ast_cli(a->fd, "No such module '%s'\n", a->argv[x]);
break;
@ -778,7 +778,7 @@ static int handle_showchan(int fd, int argc, char *argv[])
ast_cli(fd, "%s is not a known channel\n", argv[3]);
return RESULT_SUCCESS;
}
if(c->cdr) {
if (c->cdr) {
elapsed_seconds = now.tv_sec - c->cdr->start.tv_sec;
hour = elapsed_seconds / 3600;
min = (elapsed_seconds % 3600) / 60;
@ -835,9 +835,9 @@ static int handle_showchan(int fd, int argc, char *argv[])
( c-> data ? S_OR(c->data, "(Empty)") : "(None)"),
(ast_test_flag(c, AST_FLAG_BLOCKING) ? c->blockproc : "(Not Blocking)"));
if(pbx_builtin_serialize_variables(c, &out))
if (pbx_builtin_serialize_variables(c, &out))
ast_cli(fd," Variables:\n%s\n", out->str);
if(c->cdr && ast_cdr_serialize_variables(c->cdr, &out, '=', '\n', 1))
if (c->cdr && ast_cdr_serialize_variables(c->cdr, &out, '=', '\n', 1))
ast_cli(fd," CDR Variables:\n%s\n", out->str);
ast_channel_unlock(c);
@ -1175,7 +1175,7 @@ static struct ast_cli_entry *find_cli(char *const cmds[], int match_type)
struct ast_cli_entry *cand = NULL, *e=NULL;
struct cli_iterator i = { NULL, NULL};
while( (e = cli_next(&i)) ) {
while ( (e = cli_next(&i)) ) {
/* word-by word regexp comparison */
char * const *src = cmds;
char * const *dst = e->cmda;

@ -218,7 +218,7 @@ void ast_variables_destroy(struct ast_variable *v)
{
struct ast_variable *vn;
while(v) {
while (v) {
vn = v;
v = v->next;
free(vn);
@ -529,7 +529,7 @@ int ast_category_delete(struct ast_config *cfg, const char *category)
{
struct ast_category *prev=NULL, *cat;
cat = cfg->root;
while(cat) {
while (cat) {
if (cat->name == category) {
ast_variables_destroy(cat->root);
if (prev) {
@ -550,7 +550,7 @@ int ast_category_delete(struct ast_config *cfg, const char *category)
prev = NULL;
cat = cfg->root;
while(cat) {
while (cat) {
if (!strcasecmp(cat->name, category)) {
ast_variables_destroy(cat->root);
if (prev) {
@ -579,7 +579,7 @@ void ast_config_destroy(struct ast_config *cfg)
return;
cat = cfg->root;
while(cat) {
while (cat) {
ast_variables_destroy(cat->root);
catn = cat;
cat = cat->next;
@ -633,7 +633,7 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
if (withcomments && lline_buffer && lline_buffer[0] ) {
newcat->sameline = ALLOC_COMMENT(lline_buffer);
}
if( withcomments )
if ( withcomments )
CB_RESET();
/* If there are options or categories to inherit from, process them now */
@ -678,7 +678,7 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
/* A directive */
cur++;
c = cur;
while(*c && (*c > 32)) c++;
while (*c && (*c > 32)) c++;
if (*c) {
*c = '\0';
/* Find real argument */
@ -688,7 +688,7 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
} else
c = NULL;
do_include = !strcasecmp(cur, "include");
if(!do_include)
if (!do_include)
do_exec = !strcasecmp(cur, "exec");
else
do_exec = 0;
@ -699,7 +699,7 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
if (do_include || do_exec) {
if (c) {
/* Strip off leading and trailing "'s and <>'s */
while((*c == '<') || (*c == '>') || (*c == '\"')) c++;
while ((*c == '<') || (*c == '>') || (*c == '\"')) c++;
/* Get rid of leading mess */
cur = c;
while (!ast_strlen_zero(cur)) {
@ -720,9 +720,9 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
exec_file[0] = '\0';
/* A #include */
do_include = ast_config_internal_load(cur, cfg, withcomments) ? 1 : 0;
if(!ast_strlen_zero(exec_file))
if (!ast_strlen_zero(exec_file))
unlink(exec_file);
if(!do_include)
if (!do_include)
return 0;
} else {
@ -765,7 +765,7 @@ static int process_text_line(struct ast_config *cfg, struct ast_category **cat,
if (withcomments && lline_buffer && lline_buffer[0] ) {
v->sameline = ALLOC_COMMENT(lline_buffer);
}
if( withcomments )
if ( withcomments )
CB_RESET();
} else {
@ -851,7 +851,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
ast_log(LOG_DEBUG, "Parsing %s\n", fn);
if (option_verbose > 1)
ast_verbose("Found\n");
while(!feof(f)) {
while (!feof(f)) {
lineno++;
if (fgets(buf, sizeof(buf), f)) {
if ( withcomments ) {
@ -870,7 +870,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
/* Yuck, gotta memmove */
memmove(comment_p - 1, comment_p, strlen(comment_p) + 1);
new_buf = comment_p;
} else if(comment_p[1] == COMMENT_TAG && comment_p[2] == COMMENT_TAG && (comment_p[3] != '-')) {
} else if (comment_p[1] == COMMENT_TAG && comment_p[2] == COMMENT_TAG && (comment_p[3] != '-')) {
/* Meta-Comment start detected ";--" */
if (comment < MAX_NESTED_COMMENTS) {
*comment_p = '\0';
@ -915,7 +915,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
new_buf = comment_p + 1;
}
}
if( withcomments && comment && !process_buf )
if ( withcomments && comment && !process_buf )
{
CB_ADD(buf); /* the whole line is a comment, store it */
}
@ -932,7 +932,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
}
}
fclose(f);
} while(0);
} while (0);
if (comment) {
ast_log(LOG_WARNING,"Unterminated comment detected beginning on line %d\n", nest[comment]);
}
@ -995,7 +995,7 @@ int config_text_file_save(const char *configfile, const struct ast_config *cfg,
fprintf(f, ";! Creation Date: %s", date);
fprintf(f, ";!\n");
cat = cfg->root;
while(cat) {
while (cat) {
/* Dump section with any appropriate comment */
for (cmt = cat->precomments; cmt; cmt=cmt->next)
{
@ -1005,14 +1005,14 @@ int config_text_file_save(const char *configfile, const struct ast_config *cfg,
if (!cat->precomments)
fprintf(f,"\n");
fprintf(f, "[%s]", cat->name);
for(cmt = cat->sameline; cmt; cmt=cmt->next)
for (cmt = cat->sameline; cmt; cmt=cmt->next)
{
fprintf(f,"%s", cmt->cmt);
}
if (!cat->sameline)
fprintf(f,"\n");
var = cat->root;
while(var) {
while (var) {
for (cmt = var->precomments; cmt; cmt=cmt->next)
{
if (cmt->cmt[0] != ';' || cmt->cmt[1] != '!')

@ -237,7 +237,7 @@ int ast_device_state(const char *device)
}
if (provider) {
if(option_debug > 2)
if (option_debug > 2)
ast_log(LOG_DEBUG, "Checking if I can find provider for \"%s\" - number: %s\n", provider, number);
return getproviderstate(provider, number);
}
@ -310,7 +310,7 @@ static int getproviderstate(const char *provider, const char *address)
AST_LIST_LOCK(&devstate_provs);
AST_LIST_TRAVERSE_SAFE_BEGIN(&devstate_provs, devprov, list) {
if(option_debug > 4)
if (option_debug > 4)
ast_log(LOG_DEBUG, "Checking provider %s with %s\n", devprov->label, provider);
if (!strcasecmp(devprov->label, provider)) {
@ -435,7 +435,7 @@ static void *do_devstate_changes(void *data)
struct state_change *cur;
AST_LIST_LOCK(&state_changes);
for(;;) {
for (;;) {
/* the list lock will _always_ be held at this point in the loop */
cur = AST_LIST_REMOVE_HEAD(&state_changes, list);
if (cur) {

@ -1055,7 +1055,7 @@ static int __ast_dsp_call_progress(struct ast_dsp *dsp, short *s, int len)
int pass;
int newstate = DSP_TONE_STATE_SILENCE;
int res = 0;
while(len) {
while (len) {
/* Take the lesser of the number of samples we need and what we have */
pass = len;
if (pass > dsp->gsamp_size - dsp->gsamps)
@ -1077,7 +1077,7 @@ static int __ast_dsp_call_progress(struct ast_dsp *dsp, short *s, int len)
printf("%.2e %.2e %.2e %.2e %.2e %.2e %.2e %.2e %.2e\n",
hz[HZ_350], hz[HZ_425], hz[HZ_440], hz[HZ_480], hz[HZ_620], hz[HZ_950], hz[HZ_1400], hz[HZ_1800], dsp->genergy);
#endif
switch(dsp->progmode) {
switch (dsp->progmode) {
case PROG_MODE_NA:
if (pair_there(hz[HZ_480], hz[HZ_620], hz[HZ_350], hz[HZ_440], dsp->genergy)) {
newstate = DSP_TONE_STATE_BUSY;
@ -1421,7 +1421,7 @@ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp,
#define FIX_INF(inf) do { \
if (writeback) { \
switch(inf->subclass) { \
switch (inf->subclass) { \
case AST_FORMAT_SLINEAR: \
break; \
case AST_FORMAT_ULAW: \
@ -1443,7 +1443,7 @@ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp,
odata = af->data;
len = af->datalen;
/* Make sure we have short data */
switch(af->subclass) {
switch (af->subclass) {
case AST_FORMAT_SLINEAR:
shortdata = af->data;
len = af->datalen / 2;
@ -1576,7 +1576,7 @@ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp,
if ((dsp->features & DSP_FEATURE_CALL_PROGRESS)) {
res = __ast_dsp_call_progress(dsp, shortdata, len);
if (res) {
switch(res) {
switch (res) {
case AST_CONTROL_ANSWER:
case AST_CONTROL_BUSY:
case AST_CONTROL_RINGING:

@ -445,7 +445,7 @@ int ast_get_enum(struct ast_channel *chan, const char *number, char *dst, int ds
tmp[newpos++] = '.';
}
if (*p2) {
while(*p2 && newpos < 128){
while (*p2 && newpos < 128){
tmp[newpos++] = *p2;
p2++;
}
@ -634,7 +634,7 @@ int ast_enum_init(void)
/* Destroy existing list */
ast_mutex_lock(&enumlock);
s = toplevs;
while(s) {
while (s) {
sl = s;
s = s->next;
free(sl);
@ -644,7 +644,7 @@ int ast_enum_init(void)
if (cfg) {
sl = NULL;
v = ast_variable_browse(cfg, "general");
while(v) {
while (v) {
if (!strcasecmp(v->name, "search")) {
s = enum_newtoplev(v->value);
if (s) {

@ -610,7 +610,7 @@ static int ast_readaudio_callback(void *data)
struct ast_filestream *s = data;
int whennext = 0;
while(!whennext) {
while (!whennext) {
struct ast_frame *fr = s->fmt->read(s, &whennext);
if (!fr /* stream complete */ || ast_write(s->owner, fr) /* error writing */) {
if (fr)
@ -1031,7 +1031,7 @@ static int waitstream_core(struct ast_channel *c, const char *breakon,
struct ast_frame *fr = ast_read(c);
if (!fr)
return -1;
switch(fr->frametype) {
switch (fr->frametype) {
case AST_FRAME_DTMF_END:
if (context) {
const char exten[2] = { fr->subclass, '\0' };
@ -1052,7 +1052,7 @@ static int waitstream_core(struct ast_channel *c, const char *breakon,
}
break;
case AST_FRAME_CONTROL:
switch(fr->subclass) {
switch (fr->subclass) {
case AST_CONTROL_HANGUP:
case AST_CONTROL_BUSY:
case AST_CONTROL_CONGESTION:

@ -534,7 +534,7 @@ char* ast_getformatname(int format)
int x;
char *ret = "unknown";
for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
if(AST_FORMAT_LIST[x].visible && AST_FORMAT_LIST[x].bits == format) {
if (AST_FORMAT_LIST[x].visible && AST_FORMAT_LIST[x].bits == format) {
ret = AST_FORMAT_LIST[x].name;
break;
}
@ -583,7 +583,7 @@ static const char *ast_expand_codec_alias(const char *in)
int x;
for (x = 0; x < sizeof(ast_codec_alias_table) / sizeof(ast_codec_alias_table[0]); x++) {
if(!strcmp(in,ast_codec_alias_table[x].alias))
if (!strcmp(in,ast_codec_alias_table[x].alias))
return ast_codec_alias_table[x].realname;
}
return in;
@ -595,11 +595,11 @@ int ast_getformatbyname(const char *name)
all = strcasecmp(name, "all") ? 0 : 1;
for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
if(AST_FORMAT_LIST[x].visible && (all ||
if (AST_FORMAT_LIST[x].visible && (all ||
!strcasecmp(AST_FORMAT_LIST[x].name,name) ||
!strcasecmp(AST_FORMAT_LIST[x].name,ast_expand_codec_alias(name)))) {
format |= AST_FORMAT_LIST[x].bits;
if(!all)
if (!all)
break;
}
}
@ -612,7 +612,7 @@ char *ast_codec2str(int codec)
int x;
char *ret = "unknown";
for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
if(AST_FORMAT_LIST[x].visible && AST_FORMAT_LIST[x].bits == codec) {
if (AST_FORMAT_LIST[x].visible && AST_FORMAT_LIST[x].bits == codec) {
ret = AST_FORMAT_LIST[x].desc;
break;
}
@ -938,7 +938,7 @@ void ast_codec_pref_convert(struct ast_codec_pref *pref, char *buf, size_t size,
int x, differential = (int) 'A', mem;
char *from, *to;
if(right) {
if (right) {
from = pref->order;
to = buf;
mem = size;
@ -950,7 +950,7 @@ void ast_codec_pref_convert(struct ast_codec_pref *pref, char *buf, size_t size,
memset(to, 0, mem);
for (x = 0; x < 32 ; x++) {
if(!from[x])
if (!from[x])
break;
to[x] = right ? (from[x] + differential) : (from[x] - differential);
}
@ -967,23 +967,23 @@ int ast_codec_pref_string(struct ast_codec_pref *pref, char *buf, size_t size)
buf[0] = '(';
total_len--;
for(x = 0; x < 32 ; x++) {
if(total_len <= 0)
if (total_len <= 0)
break;
if(!(codec = ast_codec_pref_index(pref,x)))
if (!(codec = ast_codec_pref_index(pref,x)))
break;
if((formatname = ast_getformatname(codec))) {
if ((formatname = ast_getformatname(codec))) {
slen = strlen(formatname);
if(slen > total_len)
if (slen > total_len)
break;
strncat(buf,formatname,total_len);
total_len -= slen;
}
if(total_len && x < 31 && ast_codec_pref_index(pref , x + 1)) {
if (total_len && x < 31 && ast_codec_pref_index(pref , x + 1)) {
strncat(buf,"|",total_len);
total_len--;
}
}
if(total_len) {
if (total_len) {
strncat(buf,")",total_len);
total_len--;
}
@ -996,7 +996,7 @@ int ast_codec_pref_index(struct ast_codec_pref *pref, int index)
int slot = 0;
if((index >= 0) && (index < sizeof(pref->order))) {
if ((index >= 0) && (index < sizeof(pref->order))) {
slot = pref->order[index];
}
@ -1011,7 +1011,7 @@ void ast_codec_pref_remove(struct ast_codec_pref *pref, int format)
int slot;
int size;
if(!pref->order[0])
if (!pref->order[0])
return;
memcpy(&oldorder, pref, sizeof(oldorder));
@ -1020,9 +1020,9 @@ void ast_codec_pref_remove(struct ast_codec_pref *pref, int format)
for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
slot = oldorder.order[x];
size = oldorder.framing[x];
if(! slot)
if (! slot)
break;
if(AST_FORMAT_LIST[slot-1].bits != format) {
if (AST_FORMAT_LIST[slot-1].bits != format) {
pref->order[y] = slot;
pref->framing[y++] = size;
}
@ -1038,15 +1038,15 @@ int ast_codec_pref_append(struct ast_codec_pref *pref, int format)
ast_codec_pref_remove(pref, format);
for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
if(AST_FORMAT_LIST[x].bits == format) {
if (AST_FORMAT_LIST[x].bits == format) {
newindex = x + 1;
break;
}
}
if(newindex) {
if (newindex) {
for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
if(!pref->order[x]) {
if (!pref->order[x]) {
pref->order[x] = newindex;
break;
}
@ -1063,31 +1063,31 @@ int ast_codec_pref_setsize(struct ast_codec_pref *pref, int format, int framems)
int x, index = -1;
for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
if(AST_FORMAT_LIST[x].bits == format) {
if (AST_FORMAT_LIST[x].bits == format) {
index = x;
break;
}
}
if(index < 0)
if (index < 0)
return -1;
/* size validation */
if(!framems)
if (!framems)
framems = AST_FORMAT_LIST[index].def_ms;
if(AST_FORMAT_LIST[index].inc_ms && framems % AST_FORMAT_LIST[index].inc_ms) /* avoid division by zero */
if (AST_FORMAT_LIST[index].inc_ms && framems % AST_FORMAT_LIST[index].inc_ms) /* avoid division by zero */
framems -= framems % AST_FORMAT_LIST[index].inc_ms;
if(framems < AST_FORMAT_LIST[index].min_ms)
if (framems < AST_FORMAT_LIST[index].min_ms)
framems = AST_FORMAT_LIST[index].min_ms;
if(framems > AST_FORMAT_LIST[index].max_ms)
if (framems > AST_FORMAT_LIST[index].max_ms)
framems = AST_FORMAT_LIST[index].max_ms;
for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
if(pref->order[x] == (index + 1)) {
if (pref->order[x] == (index + 1)) {
pref->framing[x] = framems;
break;
}
@ -1103,7 +1103,7 @@ struct ast_format_list ast_codec_pref_getsize(struct ast_codec_pref *pref, int f
struct ast_format_list fmt = { 0, };
for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
if(AST_FORMAT_LIST[x].bits == format) {
if (AST_FORMAT_LIST[x].bits == format) {
fmt = AST_FORMAT_LIST[x];
index = x;
break;
@ -1111,23 +1111,23 @@ struct ast_format_list ast_codec_pref_getsize(struct ast_codec_pref *pref, int f
}
for (x = 0; x < sizeof(AST_FORMAT_LIST) / sizeof(AST_FORMAT_LIST[0]); x++) {
if(pref->order[x] == (index + 1)) {
if (pref->order[x] == (index + 1)) {
framems = pref->framing[x];
break;
}
}
/* size validation */
if(!framems)
if (!framems)
framems = AST_FORMAT_LIST[index].def_ms;
if(AST_FORMAT_LIST[index].inc_ms && framems % AST_FORMAT_LIST[index].inc_ms) /* avoid division by zero */
if (AST_FORMAT_LIST[index].inc_ms && framems % AST_FORMAT_LIST[index].inc_ms) /* avoid division by zero */
framems -= framems % AST_FORMAT_LIST[index].inc_ms;
if(framems < AST_FORMAT_LIST[index].min_ms)
if (framems < AST_FORMAT_LIST[index].min_ms)
framems = AST_FORMAT_LIST[index].min_ms;
if(framems > AST_FORMAT_LIST[index].max_ms)
if (framems > AST_FORMAT_LIST[index].max_ms)
framems = AST_FORMAT_LIST[index].max_ms;
fmt.cur_ms = framems;
@ -1150,7 +1150,7 @@ int ast_codec_choose(struct ast_codec_pref *pref, int formats, int find_best)
break;
}
}
if(ret & AST_FORMAT_AUDIO_MASK)
if (ret & AST_FORMAT_AUDIO_MASK)
return ret;
if (option_debug > 3)

@ -226,7 +226,7 @@ int fsk_serial(fsk_data *fskd, short *buffer, int *len, int *outbyte)
int samples = 0;
int olen;
switch(fskd->state) {
switch (fskd->state) {
/* Pick up where we left off */
case STATE_SEARCH_STARTBIT2:
goto search_startbit2;
@ -243,7 +243,7 @@ int fsk_serial(fsk_data *fskd, short *buffer, int *len, int *outbyte)
of a transmission (what a LOSING design), we cant do it this elegantly */
/*
if (demodulator(zap,&x1)) return(-1);
for(;;) {
for (;;) {
if (demodulator(zap,&x2)) return(-1);
if (x1>0 && x2<0) break;
x1 = x2;
@ -256,7 +256,7 @@ int fsk_serial(fsk_data *fskd, short *buffer, int *len, int *outbyte)
if (demodulator(fskd, &fskd->x1, GET_SAMPLE))
return -1;
samples++;
for(;;) {
for (;;) {
search_startbit2:
if (!*len) {
fskd->state = STATE_SEARCH_STARTBIT2;
@ -278,7 +278,7 @@ search_startbit3:
fskd->state = STATE_SEARCH_STARTBIT3;
return 0;
}
for(;i;i--) {
for (; i; i--) {
if (demodulator(fskd, &fskd->x1, GET_SAMPLE))
return(-1);
#if 0

@ -128,7 +128,7 @@ struct ast_frame *ast_read_image(char *filename, const char *preflang, int forma
ast_copy_string(tmp, i->exts, sizeof(tmp));
stringp=tmp;
e = strsep(&stringp, "|");
while(e) {
while (e) {
make_filename(buf, sizeof(buf), filename, preflang, e);
if ((len = file_exists(buf))) {
found = i;

@ -269,7 +269,7 @@ int ast_io_wait(struct io_context *ioc, int howlong)
* At least one event
*/
origcnt = ioc->fdcnt;
for(x = 0; x < origcnt; x++) {
for (x = 0; x < origcnt; x++) {
/* Yes, it is possible for an entry to be deleted and still have an
event waiting if it occurs after the original calling id */
if (ioc->fds[x].revents && ioc->ior[x].id) {

@ -781,7 +781,7 @@ enum jb_return_code jb_get(jitterbuf *jb, jb_frame *frameout, long now, long int
if (thists && thists < lastts) jb_warn("XXXX timestamp roll-back!!!\n");
lastts = thists;
#endif
if(ret == JB_INTERP)
if (ret == JB_INTERP)
frameout->ms = jb->info.last_voice_ms;
return ret;

@ -214,7 +214,7 @@ static struct logchannel *make_logchannel(char *channel, char *components, int l
* syslog.facility => level,level,level
*/
facility = strchr(channel, '.');
if(!facility++ || !facility) {
if (!facility++ || !facility) {
facility = "local0";
}
@ -283,14 +283,14 @@ static struct logchannel *make_logchannel(char *channel, char *components, int l
openlog("asterisk", LOG_PID, chan->facility);
} else {
if (channel[0] == '/') {
if(!ast_strlen_zero(hostname)) {
if (!ast_strlen_zero(hostname)) {
snprintf(chan->filename, sizeof(chan->filename) - 1,"%s.%s", channel, hostname);
} else {
ast_copy_string(chan->filename, channel, sizeof(chan->filename));
}
}
if(!ast_strlen_zero(hostname)) {
if (!ast_strlen_zero(hostname)) {
snprintf(chan->filename, sizeof(chan->filename), "%s/%s.%s", ast_config_AST_LOG_DIR, channel, hostname);
} else {
snprintf(chan->filename, sizeof(chan->filename), "%s/%s", ast_config_AST_LOG_DIR, channel);
@ -523,7 +523,7 @@ int reload_logger(int rotate)
static int handle_logger_reload(int fd, int argc, char *argv[])
{
if(reload_logger(0)) {
if (reload_logger(0)) {
ast_cli(fd, "Failed to reload the logger\n");
return RESULT_FAILURE;
} else
@ -532,7 +532,7 @@ static int handle_logger_reload(int fd, int argc, char *argv[])
static int handle_logger_rotate(int fd, int argc, char *argv[])
{
if(reload_logger(1)) {
if (reload_logger(1)) {
ast_cli(fd, "Failed to reload the logger and rotate log files\n");
return RESULT_FAILURE;
} else

@ -1460,7 +1460,7 @@ static void pbx_substitute_variables_helper_full(struct ast_channel *c, struct v
nextexp = NULL;
nextthing = strchr(whereweare, '$');
if (nextthing) {
switch(nextthing[1]) {
switch (nextthing[1]) {
case '{':
nextvar = nextthing;
pos = nextvar - whereweare;
@ -1564,7 +1564,7 @@ static void pbx_substitute_variables_helper_full(struct ast_channel *c, struct v
needsub = 0;
/* Find the end of it */
while(brackets && *vare) {
while (brackets && *vare) {
if ((vare[0] == '$') && (vare[1] == '[')) {
needsub++;
brackets++;
@ -2403,7 +2403,7 @@ static int __ast_pbx_run(struct ast_channel *c)
if (c->cdr && ast_opt_end_cdr_before_h_exten)
ast_cdr_end(c->cdr);
set_ext_pri(c, "h", 1);
while(ast_exists_extension(c, c->context, c->exten, c->priority, c->cid.cid_num)) {
while (ast_exists_extension(c, c->context, c->exten, c->priority, c->cid.cid_num)) {
if ((res = ast_spawn_extension(c, c->context, c->exten, c->priority, c->cid.cid_num))) {
/* Something bad happened, or a hangup has been requested. */
if (option_debug)
@ -4539,7 +4539,7 @@ static int ext_strncpy(char *dst, const char *src, int len)
int count=0;
while (*src && (count < len - 1)) {
switch(*src) {
switch (*src) {
case ' ':
/* otherwise exten => [a-b],1,... doesn't work */
/* case '-': */
@ -4941,7 +4941,7 @@ int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout
if (option_verbose > 3)
ast_verbose(VERBOSE_PREFIX_4 "Channel %s was never answered.\n", chan->name);
if(chan->cdr) { /* update the cdr */
if (chan->cdr) { /* update the cdr */
/* here we update the status of the call, which sould be busy.
* if that fails then we set the status to failed */
if (ast_cdr_disposition(chan->cdr, chan->hangupcause))
@ -5073,7 +5073,7 @@ int ast_pbx_outgoing_app(const char *type, int format, void *data, int timeout,
ast_log(LOG_WARNING, "%s already has a call record??\n", chan->name);
} else {
chan->cdr = ast_cdr_alloc(); /* allocate a cdr for the channel */
if(!chan->cdr) {
if (!chan->cdr) {
/* allocation of the cdr failed */
free(chan->pbx);
res = -1;

@ -442,7 +442,7 @@ static int ast_say_number_full_en(struct ast_channel *chan, int num, const char
if (!num)
return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
while(!res && (num || playh)) {
while (!res && (num || playh)) {
if (num < 0) {
snprintf(fn, sizeof(fn), "digits/minus");
if ( num > INT_MIN ) {
@ -487,7 +487,7 @@ static int ast_say_number_full_en(struct ast_channel *chan, int num, const char
}
}
if (!res) {
if(!ast_streamfile(chan, fn, language)) {
if (!ast_streamfile(chan, fn, language)) {
if ((audiofd > -1) && (ctrlfd > -1))
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
else
@ -545,7 +545,7 @@ static int ast_say_number_full_cz(struct ast_channel *chan, int num, const char
if (!num)
return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
while(!res && (num || playh)) {
while (!res && (num || playh)) {
if (num < 0) {
snprintf(fn, sizeof(fn), "digits/minus");
if ( num > INT_MIN ) {
@ -609,7 +609,7 @@ static int ast_say_number_full_cz(struct ast_channel *chan, int num, const char
num -= left * (exp10_int(length-1));
}
if (!res) {
if(!ast_streamfile(chan, fn, language)) {
if (!ast_streamfile(chan, fn, language)) {
if ((audiofd > -1) && (ctrlfd > -1)) {
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
} else {
@ -638,7 +638,7 @@ static int ast_say_number_full_da(struct ast_channel *chan, int num, const char
if (options && !strncasecmp(options, "n",1)) cn = -1;
while(!res && (num || playh || playa )) {
while (!res && (num || playh || playa )) {
/* The grammar for Danish numbers is the same as for English except
* for the following:
* - 1 exists in both commune ("en", file "1N") and neuter ("et", file "1")
@ -719,7 +719,7 @@ static int ast_say_number_full_da(struct ast_channel *chan, int num, const char
}
}
if (!res) {
if(!ast_streamfile(chan, fn, language)) {
if (!ast_streamfile(chan, fn, language)) {
if ((audiofd > -1) && (ctrlfd > -1))
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
else
@ -752,7 +752,7 @@ static int ast_say_number_full_de(struct ast_channel *chan, int num, const char
if (options && (!strncasecmp(options, "f",1)))
mf = -1;
while(!res && num) {
while (!res && num) {
/* The grammar for German numbers is the same as for English except
* for the following:
* - numbers 20 through 99 are said in reverse order, i.e. 21 is
@ -850,7 +850,7 @@ static int ast_say_number_full_de(struct ast_channel *chan, int num, const char
res = -1;
}
if (!res) {
if(!ast_streamfile(chan, fn, language)) {
if (!ast_streamfile(chan, fn, language)) {
if ((audiofd > -1) && (ctrlfd > -1))
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
else
@ -885,7 +885,7 @@ static int ast_say_number_full_en_GB(struct ast_channel *chan, int num, const ch
if (!num)
return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
while(!res && (num || playh || playa )) {
while (!res && (num || playh || playa )) {
if (num < 0) {
snprintf(fn, sizeof(fn), "digits/minus");
if ( num > INT_MIN ) {
@ -937,7 +937,7 @@ static int ast_say_number_full_en_GB(struct ast_channel *chan, int num, const ch
}
if (!res) {
if(!ast_streamfile(chan, fn, language)) {
if (!ast_streamfile(chan, fn, language)) {
if ((audiofd > -1) && (ctrlfd > -1))
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
else
@ -1042,7 +1042,7 @@ static int ast_say_number_full_es(struct ast_channel *chan, int num, const char
}
if (!res) {
if(!ast_streamfile(chan, fn, language)) {
if (!ast_streamfile(chan, fn, language)) {
if ((audiofd > -1) && (ctrlfd > -1))
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
else
@ -1073,7 +1073,7 @@ static int ast_say_number_full_fr(struct ast_channel *chan, int num, const char
if (options && !strncasecmp(options, "f",1))
mf = -1;
while(!res && (num || playh || playa)) {
while (!res && (num || playh || playa)) {
if (num < 0) {
snprintf(fn, sizeof(fn), "digits/minus");
if ( num > INT_MIN ) {
@ -1135,7 +1135,7 @@ static int ast_say_number_full_fr(struct ast_channel *chan, int num, const char
res = -1;
}
if (!res) {
if(!ast_streamfile(chan, fn, language)) {
if (!ast_streamfile(chan, fn, language)) {
if ((audiofd > -1) && (ctrlfd > -1))
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
else
@ -1213,7 +1213,7 @@ static int ast_say_number_full_he(struct ast_channel *chan, int num,
mf = -1;
/* Do we have work to do? */
while(!res && (num || (state>0) )) {
while (!res && (num || (state>0) )) {
/* first type of work: play a second sound. In this loop
* we can only play one sound file at a time. Thus playing
* a second one requires repeating the loop just for the
@ -1285,7 +1285,7 @@ static int ast_say_number_full_he(struct ast_channel *chan, int num,
res = -1;
}
if (!res) {
if(!ast_streamfile(chan, fn, language)) {
if (!ast_streamfile(chan, fn, language)) {
if ((audiofd > -1) && (ctrlfd > -1))
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
else
@ -1332,7 +1332,7 @@ static int ast_say_number_full_it(struct ast_channel *chan, int num, const char
So the right file is provided.
*/
while(!res && (num || playh)) {
while (!res && (num || playh)) {
if (num < 0) {
snprintf(fn, sizeof(fn), "digits/minus");
if ( num > INT_MIN ) {
@ -1439,7 +1439,7 @@ static int ast_say_number_full_it(struct ast_channel *chan, int num, const char
}
}
if (!res) {
if(!ast_streamfile(chan, fn, language)) {
if (!ast_streamfile(chan, fn, language)) {
if ((audiofd > -1) && (ctrlfd > -1))
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
else
@ -1517,7 +1517,7 @@ static int ast_say_number_full_nl(struct ast_channel *chan, int num, const char
}
if (!res) {
if(!ast_streamfile(chan, fn, language)) {
if (!ast_streamfile(chan, fn, language)) {
if ((audiofd > -1) && (ctrlfd > -1))
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
else
@ -1546,7 +1546,7 @@ static int ast_say_number_full_no(struct ast_channel *chan, int num, const char
if (options && !strncasecmp(options, "n",1)) cn = -1;
while(!res && (num || playh || playa )) {
while (!res && (num || playh || playa )) {
/* The grammar for Norwegian numbers is the same as for English except
* for the following:
* - 1 exists in both commune ("en", file "1") and neuter ("ett", file "1N")
@ -1610,7 +1610,7 @@ static int ast_say_number_full_no(struct ast_channel *chan, int num, const char
}
if (!res) {
if(!ast_streamfile(chan, fn, language)) {
if (!ast_streamfile(chan, fn, language)) {
if ((audiofd > -1) && (ctrlfd > -1))
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
else
@ -1935,7 +1935,7 @@ static int ast_say_number_full_pt(struct ast_channel *chan, int num, const char
if (options && !strncasecmp(options, "f",1))
mf = -1;
while(!res && num ) {
while (!res && num ) {
if (num < 0) {
snprintf(fn, sizeof(fn), "digits/minus");
if ( num > INT_MIN ) {
@ -2028,7 +2028,7 @@ static int ast_say_number_full_se(struct ast_channel *chan, int num, const char
return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
if (options && !strncasecmp(options, "n",1)) cn = -1;
while(!res && (num || playh)) {
while (!res && (num || playh)) {
if (num < 0) {
snprintf(fn, sizeof(fn), "digits/minus");
if ( num > INT_MIN ) {
@ -2078,7 +2078,7 @@ static int ast_say_number_full_se(struct ast_channel *chan, int num, const char
}
}
if (!res) {
if(!ast_streamfile(chan, fn, language)) {
if (!ast_streamfile(chan, fn, language)) {
if ((audiofd > -1) && (ctrlfd > -1))
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
else
@ -2099,7 +2099,7 @@ static int ast_say_number_full_tw(struct ast_channel *chan, int num, const char
if (!num)
return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
while(!res && (num || playh)) {
while (!res && (num || playh)) {
if (num < 0) {
snprintf(fn, sizeof(fn), "digits/minus");
if ( num > INT_MIN ) {
@ -2144,7 +2144,7 @@ static int ast_say_number_full_tw(struct ast_channel *chan, int num, const char
}
}
if (!res) {
if(!ast_streamfile(chan, fn, language)) {
if (!ast_streamfile(chan, fn, language)) {
if ((audiofd > -1) && (ctrlfd > -1))
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
else
@ -2192,7 +2192,7 @@ static int ast_say_number_full_ru(struct ast_channel *chan, int num, const char
if (!num)
return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
while(!res && (num)) {
while (!res && (num)) {
if (num < 0) {
snprintf(fn, sizeof(fn), "digits/minus");
if ( num > INT_MIN ) {
@ -2201,7 +2201,7 @@ static int ast_say_number_full_ru(struct ast_channel *chan, int num, const char
num = 0;
}
} else if (num < 20) {
if(options && strlen(options) == 1 && num < 3) {
if (options && strlen(options) == 1 && num < 3) {
snprintf(fn, sizeof(fn), "digits/%d%s", num, options);
} else {
snprintf(fn, sizeof(fn), "digits/%d", num);
@ -2287,7 +2287,7 @@ static int ast_say_enumeration_full_en(struct ast_channel *chan, int num, const
int res = 0, t = 0;
char fn[256] = "";
while(!res && num) {
while (!res && num) {
if (num < 0) {
snprintf(fn, sizeof(fn), "digits/minus"); /* kind of senseless for enumerations, but our best effort for error checking */
if ( num > INT_MIN ) {
@ -2399,7 +2399,7 @@ static int ast_say_enumeration_full_da(struct ast_channel *chan, int num, const
if (!num)
return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
while(!res && num) {
while (!res && num) {
if (num < 0) {
snprintf(fn, sizeof(fn), "digits/minus"); /* kind of senseless for enumerations, but our best effort for error checking */
if ( num > INT_MIN ) {
@ -2563,7 +2563,7 @@ static int ast_say_enumeration_full_de(struct ast_channel *chan, int num, const
if (!num)
return ast_say_digits_full(chan, 0,ints, language, audiofd, ctrlfd);
while(!res && num) {
while (!res && num) {
if (num < 0) {
snprintf(fn, sizeof(fn), "digits/minus"); /* kind of senseless for enumerations, but our best effort for error checking */
if ( num > INT_MIN ) {
@ -5260,7 +5260,7 @@ int ast_say_date_with_format_tw(struct ast_channel *chan, time_t time, const cha
} else {
snprintf(nextmsg,sizeof(nextmsg), "digits/h-%dh", tm.tm_mday - (tm.tm_mday % 10));
res = wait_file(chan,ints,nextmsg,lang);
if(!res) {
if (!res) {
snprintf(nextmsg,sizeof(nextmsg), "digits/h-%d", tm.tm_mday % 10);
res = wait_file(chan,ints,nextmsg,lang);
}
@ -6207,7 +6207,7 @@ static int ast_say_number_full_gr(struct ast_channel *chan, int num, const char
return ast_waitstream(chan, ints);
}
while(!res && num ) {
while (!res && num ) {
i++;
if (num < 13) {
snprintf(fn, sizeof(fn), "digits/%d", num);
@ -6251,7 +6251,7 @@ static int ast_say_number_full_gr(struct ast_channel *chan, int num, const char
}
}
if (!res) {
if(!ast_streamfile(chan, fn, language)) {
if (!ast_streamfile(chan, fn, language)) {
if ((audiofd > -1) && (ctrlfd > -1))
res = ast_waitstream_full(chan, ints, audiofd, ctrlfd);
else

@ -192,7 +192,7 @@ struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp)
pure integer */
s = host;
res = 0;
while(s && *s) {
while (s && *s) {
if (*s == '.')
dots++;
else if (!isdigit(*s))
@ -329,7 +329,7 @@ int ast_base64decode(unsigned char *dst, const char *src, int max)
unsigned int byte = 0;
unsigned int bits = 0;
int incnt = 0;
while(*src && (cnt < max)) {
while (*src && (cnt < max)) {
/* Shift in 6 bits of input */
byte <<= 6;
byte |= (b2a[(int)(*src)]) & 0x3f;

Loading…
Cancel
Save