]> git.donarmstrong.com Git - biopieces.git/commitdiff
changed barray from ushort to uint
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Fri, 5 Dec 2008 05:25:24 +0000 (05:25 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Fri, 5 Dec 2008 05:25:24 +0000 (05:25 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@334 74ccb610-7750-0410-82ae-013aeee3265d

code_c/Maasha/src/bed2fixedstep.c
code_c/Maasha/src/bed2tag_contigs.c
code_c/Maasha/src/inc/barray.h
code_c/Maasha/src/lib/barray.c
code_c/Maasha/src/test/test_barray.c

index 3b797eade6044575746599c274a9ca3046965a67..bde5142b18c9592ee708a5dfe4d67d1a2de4d1fa 100644 (file)
@@ -50,7 +50,7 @@ int main( int argc, char *argv[] )
     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;
@@ -78,7 +78,7 @@ int main( int argc, char *argv[] )
             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 );
     }
index 265eb11bc4dcfc25ab12d1b114934a997143a373..38fd25cb67aae7f430738ba80178b88c2f8611a6 100644 (file)
@@ -70,13 +70,13 @@ int main( int argc, char *argv[] )
     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 );
@@ -99,10 +99,10 @@ int main( int argc, char *argv[] )
             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 ) );
         }
     }
 
index 42e7ee63abe3e8bedb11e0f9b6c3614044667aa2..09b755ee1e15c1fd517c91956d090a82f70e953a 100644 (file)
@@ -6,7 +6,7 @@
 
 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. */
 };
@@ -32,14 +32,14 @@ void barray_print( barray *ba );
 
 /* 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 );
index 474e56ddff0874f426d58e5b292f81dcce800d50..e23962c018ee04c0ce3aa7855616cbfb6708161b 100644 (file)
@@ -51,7 +51,7 @@ void barray_resize( barray *ba, size_t nmemb_new )
     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;
 }
 
@@ -72,7 +72,7 @@ void barray_print( barray *ba )
 }
 
 
-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. */
 
@@ -139,14 +139,14 @@ bool barray_interval_scan( barray *ba, size_t *pos_pt, size_t *beg_pt, size_t *e
 }
 
 
-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 ] );
index c7d26081685fc67407373bf1de5480da61278a61..913a0fb8c41231c88857bb3539d07d98af63deda 100644 (file)
@@ -155,7 +155,7 @@ void test_barray_interval_max()
     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 );