From a5f44eebcaa08a3e73ecb1d1c7200642a2137e08 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 6 Nov 2021 19:33:00 +0000 Subject: [PATCH] Cppcheck warnings: Const correctness --- src/grib_ibmfloat.c | 2 +- src/grib_ieeefloat.c | 2 +- src/grib_iterator_class_gaussian.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/grib_ibmfloat.c b/src/grib_ibmfloat.c index fd62861e9..1b11ed3bf 100644 --- a/src/grib_ibmfloat.c +++ b/src/grib_ibmfloat.c @@ -89,7 +89,7 @@ static void init_table_if_needed() GRIB_MUTEX_UNLOCK(&mutex) } -static void binary_search(double xx[], const unsigned long n, double x, unsigned long* j) +static void binary_search(const double xx[], const unsigned long n, double x, unsigned long* j) { /*These routine works only on ascending ordered arrays*/ unsigned long ju, jm, jl; diff --git a/src/grib_ieeefloat.c b/src/grib_ieeefloat.c index d7b713a24..82f20349f 100644 --- a/src/grib_ieeefloat.c +++ b/src/grib_ieeefloat.c @@ -95,7 +95,7 @@ static void init_table_if_needed() GRIB_MUTEX_UNLOCK(&mutex) } -static void binary_search(double xx[], const unsigned long n, double x, unsigned long* j) +static void binary_search(const double xx[], const unsigned long n, double x, unsigned long* j) { /*These routine works only on ascending ordered arrays*/ unsigned long ju, jm, jl; diff --git a/src/grib_iterator_class_gaussian.c b/src/grib_iterator_class_gaussian.c index 06fb66f8f..d0f659ceb 100644 --- a/src/grib_iterator_class_gaussian.c +++ b/src/grib_iterator_class_gaussian.c @@ -91,7 +91,7 @@ static void init_class(grib_iterator_class* c) } /* END_CLASS_IMP */ -static void binary_search(double xx[], const unsigned long n, double x, unsigned long* j); +static void binary_search(const double xx[], const unsigned long n, double x, unsigned long* j); static int init(grib_iterator* i, grib_handle* h, grib_arguments* args) { @@ -164,7 +164,7 @@ static int init(grib_iterator* i, grib_handle* h, grib_arguments* args) return ret; } -static void binary_search(double xx[], const unsigned long n, double x, unsigned long* j) +static void binary_search(const double xx[], const unsigned long n, double x, unsigned long* j) { /*This routine works only on descending ordered arrays*/ #define EPSILON 1e-3