@@ -6,6 +6,7 @@ use defines::{ColorMap, MarkerType};
6
6
use error:: HANDLE_ERROR ;
7
7
use self :: libc:: { c_int, c_uint, c_float, c_double, c_char} ;
8
8
use std:: ffi:: CString ;
9
+ use std:: ptr;
9
10
10
11
type MutWndHandle = * mut self :: libc:: c_ulonglong ;
11
12
type WndHandle = self :: libc:: c_ulonglong ;
@@ -284,7 +285,7 @@ impl Window {
284
285
/// - `ylabel` is y axis title
285
286
/// - `zlabel` is z axis title
286
287
pub fn set_axes_titles ( & mut self , xlabel : String , ylabel : String , zlabel : String ) {
287
- let cprops = & Cell { row : self . row , col : self . col , title : [ 0 ] . as_ptr ( ) , cmap : self . cmap } ;
288
+ let cprops = & Cell { row : self . row , col : self . col , title : ptr :: null ( ) , cmap : self . cmap } ;
288
289
let xstr = CString :: new ( xlabel) . unwrap ( ) ;
289
290
let ystr = CString :: new ( ylabel) . unwrap ( ) ;
290
291
let zstr = CString :: new ( zlabel) . unwrap ( ) ;
@@ -314,7 +315,7 @@ impl Window {
314
315
/// to next power of 2 and the magnitude remains the same.
315
316
pub fn set_axes_limits_compute ( & mut self , xrange : & Array , yrange : & Array ,
316
317
zrange : Option < & Array > , exact : bool ) {
317
- let cprops = & Cell { row : self . row , col : self . col , title : [ 0 ] . as_ptr ( ) , cmap : self . cmap } ;
318
+ let cprops = & Cell { row : self . row , col : self . col , title : ptr :: null ( ) , cmap : self . cmap } ;
318
319
unsafe {
319
320
let err_val = af_set_axes_limits_compute ( self . handle as WndHandle ,
320
321
xrange. get ( ) as AfArray ,
@@ -343,7 +344,7 @@ impl Window {
343
344
/// are to extracted. If exact is false then the most significant digit is rounded up
344
345
/// to next power of 2 and the magnitude remains the same.
345
346
pub fn set_axes_limits_2d ( & mut self , xmin : f32 , xmax : f32 , ymin : f32 , ymax : f32 , exact : bool ) {
346
- let cprops = & Cell { row : self . row , col : self . col , title : [ 0 ] . as_ptr ( ) , cmap : self . cmap } ;
347
+ let cprops = & Cell { row : self . row , col : self . col , title : ptr :: null ( ) , cmap : self . cmap } ;
347
348
unsafe {
348
349
let err_val = af_set_axes_limits_2d ( self . handle as WndHandle , xmin as c_float ,
349
350
xmax as c_float , ymin as c_float , ymax as c_float ,
@@ -370,7 +371,7 @@ impl Window {
370
371
/// to next power of 2 and the magnitude remains the same.
371
372
pub fn set_axes_limits_3d ( & mut self , xmin : f32 , xmax : f32 , ymin : f32 , ymax : f32 ,
372
373
zmin : f32 , zmax : f32 , exact : bool ) {
373
- let cprops = & Cell { row : self . row , col : self . col , title : [ 0 ] . as_ptr ( ) , cmap : self . cmap } ;
374
+ let cprops = & Cell { row : self . row , col : self . col , title : ptr :: null ( ) , cmap : self . cmap } ;
374
375
unsafe {
375
376
let err_val = af_set_axes_limits_3d ( self . handle as WndHandle , xmin as c_float ,
376
377
xmax as c_float , ymin as c_float , ymax as c_float ,
0 commit comments