mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
FS-9924: Removed extra space in source files
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||
* Copyright (C) 2005-2014, Anthony Minessale II <anthm@freeswitch.org>
|
||||
*
|
||||
@@ -22,7 +22,7 @@
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Anthony Minessale II <anthm@freeswitch.org>
|
||||
* Juan Jose Comellas <juanjo@comellas.org>
|
||||
* Seven Du <dujinfang@gmail.com>
|
||||
@@ -124,7 +124,7 @@ static switch_frame_t *find_free_frame(switch_frame_buffer_t *fb, switch_frame_t
|
||||
|
||||
for (np = fb->head; np; np = np->next) {
|
||||
x++;
|
||||
|
||||
|
||||
if (!np->inuse && ((orig->packet && np->frame->packet) || (!orig->packet && !np->frame->packet))) {
|
||||
|
||||
if (np == fb->head) {
|
||||
@@ -140,13 +140,13 @@ static switch_frame_t *find_free_frame(switch_frame_buffer_t *fb, switch_frame_t
|
||||
fb->total--;
|
||||
np->prev = np->next = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!np) {
|
||||
np = switch_core_alloc(fb->pool, sizeof(*np));
|
||||
np->frame = switch_core_alloc(fb->pool, sizeof(*np->frame));
|
||||
|
||||
|
||||
if (orig->packet) {
|
||||
np->frame->packet = switch_core_alloc(fb->pool, SWITCH_RTP_MAX_BUF_LEN);
|
||||
} else {
|
||||
@@ -188,7 +188,7 @@ static switch_frame_t *find_free_frame(switch_frame_buffer_t *fb, switch_frame_t
|
||||
if (orig->img && !switch_test_flag(orig, SFF_ENCODED)) {
|
||||
switch_img_copy(orig->img, &np->frame->img);
|
||||
}
|
||||
|
||||
|
||||
switch_mutex_unlock(fb->mutex);
|
||||
|
||||
return np->frame;
|
||||
@@ -203,11 +203,11 @@ SWITCH_DECLARE(switch_status_t) switch_frame_buffer_free(switch_frame_buffer_t *
|
||||
|
||||
old_frame = *frameP;
|
||||
*frameP = NULL;
|
||||
|
||||
|
||||
node = (switch_frame_node_t *) old_frame->extra_data;
|
||||
node->inuse = 0;
|
||||
switch_img_free(&node->frame->img);
|
||||
|
||||
|
||||
fb->total++;
|
||||
|
||||
if (fb->head) {
|
||||
@@ -220,7 +220,7 @@ SWITCH_DECLARE(switch_status_t) switch_frame_buffer_free(switch_frame_buffer_t *
|
||||
|
||||
switch_assert(node->next != node);
|
||||
switch_assert(node->prev != node);
|
||||
|
||||
|
||||
|
||||
switch_mutex_unlock(fb->mutex);
|
||||
|
||||
@@ -238,7 +238,7 @@ SWITCH_DECLARE(switch_status_t) switch_frame_buffer_dup(switch_frame_buffer_t *f
|
||||
switch_assert(orig->buflen);
|
||||
|
||||
new_frame = find_free_frame(fb, orig);
|
||||
|
||||
|
||||
*clone = new_frame;
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
@@ -379,7 +379,7 @@ SWITCH_DECLARE(int) switch_strcasecmp_any(const char *str, ...)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
va_end(ap);
|
||||
|
||||
return r;
|
||||
@@ -408,7 +408,7 @@ SWITCH_DECLARE(char *) switch_find_parameter(const char *str, const char *param,
|
||||
} else {
|
||||
e = ptr + strlen(ptr);
|
||||
}
|
||||
|
||||
|
||||
mlen = (e - ptr) + 1;
|
||||
|
||||
if (pool) {
|
||||
@@ -754,7 +754,7 @@ SWITCH_DECLARE(switch_size_t) switch_fd_read_dline(int fd, char **buf, switch_si
|
||||
|
||||
if (total + 2 >= ilen) {
|
||||
if (ilen + DLINE_BLOCK_SIZE > DLINE_MAX_SIZE) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Single line limit reached!\n");
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Single line limit reached!\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -800,10 +800,10 @@ SWITCH_DECLARE(switch_size_t) switch_fp_read_dline(FILE *fd, char **buf, switch_
|
||||
//while ((c = fgetc(fd)) != EOF) {
|
||||
|
||||
while (fread(&c, 1, 1, fd) == 1) {
|
||||
|
||||
|
||||
if (total + 2 >= ilen) {
|
||||
if (ilen + DLINE_BLOCK_SIZE > DLINE_MAX_SIZE) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Single line limit reached!\n");
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Single line limit reached!\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1252,7 +1252,7 @@ SWITCH_DECLARE(switch_bool_t) switch_is_lan_addr(const char *ip)
|
||||
strncmp(ip, "192.168.", 8) && /* 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) */
|
||||
strncmp(ip, "127.", 4) && /* 127.0.0.0 - 127.255.255.255 (127/8 prefix) */
|
||||
strncmp(ip, "255.", 4) &&
|
||||
strncmp(ip, "0.", 2) &&
|
||||
strncmp(ip, "0.", 2) &&
|
||||
strncmp(ip, "1.", 2) &&
|
||||
strncmp(ip, "2.", 2) &&
|
||||
strncmp(ip, "172.16.", 7) && /* 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) */
|
||||
@@ -1340,7 +1340,7 @@ SWITCH_DECLARE(char *) switch_strip_whitespace(const char *str)
|
||||
while ((*sp == 13 ) || (*sp == 10 ) || (*sp == 9 ) || (*sp == 32) || (*sp == 11) ) {
|
||||
sp++;
|
||||
}
|
||||
|
||||
|
||||
if (zstr(sp)) {
|
||||
return strdup(SWITCH_BLANK_STRING);
|
||||
}
|
||||
@@ -2682,7 +2682,7 @@ static unsigned int separate_string_blank_delim(char *buf, char **array, unsigne
|
||||
for (i = 0; i < count; ++i) {
|
||||
array[i] = cleanup_separated_string(array[i], 0);
|
||||
}
|
||||
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -2695,7 +2695,7 @@ SWITCH_DECLARE(unsigned int) switch_separate_string(char *buf, char delim, char
|
||||
|
||||
if (*buf == '^' && *(buf+1) == '^') {
|
||||
char *p = buf + 2;
|
||||
|
||||
|
||||
if (p && *p && *(p+1)) {
|
||||
buf = p;
|
||||
delim = *buf++;
|
||||
@@ -2863,7 +2863,7 @@ SWITCH_DECLARE(int) switch_wait_sock(switch_os_socket_t sock, uint32_t ms, switc
|
||||
|
||||
if (sock == SWITCH_SOCK_INVALID) {
|
||||
return SWITCH_SOCK_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
pfds[0].fd = sock;
|
||||
|
||||
@@ -2895,7 +2895,7 @@ SWITCH_DECLARE(int) switch_wait_sock(switch_os_socket_t sock, uint32_t ms, switc
|
||||
if ((flags & SWITCH_POLL_PRI)) {
|
||||
pfds[0].events |= POLLPRI;
|
||||
}
|
||||
|
||||
|
||||
s = poll(pfds, 1, ms);
|
||||
|
||||
if (s < 0) {
|
||||
@@ -2943,14 +2943,14 @@ SWITCH_DECLARE(int) switch_wait_socklist(switch_waitlist_t *waitlist, uint32_t l
|
||||
int s = 0, r = 0, i;
|
||||
|
||||
pfds = calloc(len, sizeof(struct pollfd));
|
||||
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
if (waitlist[i].sock == SWITCH_SOCK_INVALID) {
|
||||
break;
|
||||
}
|
||||
|
||||
pfds[i].fd = waitlist[i].sock;
|
||||
|
||||
|
||||
if ((waitlist[i].events & SWITCH_POLL_READ)) {
|
||||
pfds[i].events |= POLLIN;
|
||||
}
|
||||
@@ -2979,7 +2979,7 @@ SWITCH_DECLARE(int) switch_wait_socklist(switch_waitlist_t *waitlist, uint32_t l
|
||||
pfds[i].events |= POLLPRI;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
s = poll(pfds, len, ms);
|
||||
|
||||
if (s < 0) {
|
||||
@@ -3059,14 +3059,14 @@ SWITCH_DECLARE(int) switch_wait_sock(switch_os_socket_t sock, uint32_t ms, switc
|
||||
/* Wouldn't you rather know?? */
|
||||
assert(sock <= FD_SETSIZE);
|
||||
#endif
|
||||
|
||||
|
||||
if ((flags & SWITCH_POLL_READ)) {
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4127 )
|
||||
FD_SET(sock, rfds);
|
||||
#pragma warning( pop )
|
||||
#pragma warning( pop )
|
||||
#else
|
||||
FD_SET(sock, rfds);
|
||||
#endif
|
||||
@@ -3078,7 +3078,7 @@ SWITCH_DECLARE(int) switch_wait_sock(switch_os_socket_t sock, uint32_t ms, switc
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4127 )
|
||||
FD_SET(sock, wfds);
|
||||
#pragma warning( pop )
|
||||
#pragma warning( pop )
|
||||
#else
|
||||
FD_SET(sock, wfds);
|
||||
#endif
|
||||
@@ -3090,7 +3090,7 @@ SWITCH_DECLARE(int) switch_wait_sock(switch_os_socket_t sock, uint32_t ms, switc
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4127 )
|
||||
FD_SET(sock, efds);
|
||||
#pragma warning( pop )
|
||||
#pragma warning( pop )
|
||||
#else
|
||||
FD_SET(sock, efds);
|
||||
#endif
|
||||
@@ -3098,7 +3098,7 @@ SWITCH_DECLARE(int) switch_wait_sock(switch_os_socket_t sock, uint32_t ms, switc
|
||||
|
||||
tv.tv_sec = ms / 1000;
|
||||
tv.tv_usec = (ms % 1000) * ms;
|
||||
|
||||
|
||||
s = select(sock + 1, (flags & SWITCH_POLL_READ) ? rfds : NULL, (flags & SWITCH_POLL_WRITE) ? wfds : NULL, (flags & SWITCH_POLL_ERROR) ? efds : NULL, &tv);
|
||||
|
||||
if (s < 0) {
|
||||
@@ -3164,14 +3164,14 @@ SWITCH_DECLARE(int) switch_wait_socklist(switch_waitlist_t *waitlist, uint32_t l
|
||||
assert(waitlist[i].sock <= FD_SETSIZE);
|
||||
#endif
|
||||
flags |= waitlist[i].events;
|
||||
|
||||
|
||||
if ((waitlist[i].events & SWITCH_POLL_READ)) {
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4127 )
|
||||
FD_SET(waitlist[i].sock, rfds);
|
||||
#pragma warning( pop )
|
||||
#pragma warning( pop )
|
||||
#else
|
||||
FD_SET(waitlist[i].sock, rfds);
|
||||
#endif
|
||||
@@ -3183,7 +3183,7 @@ SWITCH_DECLARE(int) switch_wait_socklist(switch_waitlist_t *waitlist, uint32_t l
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4127 )
|
||||
FD_SET(waitlist[i].sock, wfds);
|
||||
#pragma warning( pop )
|
||||
#pragma warning( pop )
|
||||
#else
|
||||
FD_SET(waitlist[i].sock, wfds);
|
||||
#endif
|
||||
@@ -3195,7 +3195,7 @@ SWITCH_DECLARE(int) switch_wait_socklist(switch_waitlist_t *waitlist, uint32_t l
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4127 )
|
||||
FD_SET(waitlist[i].sock, efds);
|
||||
#pragma warning( pop )
|
||||
#pragma warning( pop )
|
||||
#else
|
||||
FD_SET(waitlist[i].sock, efds);
|
||||
#endif
|
||||
@@ -3204,7 +3204,7 @@ SWITCH_DECLARE(int) switch_wait_socklist(switch_waitlist_t *waitlist, uint32_t l
|
||||
|
||||
tv.tv_sec = ms / 1000;
|
||||
tv.tv_usec = (ms % 1000) * ms;
|
||||
|
||||
|
||||
s = select(max_fd + 1, (flags & SWITCH_POLL_READ) ? rfds : NULL, (flags & SWITCH_POLL_WRITE) ? wfds : NULL, (flags & SWITCH_POLL_ERROR) ? efds : NULL, &tv);
|
||||
|
||||
if (s < 0) {
|
||||
@@ -3752,7 +3752,7 @@ SWITCH_DECLARE(const char *) switch_dow_int2str(int val) {
|
||||
SWITCH_DECLARE(int) switch_dow_str2int(const char *exp) {
|
||||
int ret = -1;
|
||||
int x;
|
||||
|
||||
|
||||
for (x = 0; x < switch_arraylen(DOW); x++) {
|
||||
if (!strncasecmp(DOW[x], exp, 3)) {
|
||||
ret = x + 1;
|
||||
@@ -3776,10 +3776,10 @@ typedef enum {
|
||||
DOW_COMA = ','
|
||||
} dow_t;
|
||||
|
||||
static inline dow_t _dow_read_token(const char **s)
|
||||
static inline dow_t _dow_read_token(const char **s)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
if (**s == '-') {
|
||||
(*s)++;
|
||||
return DOW_HYPHEN;
|
||||
@@ -3804,11 +3804,11 @@ SWITCH_DECLARE(switch_bool_t) switch_dow_cmp(const char *exp, int val)
|
||||
{
|
||||
dow_t cur, prev = DOW_EOF, range_start = DOW_EOF;
|
||||
const char *p = exp;
|
||||
|
||||
|
||||
while ((cur = _dow_read_token(&p)) != DOW_EOF) {
|
||||
if (cur == DOW_COMA) {
|
||||
/* Reset state */
|
||||
cur = prev = DOW_EOF;
|
||||
cur = prev = DOW_EOF;
|
||||
} else if (cur == DOW_HYPHEN) {
|
||||
/* Save the previous token and move to the next one */
|
||||
range_start = prev;
|
||||
@@ -3826,7 +3826,7 @@ SWITCH_DECLARE(switch_bool_t) switch_dow_cmp(const char *exp, int val)
|
||||
return SWITCH_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
prev = cur;
|
||||
}
|
||||
|
||||
@@ -3979,7 +3979,7 @@ SWITCH_DECLARE(char *) switch_format_number(const char *num)
|
||||
}
|
||||
|
||||
len = strlen(p);
|
||||
|
||||
|
||||
/* region 1, TBD add more....*/
|
||||
if (len == 11 && p[0] == '1') {
|
||||
r = switch_mprintf("%c (%c%c%c) %c%c%c-%c%c%c%c", p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],p[9],p[10]);
|
||||
@@ -4321,11 +4321,11 @@ static void process(GumboNode *node, switch_stream_handle_t *stream)
|
||||
} else if (node->type == GUMBO_NODE_ELEMENT && node->v.element.tag != GUMBO_TAG_SCRIPT && node->v.element.tag != GUMBO_TAG_STYLE) {
|
||||
GumboVector *children = &node->v.element.children;
|
||||
int i;
|
||||
|
||||
|
||||
if (node->v.element.tag != GUMBO_TAG_UNKNOWN && node->v.element.tag <= GUMBO_TAG_LAST) {
|
||||
GumboAttribute* attr = NULL;
|
||||
const char *aval = NULL;
|
||||
|
||||
|
||||
if (node->v.element.tag == GUMBO_TAG_SPAN) {
|
||||
if ((attr = gumbo_get_attribute(&node->v.element.attributes, "class"))) {
|
||||
aval = attr->value;
|
||||
@@ -4341,13 +4341,13 @@ static void process(GumboNode *node, switch_stream_handle_t *stream)
|
||||
len++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (x = 0; x < len*2; x++) {
|
||||
stream->write_function(stream, "%s", " ");
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < children->length; ++i) {
|
||||
process((GumboNode*) children->data[i], stream);
|
||||
process((GumboNode*) children->data[i], stream);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4376,7 +4376,7 @@ SWITCH_DECLARE(char *)switch_html_strip(const char *str)
|
||||
if (!strncasecmp(p, "Content-Type:", 13)) {
|
||||
got_ct++;
|
||||
}
|
||||
|
||||
|
||||
if (!got_ct) continue;
|
||||
|
||||
if (*p == '\n') {
|
||||
|
Reference in New Issue
Block a user