changeset 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 8ea9085d1f80
children 74666bb9cc46
files dist-files.mk src/of-fits-3-octave-9-compat.patch
diffstat 2 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dist-files.mk	Thu Nov 17 10:40:12 2022 +0100
+++ b/dist-files.mk	Fri Nov 18 18:06:40 2022 +0100
@@ -485,6 +485,7 @@
   of-financial.mk \
   of-fits-1-cross-fixes.patch \
   of-fits-2-fixes.patch \
+  of-fits-3-octave-9-compat.patch \
   of-fits.mk \
   of-fl-core-1-fixes.patch \
   of-fl-core.mk \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/of-fits-3-octave-9-compat.patch	Fri Nov 18 18:06:40 2022 +0100
@@ -0,0 +1,27 @@
+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" );