1
1
use crate :: bindings as ll_bindings;
2
+ use crate :: sys;
2
3
use crate :: tsk_id_t;
3
4
use crate :: tsk_size_t;
4
5
use crate :: NodeId ;
@@ -297,15 +298,15 @@ impl TreeInterface {
297
298
fn left_sample < N : Into < NodeId > + Copy > ( & self , u : N ) -> Option < NodeId > {
298
299
// SAFETY: internal pointer cannot be NULL
299
300
let ptr = unsafe { * self . as_ptr ( ) } ;
300
- unsafe_tsk_column_access ! ( u. into( ) , 0 , self . num_nodes, ptr , left_sample , NodeId )
301
+ sys :: tsk_column_access :: < NodeId , _ , _ , _ > ( u. into ( ) , ptr . left_sample , self . num_nodes )
301
302
}
302
303
303
304
// error if we are not tracking samples,
304
305
// Ok(None) if u is out of range
305
306
fn right_sample < N : Into < NodeId > + Copy > ( & self , u : N ) -> Option < NodeId > {
306
307
// SAFETY: internal pointer cannot be NULL
307
308
let ptr = unsafe { * self . as_ptr ( ) } ;
308
- unsafe_tsk_column_access ! ( u. into( ) , 0 , self . num_nodes, ptr , right_sample , NodeId )
309
+ sys :: tsk_column_access :: < NodeId , _ , _ , _ > ( u. into ( ) , ptr . right_sample , self . num_nodes )
309
310
}
310
311
311
312
/// Return the `[left, right)` coordinates of the tree.
@@ -330,7 +331,7 @@ impl TreeInterface {
330
331
pub fn parent < N : Into < NodeId > + Copy > ( & self , u : N ) -> Option < NodeId > {
331
332
// SAFETY: internal pointer cannot be NULL
332
333
let ptr = unsafe { * self . as_ptr ( ) } ;
333
- unsafe_tsk_column_access ! ( u. into( ) , 0 , self . array_len, ptr , parent , NodeId )
334
+ sys :: tsk_column_access :: < NodeId , _ , _ , _ > ( u. into ( ) , ptr . parent , self . array_len )
334
335
}
335
336
336
337
/// Get the left child of node `u`.
@@ -339,7 +340,7 @@ impl TreeInterface {
339
340
pub fn left_child < N : Into < NodeId > + Copy > ( & self , u : N ) -> Option < NodeId > {
340
341
// SAFETY: internal pointer cannot be NULL
341
342
let ptr = unsafe { * self . as_ptr ( ) } ;
342
- unsafe_tsk_column_access ! ( u. into( ) , 0 , self . array_len, ptr , left_child , NodeId )
343
+ sys :: tsk_column_access :: < NodeId , _ , _ , _ > ( u. into ( ) , ptr . left_child , self . array_len )
343
344
}
344
345
345
346
/// Get the right child of node `u`.
@@ -348,7 +349,7 @@ impl TreeInterface {
348
349
pub fn right_child < N : Into < NodeId > + Copy > ( & self , u : N ) -> Option < NodeId > {
349
350
// SAFETY: internal pointer cannot be NULL
350
351
let ptr = unsafe { * self . as_ptr ( ) } ;
351
- unsafe_tsk_column_access ! ( u. into( ) , 0 , self . array_len, ptr , right_child , NodeId )
352
+ sys :: tsk_column_access :: < NodeId , _ , _ , _ > ( u. into ( ) , ptr . right_child , self . array_len )
352
353
}
353
354
354
355
/// Get the left sib of node `u`.
@@ -357,7 +358,7 @@ impl TreeInterface {
357
358
pub fn left_sib < N : Into < NodeId > + Copy > ( & self , u : N ) -> Option < NodeId > {
358
359
// SAFETY: internal pointer cannot be NULL
359
360
let ptr = unsafe { * self . as_ptr ( ) } ;
360
- unsafe_tsk_column_access ! ( u. into( ) , 0 , self . array_len, ptr , left_sib , NodeId )
361
+ sys :: tsk_column_access :: < NodeId , _ , _ , _ > ( u. into ( ) , ptr . left_sib , self . array_len )
361
362
}
362
363
363
364
/// Get the right sib of node `u`.
@@ -366,7 +367,7 @@ impl TreeInterface {
366
367
pub fn right_sib < N : Into < NodeId > + Copy > ( & self , u : N ) -> Option < NodeId > {
367
368
// SAFETY: internal pointer cannot be NULL
368
369
let ptr = unsafe { * self . as_ptr ( ) } ;
369
- unsafe_tsk_column_access ! ( u. into( ) , 0 , self . array_len, ptr , right_sib , NodeId )
370
+ sys :: tsk_column_access :: < NodeId , _ , _ , _ > ( u. into ( ) , ptr . right_sib , self . array_len )
370
371
}
371
372
372
373
/// Obtain the list of samples for the current tree/tree sequence
0 commit comments