From d0688264c6911597a6b73952d4fd238f0371f850 Mon Sep 17 00:00:00 2001 From: Brian West Date: Mon, 6 Oct 2008 19:21:59 +0000 Subject: [PATCH] if plus a space git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9855 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../applications/mod_commands/mod_commands.c | 2 +- .../applications/mod_voicemail/mod_voicemail.c | 2 +- src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c | 2 +- src/mod/formats/mod_shout/mod_shout.c | 1 + src/mod/loggers/mod_syslog/mod_syslog.c | 5 ++--- src/mod/xml_int/mod_xml_curl/mod_xml_curl.c | 4 ++-- src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c | 2 +- src/switch_core_port_allocator.c | 4 +++- src/switch_stun.c | 3 +-- src/switch_xml.c | 18 +++++++++--------- 10 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index 66346dfd69..7b6de973a7 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -247,7 +247,7 @@ SWITCH_STANDARD_API(eval_function) SWITCH_STANDARD_API(module_exists_function) { if (!switch_strlen_zero(cmd)) { - if(switch_loadable_module_exists(cmd) == SWITCH_STATUS_SUCCESS) { + if (switch_loadable_module_exists(cmd) == SWITCH_STATUS_SUCCESS) { stream->write_function(stream, "true"); } else { stream->write_function(stream, "false"); diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 2676ea82ed..6f497c76f5 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -2231,7 +2231,7 @@ static switch_status_t deliver_vm(vm_profile_t *profile, switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_file_path", file_path); switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_read_flags", read_flags); - if(!switch_strlen_zero(vm_timezone)) { + if (!switch_strlen_zero(vm_timezone)) { char tz_date[80] = ""; if ((switch_strftime_tz(vm_timezone, profile->date_fmt, tz_date, sizeof(tz_date)) == SWITCH_STATUS_SUCCESS) && !switch_strlen_zero_buf(tz_date)) { switch_event_add_header_string(params, SWITCH_STACK_BOTTOM, "voicemail_time", tz_date); diff --git a/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c b/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c index 6c874a51e0..7f22eacdb3 100644 --- a/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c +++ b/src/mod/asr_tts/mod_openmrcp/mod_openmrcp.c @@ -266,7 +266,7 @@ static mrcp_status_t openmrcp_recog_start(mrcp_client_context_t *context, openmr recognizer_header = mrcp_resource_header_prepare(mrcp_message); - if(!recognizer_header) { + if (!recognizer_header) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Could not prepare resource_header\n"); return MRCP_STATUS_FAILURE; } diff --git a/src/mod/formats/mod_shout/mod_shout.c b/src/mod/formats/mod_shout/mod_shout.c index 02426c7f7d..e52a8a6d6a 100644 --- a/src/mod/formats/mod_shout/mod_shout.c +++ b/src/mod/formats/mod_shout/mod_shout.c @@ -616,6 +616,7 @@ static switch_status_t shout_file_open(switch_file_handle_t *handle, const char mpg123_param(context->mh, MPG123_FLAGS, MPG123_SEEKBUFFER|MPG123_MONO_MIX, 0); context->stream_url = switch_core_sprintf(context->memory_pool, "http://%s", path); context->prebuf = handle->prebuf; + handle->vol = -4; launch_read_stream_thread(context); } else { mpg123_param(context->mh, MPG123_FLAGS, MPG123_MONO_MIX, 0); diff --git a/src/mod/loggers/mod_syslog/mod_syslog.c b/src/mod/loggers/mod_syslog/mod_syslog.c index 8ea4103a23..ba7de4c29c 100644 --- a/src/mod/loggers/mod_syslog/mod_syslog.c +++ b/src/mod/loggers/mod_syslog/mod_syslog.c @@ -99,7 +99,7 @@ static switch_status_t mod_syslog_logger(const switch_log_node_t *node, switch_l } /* don't log blank lines */ - if(!switch_strlen_zero(node->data) && (strspn(node->data, " \t\r\n") < strlen(node->data))) { + if (!switch_strlen_zero(node->data) && (strspn(node->data, " \t\r\n") < strlen(node->data))) { syslog(syslog_level, "%s", node->data); } @@ -128,8 +128,7 @@ static switch_status_t load_config(void) set_global_format(val); } else if (!strcasecmp(var, "loglevel") && !switch_strlen_zero(val)) { log_level = switch_log_str2level(val); - if(log_level == SWITCH_LOG_INVALID) - { + if (log_level == SWITCH_LOG_INVALID) { log_level = SWITCH_LOG_WARNING; } } diff --git a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c index ba5992754d..a008a06aa3 100644 --- a/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c +++ b/src/mod/xml_int/mod_xml_curl/mod_xml_curl.c @@ -306,12 +306,12 @@ static switch_status_t do_config(void) binding->vars_map = vars_map; - if(vars_map) { + if (vars_map) { switch_zmalloc(hash_node,sizeof(hash_node_t)); hash_node->hash = vars_map; hash_node->next = NULL; - if(!globals.hash_root) { + if (!globals.hash_root) { globals.hash_root = hash_node; globals.hash_tail = globals.hash_root; } diff --git a/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c b/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c index f7f6bc28bf..7f542a403e 100644 --- a/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c +++ b/src/mod/xml_int/mod_xml_ldap/mod_xml_ldap.c @@ -389,7 +389,7 @@ static switch_xml_t xml_ldap_search(const char *section, const char *tag_name, c //switch_xml_toxml_buf(xml,buf,0,0,1); //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "providing:\n%s\n", buf); - if(ret) { + if (ret) { switch_xml_free(xml); return NULL; } diff --git a/src/switch_core_port_allocator.c b/src/switch_core_port_allocator.c index feff7c3970..c4c3510587 100644 --- a/src/switch_core_port_allocator.c +++ b/src/switch_core_port_allocator.c @@ -131,7 +131,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_request_port(switch_c while (alloc->track[index] && tries < alloc->track_len) { tries++; - if(++index >= alloc->track_len) index = 0; + if (++index >= alloc->track_len) { + index = 0; + } } if (tries < alloc->track_len) { diff --git a/src/switch_stun.c b/src/switch_stun.c index 545462eecb..ee0cc4be57 100644 --- a/src/switch_stun.c +++ b/src/switch_stun.c @@ -538,8 +538,7 @@ SWITCH_DECLARE(switch_status_t) switch_stun_lookup(char **ip, switch (attr->type) { case SWITCH_STUN_ATTR_MAPPED_ADDRESS: if (attr->type) { - if(funny) - { + if (funny) { ((switch_stun_ip_t *) attr->value)->address ^= ntohl(0xabcdabcd); } switch_stun_packet_attribute_get_mapped_address(attr, rip, &rport); diff --git a/src/switch_xml.c b/src/switch_xml.c index 22c1b22b19..33344c9000 100644 --- a/src/switch_xml.c +++ b/src/switch_xml.c @@ -1082,7 +1082,7 @@ static int preprocess_glob(const char *cwd, const char *pattern, int write_fd, i pattern = full_path; } - if(glob(pattern, GLOB_NOCHECK, NULL, &glob_data) != 0) { + if (glob(pattern, GLOB_NOCHECK, NULL, &glob_data) != 0) { if (stderr) { fprintf(stderr, "Error including %s\n", pattern); } @@ -1154,7 +1154,7 @@ static int preprocess(const char *cwd, const char *file, int write_fd, int rleve if ((e = strstr(tcmd, "/>"))) { *e += 2; *e = '\0'; - if(write(write_fd, e, (unsigned) strlen(e)) != (int) strlen(e)) { + if (write(write_fd, e, (unsigned) strlen(e)) != (int) strlen(e)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Short write!\n"); } } @@ -1223,13 +1223,13 @@ static int preprocess(const char *cwd, const char *file, int write_fd, int rleve } if ((cmd = strstr(bp, ""))) { *e = '\0'; e += 3; - if(write(write_fd, e, (unsigned) strlen(e)) != (int) strlen(e)) { + if (write(write_fd, e, (unsigned) strlen(e)) != (int) strlen(e)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Short write!\n"); } } else { @@ -1279,7 +1279,7 @@ static int preprocess(const char *cwd, const char *file, int write_fd, int rleve continue; } - if(write(write_fd, bp, (unsigned) cur) != (int) cur) { + if (write(write_fd, bp, (unsigned) cur) != (int) cur) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Short write!\n"); } } @@ -2490,7 +2490,7 @@ static int glob3(char *pathbuf, char *pathend, char *pathend_last, char *pattern *pathend = EOS; errno = 0; - if(apr_dir_open (&dirp, pathbuf, pool) != APR_SUCCESS) { + if (apr_dir_open (&dirp, pathbuf, pool) != APR_SUCCESS) { /* TODO: don't call for ENOENT or ENOTDIR? */ apr_pool_destroy(pool); if (pglob->gl_errfunc) { @@ -2510,9 +2510,9 @@ static int glob3(char *pathbuf, char *pathend, char *pathend_last, char *pattern unsigned char *sc; char *dc; - if(apr_dir_read(&dp, APR_FINFO_NAME, dirp) != APR_SUCCESS) + if (apr_dir_read(&dp, APR_FINFO_NAME, dirp) != APR_SUCCESS) break; - if(!(dp.valid & APR_FINFO_NAME) || !(dp.name) || !strlen(dp.name)) + if (!(dp.valid & APR_FINFO_NAME) || !(dp.name) || !strlen(dp.name)) break; /* Initial DOT must be matched literally. */ @@ -2533,7 +2533,7 @@ static int glob3(char *pathbuf, char *pathend, char *pathend_last, char *pattern break; } - if(dirp) + if (dirp) apr_dir_close (dirp); apr_pool_destroy(pool); return(err);