gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 4fef935 3/3: gal_statistics_is_sorted: Initial


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 4fef935 3/3: gal_statistics_is_sorted: Initialize to avoid compiler warning
Date: Mon, 11 Mar 2019 16:54:24 -0400 (EDT)

branch: master
commit 4fef93589852c146b52f0e1a90a37f3b788f5d48
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    gal_statistics_is_sorted: Initialize to avoid compiler warning
    
    After testing the previous two commits on another system, I saw a "maybe
    used uninitialized" compilation warning in this function. With this commit,
    it is being initialized to an absurd value (to be easily noticable). But it
    should never happen because we do put checks in multiple places.
---
 lib/statistics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/statistics.c b/lib/statistics.c
index 685d73c..bbf1c56 100644
--- a/lib/statistics.c
+++ b/lib/statistics.c
@@ -1186,7 +1186,7 @@ enum is_sorted_return
 int
 gal_statistics_is_sorted(gal_data_t *input, int updateflags)
 {
-  int out;
+  int out=GAL_BLANK_INT16; /* On some systems, int may be 16-bits wide. */
 
   /* If the flags are already set, don't bother going over the dataset. */
   if( input->flag & GAL_DATA_FLAG_SORT_CH )



reply via email to

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