ocd tweaks

This commit is contained in:
Mitchell Livingston 2010-02-15 16:15:37 +00:00
parent 78f6a488d5
commit f239919443
2 changed files with 11 additions and 12 deletions

1
NEWS
View File

@ -33,7 +33,6 @@
==== Qt ====
* Fix bug that prevented torrents from being added via web browsers
=== Transmission 1.83 (2010/01/28) ===
[http://trac.transmissionbt.com/query?milestone=1.83&group=component&groupdesc=1&order=severity All tickets closed by this release]
==== All Platforms ====

View File

@ -109,7 +109,7 @@ tr_ptrArrayErase( tr_ptrArray * t,
{
assert( begin >= 0 );
if( end < 0 ) end = t->n_items;
assert( end - begin > 0 );
assert( begin < end );
assert( end <= t->n_items );
memmove( t->items + begin,
@ -128,7 +128,7 @@ tr_ptrArrayLowerBound( const tr_ptrArray * t,
const void * ptr,
int compare( const void *,
const void * ),
int * exact_match )
tr_bool * exact_match )
{
int len = t->n_items;
int first = 0;
@ -146,7 +146,7 @@ tr_ptrArrayLowerBound( const tr_ptrArray * t,
else if( !c )
{
if( exact_match )
*exact_match = 1;
*exact_match = TRUE;
return middle;
break;
}
@ -157,7 +157,7 @@ tr_ptrArrayLowerBound( const tr_ptrArray * t,
}
if( exact_match )
*exact_match = 0;
*exact_match = FALSE;
return first;
}
@ -167,7 +167,7 @@ tr_ptrArrayLowerBound( const tr_ptrArray * t,
#else
static void
assertSortedAndUnique( const tr_ptrArray * t,
int compare(const void*, const void*) )
int compare(const void*, const void*) )
{
int i;
@ -179,7 +179,7 @@ assertSortedAndUnique( const tr_ptrArray * t,
int
tr_ptrArrayInsertSorted( tr_ptrArray * t,
void * ptr,
int compare(const void*, const void*) )
int compare(const void*, const void*) )
{
const int pos = tr_ptrArrayLowerBound( t, ptr, compare, NULL );
const int ret = tr_ptrArrayInsert( t, ptr, pos );
@ -191,9 +191,9 @@ tr_ptrArrayInsertSorted( tr_ptrArray * t,
void*
tr_ptrArrayFindSorted( tr_ptrArray * t,
const void * ptr,
int compare(const void*, const void*) )
int compare(const void*, const void*) )
{
int match;
tr_bool match;
const int pos = tr_ptrArrayLowerBound( t, ptr, compare, &match );
return match ? t->items[pos] : NULL;
@ -201,11 +201,11 @@ tr_ptrArrayFindSorted( tr_ptrArray * t,
void*
tr_ptrArrayRemoveSorted( tr_ptrArray * t,
const void * ptr,
int compare(const void*, const void*) )
const void * ptr,
int compare(const void*, const void*) )
{
void * ret = NULL;
int match;
tr_bool match;
const int pos = tr_ptrArrayLowerBound( t, ptr, compare, &match );
if( match )