hash *chr_hash = NULL;
hash_elem *bucket = NULL;
barray *ba = NULL;
- ushort score = 0;
+ uint score = 0;
size_t i = 0;
size_t j = 0;
char *chr = NULL;
hash_add( chr_hash, entry->chr, ba );
}
- score = ( ushort ) get_score( entry->q_id );
+ score = ( uint ) get_score( entry->q_id );
barray_interval_inc( ba, entry->chr_beg, entry->chr_end - 1, score );
}
hash *chr_hash = NULL;
hash_elem *bucket = NULL;
barray *ba = NULL;
- ushort score = 0;
+ uint score = 0;
size_t i = 0;
char *chr = NULL;
size_t beg = 0;
size_t end = 0;
size_t pos = 0;
- ushort max = 0;
+ uint max = 0;
size_t id = 0;
entry = bed_entry_new( BED_COLS );
hash_add( chr_hash, entry->chr, ba );
}
- score = ( ushort ) get_score( entry->q_id );
+ score = ( uint ) get_score( entry->q_id );
if ( score > entry->score && entry->score > 0 ) {
- barray_interval_inc( ba, entry->chr_beg, entry->chr_end - 1, ( ushort ) ( score / entry->score ) );
+ barray_interval_inc( ba, entry->chr_beg, entry->chr_end - 1, ( uint ) ( score / entry->score ) );
}
}
struct _barray
{
- ushort *array; /* Unsigned short array. */
+ uint *array; /* Unsigned integer array. */
size_t nmemb; /* Number of elements in array. */
size_t end; /* Last position used. */
};
/* Increments a given interval of a byte array with a given score.
* Resizes the byte array if needed. */
-void barray_interval_inc( barray *ba, size_t beg, size_t end, ushort score );
+void barray_interval_inc( barray *ba, size_t beg, size_t end, uint score );
/* Scan a byte array from a given position
* for the next interval of non-zero values. */
bool barray_interval_scan( barray *ba, size_t *pos_pt, size_t *beg_pt, size_t *end_pt );
/* Locate the max value in an interval within a byte array. */
-ushort barray_interval_max( barray *ba, size_t beg, size_t end );
+uint barray_interval_max( barray *ba, size_t beg, size_t end );
/* Deallocates a byte array and set it to NULL. */
void barray_destroy( barray **ba_ppt );
size_t size_old = ba->nmemb * sizeof( ba->array );
size_t size_new = nmemb_new * sizeof( ba->array );
- ba->array = ( ushort * ) mem_resize_zero( ( void * ) ba->array, size_old, size_new );
+ ba->array = ( uint * ) mem_resize_zero( ( void * ) ba->array, size_old, size_new );
ba->nmemb = nmemb_new;
}
}
-void barray_interval_inc( barray *ba, size_t beg, size_t end, ushort score )
+void barray_interval_inc( barray *ba, size_t beg, size_t end, uint score )
{
/* Martin A. Hansen, November 2008. */
}
-ushort barray_interval_max( barray *ba, size_t beg, size_t end )
+uint barray_interval_max( barray *ba, size_t beg, size_t end )
{
/* Martin A. Hansen, December 2008. */
/* Locate the max value in an interval within a byte array. */
size_t i = 0;
- ushort max = 0;
+ uint max = 0;
for ( i = beg; i <= end; i++ ) {
max = MAX( max, ba->array[ i ] );
size_t pos = 0;
size_t beg = 0;
size_t end = 0;
- ushort max = 0;
+ uint max = 0;
barray *ba = NULL;
ba = barray_new( nmemb );