3/3 of old-style casting
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_wham.cpp
index 6ca704eb3a63426b6e8ced607a7d9cc93969f93f..01606649bcdfb5068b2f934eccb73792ab148a8c 100644 (file)
@@ -1548,26 +1548,6 @@ static void print_histograms(const char *fnhist, t_UmbrellaWindow * window, int
     sfree(fn);
 }
 
-//! Used for qsort to sort random numbers
-static int func_wham_is_larger(const void *a, const void *b)
-{
-    double *aa, *bb;
-    aa = (double*)a;
-    bb = (double*)b;
-    if (*aa < *bb)
-    {
-        return -1;
-    }
-    else if (*aa > *bb)
-    {
-        return 1;
-    }
-    else
-    {
-        return 0;
-    }
-}
-
 //! Make random weights for histograms for the Bayesian bootstrap of complete histograms)
 static void setRandomBsWeights(t_UmbrellaWindow *synthwin, int nAllPull, t_UmbrellaOptions *opt)
 {
@@ -1582,7 +1562,7 @@ static void setRandomBsWeights(t_UmbrellaWindow *synthwin, int nAllPull, t_Umbre
     {
         r[i] = dist(opt->rng);
     }
-    qsort((void *)r, nAllPull-1, sizeof(double), &func_wham_is_larger);
+    std::sort(r, r+nAllPull-1);
     r[nAllPull-1] = 1.0*nAllPull;
 
     synthwin[0].bsWeight[0] = r[0];