summaryrefslogtreecommitdiff
path: root/firmware/buflib.c
diff options
context:
space:
mode:
authorBoris Gjenero <dreamlayers@rockbox.org>2011-11-27 01:40:47 +0000
committerBoris Gjenero <dreamlayers@rockbox.org>2011-11-27 01:40:47 +0000
commitbd360b422ae4b03c3ef161ad5fd204feb9c6c62c (patch)
tree74458a5892d366c137fdef5cffd4c6740c9a8940 /firmware/buflib.c
parent99ea0c5051d51b8cd72e009b96442942f1766792 (diff)
downloadrockbox-bd360b422ae4b03c3ef161ad5fd204feb9c6c62c.tar.gz
rockbox-bd360b422ae4b03c3ef161ad5fd204feb9c6c62c.zip
In buflib_buffer_shift(), properly update handle->alloc values, which are char * and not union buflib data *
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31066 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/buflib.c')
-rw-r--r--firmware/buflib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/firmware/buflib.c b/firmware/buflib.c
index 43fc4bd3de..748e8a2378 100644
--- a/firmware/buflib.c
+++ b/firmware/buflib.c
@@ -366,12 +366,13 @@ buflib_buffer_shift(struct buflib_context *ctx, int shift)
366{ 366{
367 memmove(ctx->buf_start + shift, ctx->buf_start, 367 memmove(ctx->buf_start + shift, ctx->buf_start,
368 (ctx->alloc_end - ctx->buf_start) * sizeof(union buflib_data)); 368 (ctx->alloc_end - ctx->buf_start) * sizeof(union buflib_data));
369 ctx->buf_start += shift;
370 ctx->alloc_end += shift;
371 shift *= sizeof(union buflib_data);
369 union buflib_data *handle; 372 union buflib_data *handle;
370 for (handle = ctx->last_handle; handle < ctx->handle_table; handle++) 373 for (handle = ctx->last_handle; handle < ctx->handle_table; handle++)
371 if (handle->alloc) 374 if (handle->alloc)
372 handle->alloc += shift; 375 handle->alloc += shift;
373 ctx->buf_start += shift;
374 ctx->alloc_end += shift;
375} 376}
376 377
377/* Shift buffered items up by size bytes, or as many as possible if size == 0. 378/* Shift buffered items up by size bytes, or as many as possible if size == 0.