gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 0487ba5 14/14: Initializing delta and dist arr


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 0487ba5 14/14: Initializing delta and dist arrays in match library
Date: Sun, 17 Dec 2017 11:31:20 -0500 (EST)

branch: master
commit 0487ba554e5998e8ff3a653234650d6e5e0b824a
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    Initializing delta and dist arrays in match library
    
    Alan Lefor reported that his compiler would give an "uninitialized" warning
    for the `delta' array in the matching library. Therefore the values of this
    array (and `dist') are initialized to NaN.
---
 lib/match.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/match.c b/lib/match.c
index 22401f1..92003ac 100644
--- a/lib/match.c
+++ b/lib/match.c
@@ -355,11 +355,11 @@ match_coordinates_second_in_first(gal_data_t *A, 
gal_data_t *B,
      redundant variables (those that equal a previous value) are only
      defined to make it easy to read the code.*/
   int iscircle=0;
-  double delta[2];
-  double r, c=NAN, s=NAN, dist[2];
+  double r, c=NAN, s=NAN;
   size_t i, ar=A->size, br=B->size;
   size_t ai, bi, blow=0, prevblow=0;
   size_t ndim=gal_list_data_number(A);
+  double dist[2]={NAN,NAN}, delta[2]={NAN,NAN};
   double *a[2]={A->array, A->next ? A->next->array : NULL};
   double *b[2]={B->array, B->next ? B->next->array : NULL};
 



reply via email to

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