view src/of-fits-3-octave-9-compat.patch @ 6531:297b371a6713

of-fits: Fix compatibility with Octave 9. * src/of-fits-3-octave-9-compat.patch: Add patch that replaces functions that have been deprecated in Octave 7 and removed from Octave 9. * dist-files.mk: Add new file to list.
author Markus Mützel <markus.muetzel@gmx.de>
date Fri, 18 Nov 2022 18:06:40 +0100
parents
children
line wrap: on
line source

Replace "fortran_vec" on const objects with "data".
Casting away const is ok here. The pointers are only passed to functions that
don't modify the data afaict.

--- fits-1.0.7/src/save_fits_image.cc.orig	2022-11-17 11:09:21.875653000 +0100
+++ fits-1.0.7/src/save_fits_image.cc	2022-11-18 17:04:28.843175674 +0100
@@ -129,7 +129,7 @@
     return octave_value_list();
   }
 
-  double * datap = const_cast<double*>( image.fortran_vec() );
+  double * datap = const_cast<double *> ( image.data () );
   if( fits_write_img( fp, TDOUBLE, fpixel, len, datap , &status ) > 0 )
   {
     fprintf( stderr, "Could not write image data.\n" );

--- fits-1.0.7/src/save_fits_image_multi_ext.cc.orig	2022-11-17 11:09:21.875653000 +0100
+++ fits-1.0.7/src/save_fits_image_multi_ext.cc	2022-11-18 17:21:18.905761447 +0100
@@ -137,7 +137,7 @@
       fits_report_error( stderr, status );
       return octave_value_list();
     }
-    double * datap = const_cast<double*>( image.fortran_vec() );
+    double * datap = const_cast<double *> ( image.data () );
     if( fits_write_img( fp, TDOUBLE, fpixel, sz_axes[0]*sz_axes[1], datap + i*sz_axes[0]*sz_axes[1], &status ) > 0 )
     {
       fprintf( stderr, "Could not write image data.\n" );