@@ -62,14 +62,14 @@ FitsInput::open(const std::string& name, ImageSpec& spec)
6262 // checking if the file exists and can be opened in READ mode
6363 m_fd = Filesystem::fopen (m_filename, " rb" );
6464 if (!m_fd) {
65- errorf (" Could not open file \" %s \" " , m_filename);
65+ errorfmt (" Could not open file \" {} \" " , m_filename);
6666 return false ;
6767 }
6868
6969 // checking if the file is FITS file
7070 char magic[6 ] = { 0 };
7171 if (fread (magic, 1 , 6 , m_fd) != 6 || strncmp (magic, " SIMPLE" , 6 )) {
72- errorf ( " %s isn't a FITS file" , m_filename);
72+ errorfmt ( " {} isn't a FITS file" , m_filename);
7373 close ();
7474 return false ;
7575 }
@@ -105,10 +105,10 @@ FitsInput::read_native_scanline(int subimage, int miplevel, int y, int /*z*/,
105105 size_t n = fread (&data_tmp[0 ], 1 , m_spec.scanline_bytes (), m_fd);
106106 if (n != m_spec.scanline_bytes ()) {
107107 if (feof (m_fd))
108- errorf (" Hit end of file unexpectedly (offset=%d , scanline %d )" ,
109- ftell (m_fd), y);
108+ errorfmt (" Hit end of file unexpectedly (offset={} , scanline {} )" ,
109+ ftell (m_fd), y);
110110 else
111- errorf (" read error" );
111+ errorfmt (" read error" );
112112 return false ; // Read failed
113113 }
114114
@@ -215,9 +215,9 @@ FitsInput::read_fits_header(void)
215215 // we read whole header at once
216216 if (fread (&fits_header[0 ], 1 , HEADER_SIZE, m_fd) != HEADER_SIZE) {
217217 if (feof (m_fd))
218- errorf (" Hit end of file unexpectedly (offset=%d )" , ftell (m_fd));
218+ errorfmt (" Hit end of file unexpectedly (offset={} )" , ftell (m_fd));
219219 else
220- errorf (" read error" );
220+ errorfmt (" read error" );
221221 return false ; // Read failed
222222 }
223223
@@ -299,7 +299,7 @@ FitsInput::read_fits_header(void)
299299 --m_naxes;
300300 }
301301 if (m_naxes < 0 || m_naxes > 4 ) {
302- errorf (" Number of data axes %d not supported" , m_naxes);
302+ errorfmt (" Number of data axes {} not supported" , m_naxes);
303303 return false ;
304304 }
305305 m_spec.nchannels = 1 ;
@@ -329,7 +329,7 @@ FitsInput::read_fits_header(void)
329329 m_spec.height = m_naxis[2 ];
330330 m_spec.depth = m_naxis[3 ];
331331 } else {
332- errorf (" Don't know now to read %d -channel FITS image" , m_naxes);
332+ errorfmt (" Don't know now to read {} -channel FITS image" , m_naxes);
333333 return false ;
334334 }
335335 m_spec.full_width = m_spec.width ;
@@ -338,7 +338,7 @@ FitsInput::read_fits_header(void)
338338
339339 // if (m_spec.width < 1 || m_spec.height < 1 || m_spec.depth < 1 ||
340340 // m_spec.nchannels < 1) {
341- // errorf ("Don't know now to read empty (0 pixel) FITS image");
341+ // errorfmt ("Don't know now to read empty (0 pixel) FITS image");
342342 // return false;
343343 // }
344344
0 commit comments