diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2009-11-22 13:51:25 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2009-11-22 13:51:25 +0000 |
commit | f6201039252420cd8abbd3281de5141680732bee (patch) | |
tree | 85b31cec03002b166c0cdfe589ac7ed8970ca266 /apps | |
parent | 0c52374a3d9aba02a0743892767678491710a367 (diff) | |
download | rockbox-f6201039252420cd8abbd3281de5141680732bee.tar.gz 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')
-rw-r--r-- | apps/buffering.c | 32 |
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, | |||
451 | } | 451 | } |
452 | if (correction) { | 452 | if (correction) { |
453 | /* Align correction to four bytes up */ | 453 | /* Align correction to four bytes up */ |
454 | correction = (correction + 3) & ~3; | 454 | correction = (correction + 3) & ~3; |
455 | if (final_delta < correction + sizeof(struct memory_handle)) { | 455 | if (final_delta < correction + sizeof(struct memory_handle)) { |
456 | /* Delta cannot end up less than the size of the struct */ | 456 | /* Delta cannot end up less than the size of the struct */ |
457 | mutex_unlock(&llist_mod_mutex); | 457 | mutex_unlock(&llist_mod_mutex); |
@@ -493,31 +493,31 @@ static bool move_handle(struct memory_handle **h, size_t *delta, | |||
493 | cur_handle = dest; | 493 | cur_handle = dest; |
494 | 494 | ||
495 | 495 | ||
496 | /* Copying routine takes into account that the handles have a | 496 | /* Copying routine takes into account that the handles have a |
497 | * distance between each other which is a multiple of four. Faster 2 word | 497 | * distance between each other which is a multiple of four. Faster 2 word |
498 | * copy may be ok but do this for safety and because wrapped copies should | 498 | * copy may be ok but do this for safety and because wrapped copies should |
499 | * be fairly uncommon */ | 499 | * be fairly uncommon */ |
500 | 500 | ||
501 | here = (int32_t *)((RINGBUF_ADD(oldpos, size_to_move - 1) & ~3)+ (intptr_t)buffer); | 501 | here = (int32_t *)((RINGBUF_ADD(oldpos, size_to_move - 1) & ~3)+ (intptr_t)buffer); |
502 | there =(int32_t *)((RINGBUF_ADD(newpos, size_to_move - 1) & ~3)+ (intptr_t)buffer); | 502 | there =(int32_t *)((RINGBUF_ADD(newpos, size_to_move - 1) & ~3)+ (intptr_t)buffer); |
503 | end = (int32_t *)(( intptr_t)buffer + buffer_len - 4); | 503 | end = (int32_t *)(( intptr_t)buffer + buffer_len - 4); |
504 | begin =(int32_t *)buffer; | 504 | begin =(int32_t *)buffer; |
505 | 505 | ||
506 | n = (size_to_move & ~3)/4; | 506 | n = (size_to_move & ~3)/4; |
507 | 507 | ||
508 | if ( overlap_old > 0 || overlap > 0 ) { | 508 | if ( overlap_old > 0 || overlap > 0 ) { |
509 | /* Old or moved handle wraps */ | 509 | /* Old or moved handle wraps */ |
510 | while (n--) { | 510 | while (n--) { |
511 | if (here < begin) | 511 | if (here < begin) |
512 | here = end; | 512 | here = end; |
513 | if (there < begin) | 513 | if (there < begin) |
514 | there = end; | 514 | there = end; |
515 | *there-- = *here--; | 515 | *there-- = *here--; |
516 | } | 516 | } |
517 | } else { | 517 | } else { |
518 | /* both handles do not wrap */ | 518 | /* both handles do not wrap */ |
519 | memmove(dest,src,size_to_move); | 519 | memmove(dest,src,size_to_move); |
520 | } | 520 | } |
521 | 521 | ||
522 | 522 | ||
523 | /* Update the caller with the new location of h and the distance moved */ | 523 | /* Update the caller with the new location of h and the distance moved */ |
@@ -644,10 +644,10 @@ static bool buffer_handle(int handle_id) | |||
644 | if (RINGBUF_ADD_CROSS(h->widx, copy_n, buf_ridx) >= 0) | 644 | if (RINGBUF_ADD_CROSS(h->widx, copy_n, buf_ridx) >= 0) |
645 | return false; | 645 | return false; |
646 | 646 | ||
647 | /* This would read into the next handle, this is broken | 647 | /* This would read into the next handle, this is broken |
648 | if (h->next && RINGBUF_ADD_CROSS(h->widx, copy_n, | 648 | if (h->next && RINGBUF_ADD_CROSS(h->widx, copy_n, |
649 | (unsigned)((void *)h->next - (void *)buffer)) > 0) { | 649 | (unsigned)((void *)h->next - (void *)buffer)) > 0) { |
650 | Try to recover by truncating this file | 650 | Try to recover by truncating this file |
651 | copy_n = RINGBUF_ADD_CROSS(h->widx, copy_n, | 651 | copy_n = RINGBUF_ADD_CROSS(h->widx, copy_n, |
652 | (unsigned)((void *)h->next - (void *)buffer)); | 652 | (unsigned)((void *)h->next - (void *)buffer)); |
653 | h->filerem -= copy_n; | 653 | h->filerem -= copy_n; |