summaryrefslogtreecommitdiffstats
path: root/apps/buffering.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2009-11-22 13:51:25 +0000
committerRafaël Carré <rafael.carre@gmail.com>2009-11-22 13:51:25 +0000
commitf6201039252420cd8abbd3281de5141680732bee (patch)
tree85b31cec03002b166c0cdfe589ac7ed8970ca266 /apps/buffering.c
parent0c52374a3d9aba02a0743892767678491710a367 (diff)
downloadrockbox-f6201039252420cd8abbd3281de5141680732bee.tar.gz
rockbox-f6201039252420cd8abbd3281de5141680732bee.tar.bz2
rockbox-f6201039252420cd8abbd3281de5141680732bee.zip
buffering.c: cosmetics
remove tabs, remove trailing spaces, indentation git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23697 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/buffering.c')
-rw-r--r--apps/buffering.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/apps/buffering.c b/apps/buffering.c
index 79144e78db..9deced433f 100644
--- a/apps/buffering.c
+++ b/apps/buffering.c
@@ -451,7 +451,7 @@ static bool move_handle(struct memory_handle **h, size_t *delta,
}
if (correction) {
/* Align correction to four bytes up */
- correction = (correction + 3) & ~3;
+ correction = (correction + 3) & ~3;
if (final_delta < correction + sizeof(struct memory_handle)) {
/* Delta cannot end up less than the size of the struct */
mutex_unlock(&llist_mod_mutex);
@@ -493,31 +493,31 @@ static bool move_handle(struct memory_handle **h, size_t *delta,
cur_handle = dest;
- /* Copying routine takes into account that the handles have a
+ /* Copying routine takes into account that the handles have a
* distance between each other which is a multiple of four. Faster 2 word
* copy may be ok but do this for safety and because wrapped copies should
- * be fairly uncommon */
+ * be fairly uncommon */
here = (int32_t *)((RINGBUF_ADD(oldpos, size_to_move - 1) & ~3)+ (intptr_t)buffer);
there =(int32_t *)((RINGBUF_ADD(newpos, size_to_move - 1) & ~3)+ (intptr_t)buffer);
end = (int32_t *)(( intptr_t)buffer + buffer_len - 4);
begin =(int32_t *)buffer;
-
+
n = (size_to_move & ~3)/4;
- if ( overlap_old > 0 || overlap > 0 ) {
- /* Old or moved handle wraps */
- while (n--) {
- if (here < begin)
- here = end;
- if (there < begin)
- there = end;
- *there-- = *here--;
- }
+ if ( overlap_old > 0 || overlap > 0 ) {
+ /* Old or moved handle wraps */
+ while (n--) {
+ if (here < begin)
+ here = end;
+ if (there < begin)
+ there = end;
+ *there-- = *here--;
+ }
} else {
/* both handles do not wrap */
memmove(dest,src,size_to_move);
- }
+ }
/* Update the caller with the new location of h and the distance moved */
@@ -644,10 +644,10 @@ static bool buffer_handle(int handle_id)
if (RINGBUF_ADD_CROSS(h->widx, copy_n, buf_ridx) >= 0)
return false;
- /* This would read into the next handle, this is broken
+ /* This would read into the next handle, this is broken
if (h->next && RINGBUF_ADD_CROSS(h->widx, copy_n,
(unsigned)((void *)h->next - (void *)buffer)) > 0) {
- Try to recover by truncating this file
+ Try to recover by truncating this file
copy_n = RINGBUF_ADD_CROSS(h->widx, copy_n,
(unsigned)((void *)h->next - (void *)buffer));
h->filerem -= copy_n;