gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 9aebb0f: Fits: corrected compiler warning


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 9aebb0f: Fits: corrected compiler warning
Date: Sat, 12 Sep 2020 17:46:45 -0400 (EDT)

branch: master
commit 9aebb0f281a5481dd336619de2226788d574cb91
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Fits: corrected compiler warning
    
    Samane Raji reported the 'ndim' variable was causing a "may be used
    uninitialized in this function" compiler warning. Although within the
    high-level logic we know this never happens, and newer compilers can tell,
    but its better to just initialize it to zero.
---
 bin/fits/fits.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/fits/fits.c b/bin/fits/fits.c
index 790fdd4..14ce188 100644
--- a/bin/fits/fits.c
+++ b/bin/fits/fits.c
@@ -305,10 +305,10 @@ fits_datasum(struct fitsparams *p)
 static void
 fits_pixelscale(struct fitsparams *p)
 {
-  size_t i, ndim;
+  int nwcs=0;
+  size_t i, ndim=0;
   double *pixelscale;
   struct wcsprm *wcs;
-  int nwcs=0;
 
   /* Read the desired WCS. */
   wcs=gal_wcs_read(p->filename, p->cp.hdu, 0, 0, &nwcs);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]