]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_c/Maasha/src/repeat-O-matic.c
unit test of mem.c done
[biopieces.git] / code_c / Maasha / src / repeat-O-matic.c
index 6e7908a13a4c2a13ab88d611608bf83c7b2381b6..3c6f3406799381014e7a5c420a8a1dc2851d19d5 100644 (file)
@@ -68,7 +68,7 @@ uint *oligo_count( char *path )
 
     mask  = mask_create( OLIGO_SIZE );
 
-    MEM_GET( entry );
+    entry = mem_get( sizeof( entry ) );
 
     fp = read_open( path );
 
@@ -163,11 +163,12 @@ void oligo_count_output( char *path, uint *array )
     uint             *block;
     uint              block_pos;
     uint              block_beg;
+    uint              block_size;
     uint              chr_pos;
 
     mask = mask_create( OLIGO_SIZE );
 
-    MEM_GET( entry );
+    entry = mem_get( sizeof( entry ) );
 
     fp = read_open( path );
 
@@ -175,10 +176,11 @@ void oligo_count_output( char *path, uint *array )
     {
         fprintf( stderr, "Writing results for: %s ... ", entry->seq_name );
 
-        bin       = 0;
-        j         = 0;
-        block_pos = 0;
-        block     = mem_get_zero( sizeof( uint ) * ( entry->seq_len + OLIGO_SIZE ) );
+        bin        = 0;
+        j          = 0;
+        block_pos  = 0;
+        block_size = sizeof( uint ) * ( entry->seq_len + OLIGO_SIZE );
+        block      = mem_get_zero( block_size );
 
         for ( i = 0; entry->seq[ i ]; i++ )
         {
@@ -203,7 +205,7 @@ void oligo_count_output( char *path, uint *array )
 
                     if ( block_pos == 0 )
                     {
-                        MEM_ZERO( block );
+                        memset( block, '\0', block_size );
 
                         block_beg = chr_pos;
 
@@ -234,7 +236,7 @@ void oligo_count_output( char *path, uint *array )
         {
             fixedstep_put_entry( entry->seq_name, block_beg, 1, block, block_pos );
 
-            mem_free( block );
+            mem_free( ( void * ) &block );
         }
 
         fprintf( stderr, "done.\n" );