From 9b3b27bbc88ef3b076918f8255dab4bd9ed4d08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szabolcs=20Horva=CC=81t?= Date: Mon, 18 Nov 2024 14:29:12 +0000 Subject: [PATCH] refactor: remove unneeded extern keywords --- include/plfit_sampling.h | 8 ++++---- src/hzeta.c | 12 ------------ 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/include/plfit_sampling.h b/include/plfit_sampling.h index ed89c2c..7003613 100644 --- a/include/plfit_sampling.h +++ b/include/plfit_sampling.h @@ -52,7 +52,7 @@ PLFIT_EXPORT double plfit_rbinom(double n, double p, plfit_mt_rng_t* rng); * * \return the sample or NaN if one of the parameters is invalid */ -PLFIT_EXPORT extern double plfit_rpareto(double xmin, double alpha, plfit_mt_rng_t* rng); +PLFIT_EXPORT double plfit_rpareto(double xmin, double alpha, plfit_mt_rng_t* rng); /** * Draws a given number of samples from a Pareto distribution with the given @@ -80,7 +80,7 @@ PLFIT_EXPORT int plfit_rpareto_array(double xmin, double alpha, size_t n, plfit_ * * \return the sample or NaN if one of the parameters is invalid */ -PLFIT_EXPORT extern double plfit_rzeta(long int xmin, double alpha, plfit_mt_rng_t* rng); +PLFIT_EXPORT double plfit_rzeta(long int xmin, double alpha, plfit_mt_rng_t* rng); /** * Draws a given number of samples from a zeta distribution with the given @@ -109,7 +109,7 @@ PLFIT_EXPORT int plfit_rzeta_array(long int xmin, double alpha, size_t n, plfit_ * \param rng the Mersenne Twister random number generator to use * \return the value drawn from the given uniform distribution. */ -PLFIT_EXPORT extern double plfit_runif(double lo, double hi, plfit_mt_rng_t* rng); +PLFIT_EXPORT double plfit_runif(double lo, double hi, plfit_mt_rng_t* rng); /** * Draws a sample from a uniform distribution over the [0; 1) interval. @@ -119,7 +119,7 @@ PLFIT_EXPORT extern double plfit_runif(double lo, double hi, plfit_mt_rng_t* rng * \param rng the Mersenne Twister random number generator to use * \return the value drawn from the given uniform distribution. */ -PLFIT_EXPORT extern double plfit_runif_01(plfit_mt_rng_t* rng); +PLFIT_EXPORT double plfit_runif_01(plfit_mt_rng_t* rng); /** * Random sampler using Walker's alias method. diff --git a/src/hzeta.c b/src/hzeta.c index e6564b2..6398bd1 100644 --- a/src/hzeta.c +++ b/src/hzeta.c @@ -188,7 +188,6 @@ double hsl_sf_hzeta_eulermaclaurin_series_majorantratios[HSL_SF_HZETA_EULERMACLA NAN}; // hsl_sf_hzeta_eulermaclaurin_series_majorantratios -extern int hsl_sf_hzeta_e(const double s, const double q, gsl_sf_result * result) { /* CHECK_POINTER(result) */ @@ -263,11 +262,9 @@ int hsl_sf_hzeta_e(const double s, const double q, gsl_sf_result * result) { } -extern double hsl_sf_hzeta(const double s, const double q) { HSL_SF_EVAL_RESULT(hsl_sf_hzeta_e(s,q,&result)); } -extern int hsl_sf_hzeta_deriv_e(const double s, const double q, gsl_sf_result * result) { /* CHECK_POINTER(result) */ @@ -328,11 +325,9 @@ int hsl_sf_hzeta_deriv_e(const double s, const double q, gsl_sf_result * result) } -extern double hsl_sf_hzeta_deriv(const double s, const double q) { HSL_SF_EVAL_RESULT(hsl_sf_hzeta_deriv_e(s,q,&result)); } -extern int hsl_sf_hzeta_deriv2_e(const double s, const double q, gsl_sf_result * result) { /* CHECK_POINTER(result) */ @@ -406,7 +401,6 @@ int hsl_sf_hzeta_deriv2_e(const double s, const double q, gsl_sf_result * result } -extern double hsl_sf_hzeta_deriv2(const double s, const double q) { HSL_SF_EVAL_RESULT(hsl_sf_hzeta_deriv2_e(s,q,&result)); } @@ -587,7 +581,6 @@ int hsl_sf_hZeta1(const double s, const double q, const double ln_q, double * va return (PLFIT_SUCCESS); } -extern int hsl_sf_lnhzeta_deriv_tuple_e(const double s, const double q, gsl_sf_result * result, gsl_sf_result * result_deriv) { /* CHECK_POINTER(result) */ @@ -648,23 +641,18 @@ int hsl_sf_lnhzeta_deriv_tuple_e(const double s, const double q, gsl_sf_result * return (PLFIT_SUCCESS); } -extern double hsl_sf_lnhzeta_deriv_tuple(const double s, const double q, double * tuple0, double * tuple1) { HSL_SF_EVAL_TUPLE_RESULT(hsl_sf_lnhzeta_deriv_tuple_e(s,q,&result0,&result1)); } -extern int hsl_sf_lnhzeta_e(const double s, const double q, gsl_sf_result * result) { return (hsl_sf_lnhzeta_deriv_tuple_e(s,q,result,NULL)); } -extern double hsl_sf_lnhzeta(const double s, const double q) { HSL_SF_EVAL_RESULT(hsl_sf_lnhzeta_e(s,q,&result)); } -extern int hsl_sf_lnhzeta_deriv_e(const double s, const double q, gsl_sf_result * result) { return (hsl_sf_lnhzeta_deriv_tuple_e(s,q,NULL,result)); } -extern double hsl_sf_lnhzeta_deriv(const double s, const double q) { HSL_SF_EVAL_RESULT(hsl_sf_lnhzeta_deriv_e(s,q,&result)); }