Merge branch release-2018 into release-2019
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_mindist.cpp
index f52ad6f4caafaf053ceb015f10286085de7ba38f..9ce1732513998f81d27c582046e1bf5767c00a1c 100644 (file)
@@ -64,7 +64,7 @@
 
 
 static void periodic_dist(int ePBC,
-                          matrix box, rvec x[], int n, int index[],
+                          matrix box, rvec x[], int n, const int index[],
                           real *rmin, real *rmax, int *min_ind)
 {
 #define NSHIFT_MAX 26
@@ -86,7 +86,6 @@ static void periodic_dist(int ePBC,
     {
         gmx_fatal(FARGS, "pbc = %s is not supported by g_mindist",
                   epbc_names[ePBC]);
-        nsz = 0; /* Keep compilers quiet */
     }
 
     nshift = 0;
@@ -369,10 +368,10 @@ static void dist_plot(const char *fn, const char *afile, const char *dfile,
             snew(leg, 1);
             sprintf(buf, "Internal in %s", grpn[0]);
             leg[0] = gmx_strdup(buf);
-            xvgr_legend(dist, 0, (const char**)leg, oenv);
+            xvgr_legend(dist, 0, leg, oenv);
             if (num)
             {
-                xvgr_legend(num, 0, (const char**)leg, oenv);
+                xvgr_legend(num, 0, leg, oenv);
             }
         }
         else
@@ -386,10 +385,10 @@ static void dist_plot(const char *fn, const char *afile, const char *dfile,
                     leg[j] = gmx_strdup(buf);
                 }
             }
-            xvgr_legend(dist, j, (const char**)leg, oenv);
+            xvgr_legend(dist, j, leg, oenv);
             if (num)
             {
-                xvgr_legend(num, j, (const char**)leg, oenv);
+                xvgr_legend(num, j, leg, oenv);
             }
         }
     }
@@ -401,10 +400,10 @@ static void dist_plot(const char *fn, const char *afile, const char *dfile,
             sprintf(buf, "%s-%s", grpn[0], grpn[i+1]);
             leg[i] = gmx_strdup(buf);
         }
-        xvgr_legend(dist, ng-1, (const char**)leg, oenv);
+        xvgr_legend(dist, ng-1, leg, oenv);
         if (num)
         {
-            xvgr_legend(num, ng-1, (const char**)leg, oenv);
+            xvgr_legend(num, ng-1, leg, oenv);
         }
     }
 
@@ -412,7 +411,7 @@ static void dist_plot(const char *fn, const char *afile, const char *dfile,
     {
         sprintf(buf, "%simum Distance", bMin ? "Min" : "Max");
         respertime = xvgropen(rfile, buf, output_env_get_time_label(oenv), "Distance (nm)", oenv);
-        xvgr_legend(respertime, ng-1, (const char**)leg, oenv);
+        xvgr_legend(respertime, ng-1, leg, oenv);
         if (bPrintResName && output_env_get_print_xvgr_codes(oenv) )
         {
             fprintf(respertime, "# ");
@@ -581,7 +580,7 @@ static void dist_plot(const char *fn, const char *afile, const char *dfile,
 
         sprintf(buf, "%simum Distance", bMin ? "Min" : "Max");
         res = xvgropen(rfile, buf, "Residue (#)", "Distance (nm)", oenv);
-        xvgr_legend(res, ng-1, (const char**)leg, oenv);
+        xvgr_legend(res, ng-1, leg, oenv);
         for (j = 0; j < nres; j++)
         {
             fprintf(res, "%4d", j+1);
@@ -597,7 +596,7 @@ static void dist_plot(const char *fn, const char *afile, const char *dfile,
     sfree(x0);
 }
 
-static int find_residues(const t_atoms *atoms, int n, int index[], int **resindex)
+static int find_residues(const t_atoms *atoms, int n, const int index[], int **resindex)
 {
     int  i;
     int  nres      = 0, resnr, presnr = 0;