gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 10fdd62 2/3: Simple for loop replaced with whi


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 10fdd62 2/3: Simple for loop replaced with while
Date: Mon, 20 Nov 2017 05:29:00 -0500 (EST)

branch: master
commit 10fdd62f386df459aafdb84aec2cb5be5c7551ec
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    Simple for loop replaced with while
    
    When looking at the type of the WCS coordinates in MakeCatalog, we need to
    parse over the input type values. To do that, we just need to loop until we
    reach the end of the line or a `-' character. This was implemented as a
    `for' loop.
    
    But Raúl Infante Sainz informed me of the following compiler warning while
    building Gnuastro on his system: "explicitly assigning value of variable of
    type `char *' to itself". In general, a for loop is not designed for such
    parsings. So with this commit, we now do this with a while loop which will
    also remove this warning.
---
 bin/mkcatalog/ui.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/mkcatalog/ui.c b/bin/mkcatalog/ui.c
index 8c57145..2a8a690 100644
--- a/bin/mkcatalog/ui.c
+++ b/bin/mkcatalog/ui.c
@@ -347,7 +347,7 @@ ui_wcs_info(struct mkcatalogparams *p)
              or where there is a dash. So we can just replace it with an
              end-of-string character. */
           gal_checkset_allocate_copy(p->input->wcs->ctype[i], &p->ctype[i]);
-          for(c=p->ctype[i]; *c!='\0' && *c!='-'; ++c) c=c;
+          c=p->ctype[i]; while(*c!='\0' && *c!='-') ++c;
           *c='\0';
         }
     }



reply via email to

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