gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 03d73fe 011/113: Some minor corrections in cod


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 03d73fe 011/113: Some minor corrections in code and comments
Date: Fri, 16 Apr 2021 10:33:32 -0400 (EDT)

branch: master
commit 03d73fe639ccd24ab8f78e04936e09fe27905288
Author: Mohammad Akhlaghi <akhlaghi@gnu.org>
Commit: Mohammad Akhlaghi <akhlaghi@gnu.org>

    Some minor corrections in code and comments
    
    The comments above the column counters of `bin/mkprof/ui.c' still referred
    to the inverse order of linked lists. This was for a time when we would
    directly start reading the list. But now, we use `gal_list_str_reverse'
    after setting the column names, so this comment was obsolete and would only
    confuse the code readers. Also, the `coordcounter' variable is no longer
    used, so it was removed.
    
    Finally, in `README', I noticed that we were missing a `:' after
    BuildProgram! This has been added.
---
 README          |  2 +-
 bin/mkprof/ui.c | 14 ++++----------
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/README b/README
index 7f8d3b7..5d52a6b 100644
--- a/README
+++ b/README
@@ -37,7 +37,7 @@ context under categories/chapters.
     and growing set of arithmetic, mathematical, and even statistical
     operators (for example +, -, *, /, sqrt, log, min, average, median).
 
-  - BuildProgram (astbuildprog) Compile, link and run programs that depend
+  - BuildProgram (astbuildprog): Compile, link and run programs that depend
     on the Gnuastro library. BuildProgram will automatically link with the
     libraries that Gnuastro depends on, so there is no need to explicily
     mention them every time you are compiling a Gnuastro library dependent
diff --git a/bin/mkprof/ui.c b/bin/mkprof/ui.c
index 6138fe7..43b3ef0 100644
--- a/bin/mkprof/ui.c
+++ b/bin/mkprof/ui.c
@@ -698,9 +698,9 @@ static void
 ui_read_cols_2d(struct mkprofparams *p)
 {
   int checkblank;
+  size_t i, counter=0;
   char *colname=NULL, **strarr;
   gal_list_str_t *colstrs=NULL, *ccol;
-  size_t i, counter=0, coordcounter=0;
   gal_data_t *cols, *tmp, *corrtype=NULL;
 
   /* The coordinate columns are a linked list of strings. */
@@ -741,14 +741,11 @@ ui_read_cols_2d(struct mkprofparams *p)
          turned off for some columns. */
       checkblank=1;
 
-      /* Note that the input was a linked list, so the output order is the
-         inverse of the input order. For the position, we will store the
-         values into the `x' and `y' arrays even if they are RA/Dec. */
+      /* See which column we are currently reading. */
       switch(++counter)
         {
         case 1:
         case 2:
-          ++coordcounter;
           colname = ( counter==1
                       ? "first coordinate column (`--coordcol')"
                       : "second coordinate column (`--coordcol')" );
@@ -899,9 +896,9 @@ static void
 ui_read_cols_3d(struct mkprofparams *p)
 {
   int checkblank;
+  size_t i, counter=0;
   char *colname=NULL, **strarr;
   gal_list_str_t *colstrs=NULL, *ccol;
-  size_t i, counter=0, coordcounter=0;
   gal_data_t *cols, *tmp, *corrtype=NULL;
 
   /* The 3D-specific columns are not mandatory in `args.h', so we need to
@@ -952,15 +949,12 @@ ui_read_cols_3d(struct mkprofparams *p)
          turned off for some columns. */
       checkblank=1;
 
-      /* Note that the input was a linked list, so the output order is the
-         inverse of the input order. For the position, we will store the
-         values into the `x' and `y' arrays even if they are RA/Dec. */
+      /* See which column we are currently reading. */
       switch(++counter)
         {
         case 1:
         case 2:
         case 3:
-          ++coordcounter;
           colname = ( counter==1
                       ? "first coordinate column (`--coordcol')"
                       : ( counter==2



reply via email to

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