[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 1d8a5cd 2/2: Compiler warnings corrected
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 1d8a5cd 2/2: Compiler warnings corrected |
Date: |
Fri, 2 Oct 2020 19:29:04 -0400 (EDT) |
branch: master
commit 1d8a5cd985abf52afa6699e540913aa5f4ebfe20
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Compiler warnings corrected
In the last few commits, a few points had slipped through my fingers which
are now corrected. One was a simple non-realistic "may be used
uninitialized" warning, but another was a good point regarding the new
minimum value's positions, in one case, we were mistakenly checking the
wrong column.
---
bin/mkcatalog/parse.c | 6 +++---
lib/wcs.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/bin/mkcatalog/parse.c b/bin/mkcatalog/parse.c
index 66b9ab3..f1ea95c 100644
--- a/bin/mkcatalog/parse.c
+++ b/bin/mkcatalog/parse.c
@@ -594,11 +594,11 @@ parse_objects(struct mkcatalog_passparams *pp)
{ minima_v[0] = *V; minima_c[0] = c[ ndim-1 ]; }
if( oif[ OCOL_MAXVX ] && *V>maxima_v[0] )
{ maxima_v[0] = *V; maxima_c[0] = c[ ndim-1 ]; }
- if( oif[ OCOL_MINVY ] && *V<minima_v[2] )
+ if( oif[ OCOL_MINVY ] && *V<minima_v[1] )
{ minima_v[1] = *V; minima_c[1] = c[ ndim-2 ]; }
if( oif[ OCOL_MAXVY ] && *V>maxima_v[1] )
{ maxima_v[1] = *V; maxima_c[1] = c[ ndim-2 ]; }
- if( oif[ OCOL_MINVZ ] && *V<minima_v[3] )
+ if( oif[ OCOL_MINVZ ] && *V<minima_v[2] )
{ minima_v[2] = *V; minima_c[2] = c[ ndim-3 ]; }
if( oif[ OCOL_MAXVZ ] && *V>maxima_v[2] )
{ maxima_v[2] = *V; maxima_c[2] = c[ ndim-3 ]; }
@@ -983,7 +983,7 @@ parse_clumps(struct mkcatalog_passparams *pp)
if( cif[ CCOL_MINVZ ] && *V<minima_v[ cind*ndim+2 ] )
{ minima_v[ cind*ndim+2 ] = *V;
minima_c[ cind*ndim+2 ] = c[ ndim-3 ]; }
- if( cif[ CCOL_MAXVZ ] && *V>maxima_v[ cind*ndim+0 ] )
+ if( cif[ CCOL_MAXVZ ] && *V>maxima_v[ cind*ndim+2 ] )
{ maxima_v[ cind*ndim+2 ] = *V;
maxima_c[ cind*ndim+2 ] = c[ ndim-3 ]; }
diff --git a/lib/wcs.c b/lib/wcs.c
index ef4e79d..ebb8ff3 100644
--- a/lib/wcs.c
+++ b/lib/wcs.c
@@ -1443,7 +1443,7 @@ gal_wcs_coverage(char *filename, char *hdu, size_t *ondim,
char *name=NULL, *unit=NULL;
gal_data_t *tmp, *coords=NULL;
size_t i, ndim, *dsize=NULL, numrows;
- double *x, *y, *z, *min, *max, *center, *width;
+ double *x=NULL, *y=NULL, *z=NULL, *min, *max, *center, *width;
/* Read the desired WCS. */
wcs=gal_wcs_read(filename, hdu, 0, 0, &nwcs);