mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 09:58:17 +00:00
update
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@418 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -41,8 +41,7 @@ SWITCH_DECLARE(switch_status) switch_buffer_create(switch_memory_pool *pool, swi
|
||||
{
|
||||
switch_buffer *new_buffer;
|
||||
|
||||
if ((new_buffer = switch_core_alloc(pool, sizeof(switch_buffer)))
|
||||
&& (new_buffer->data = switch_core_alloc(pool, max_len))) {
|
||||
if ((new_buffer = switch_core_alloc(pool, sizeof(switch_buffer))) && (new_buffer->data = switch_core_alloc(pool, max_len))) {
|
||||
new_buffer->datalen = max_len;
|
||||
*buffer = new_buffer;
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
@@ -55,7 +54,7 @@ SWITCH_DECLARE(int) switch_buffer_len(switch_buffer *buffer)
|
||||
|
||||
assert(buffer != NULL);
|
||||
|
||||
return (int) buffer->datalen;
|
||||
return (int)buffer->datalen;
|
||||
|
||||
}
|
||||
|
||||
@@ -64,14 +63,14 @@ SWITCH_DECLARE(int) switch_buffer_freespace(switch_buffer *buffer)
|
||||
{
|
||||
assert(buffer != NULL);
|
||||
|
||||
return (int) (buffer->datalen - buffer->used);
|
||||
return (int)(buffer->datalen - buffer->used);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(int) switch_buffer_inuse(switch_buffer *buffer)
|
||||
{
|
||||
assert(buffer != NULL);
|
||||
|
||||
return (int) buffer->used;
|
||||
return (int)buffer->used;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(int) switch_buffer_toss(switch_buffer *buffer, size_t datalen)
|
||||
@@ -92,7 +91,7 @@ SWITCH_DECLARE(int) switch_buffer_toss(switch_buffer *buffer, size_t datalen)
|
||||
memmove(buffer->data, buffer->data + reading, buffer->datalen - reading);
|
||||
buffer->used -= datalen;
|
||||
|
||||
return (int) buffer->datalen;
|
||||
return (int)buffer->datalen;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(int) switch_buffer_read(switch_buffer *buffer, void *data, size_t datalen)
|
||||
@@ -116,7 +115,7 @@ SWITCH_DECLARE(int) switch_buffer_read(switch_buffer *buffer, void *data, size_t
|
||||
memmove(buffer->data, buffer->data + reading, buffer->datalen - reading);
|
||||
buffer->used -= reading;
|
||||
//printf("o %d = %d\n", reading, buffer->used);
|
||||
return (int) reading;
|
||||
return (int)reading;
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(int) switch_buffer_write(switch_buffer *buffer, void *data, size_t datalen)
|
||||
@@ -136,5 +135,6 @@ SWITCH_DECLARE(int) switch_buffer_write(switch_buffer *buffer, void *data, size_
|
||||
buffer->used += datalen;
|
||||
}
|
||||
//printf("i %d = %d\n", datalen, buffer->used);
|
||||
return (int) buffer->used;
|
||||
return (int)buffer->used;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user