summaryrefslogtreecommitdiff
path: root/src/xine-utils/xine_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-utils/xine_buffer.c')
-rw-r--r--src/xine-utils/xine_buffer.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/xine-utils/xine_buffer.c b/src/xine-utils/xine_buffer.c
index 44d0acbab..b1cfcf76b 100644
--- a/src/xine-utils/xine_buffer.c
+++ b/src/xine-utils/xine_buffer.c
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000-2003 the xine project
- *
+ *
* This file is part of xine, a free video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
@@ -74,9 +74,9 @@ typedef struct {
uint32_t size;
uint32_t chunk_size;
-
+
uint8_t magic;
-
+
} xine_buffer_header_t;
#define XINE_BUFFER_HEADER_SIZE 9
@@ -120,7 +120,7 @@ typedef struct {
* reallocation on slow growing buffers.
*/
void *xine_buffer_init(int chunk_size) {
-
+
uint8_t *data=calloc(1, chunk_size+XINE_BUFFER_HEADER_SIZE);
xine_buffer_header_t *header=(xine_buffer_header_t*)data;
@@ -157,7 +157,7 @@ void *_xine_buffer_free(void *buf) {
void *xine_buffer_dup(const void *buf) {
uint8_t *new;
-
+
#ifdef CHECKS
if (!buf) {
lprintf("warning: got NULL pointer\n");
@@ -168,7 +168,7 @@ void *xine_buffer_dup(const void *buf) {
new = malloc(GET_HEADER(buf)->size+XINE_BUFFER_HEADER_SIZE);
- xine_fast_memcpy(new, ((uint8_t*)buf)-XINE_BUFFER_HEADER_SIZE,
+ xine_fast_memcpy(new, ((uint8_t*)buf)-XINE_BUFFER_HEADER_SIZE,
GET_HEADER(buf)->size+XINE_BUFFER_HEADER_SIZE);
return new+XINE_BUFFER_HEADER_SIZE;
@@ -180,7 +180,7 @@ void *xine_buffer_dup(const void *buf) {
#define xine_buffer_copyin(buf,i,data,len) \
buf=_xine_buffer_copyin(buf,i,data,len)
void *_xine_buffer_copyin(void *buf, int index, const void *data, int len) {
-
+
#ifdef CHECKS
if (!buf || !data) {
lprintf("warning: got NULL pointer\n");
@@ -237,7 +237,7 @@ void *_xine_buffer_set(void *buf, int index, uint8_t b, int len) {
#endif
GROW_TO(buf, index+len);
-
+
memset(((uint8_t*)buf)+index, b, len);
return buf;
@@ -326,6 +326,6 @@ void *_xine_buffer_ensure_size(void *buf, int size) {
#endif
GROW_TO(buf, size);
-
+
return buf;
}