cppcheck: Const correctness

This commit is contained in:
Shahram Najm 2022-06-03 13:02:32 +01:00
parent 9d07ddb3ab
commit 7c471813ea
5 changed files with 6 additions and 6 deletions

View File

@ -1219,7 +1219,7 @@ int grib_set_missing_internal(grib_handle* h, const char* name);
int grib_set_missing(grib_handle* h, const char* name);
int grib_is_missing_long(grib_accessor* a, long x);
int grib_is_missing_double(grib_accessor* a, double x);
int grib_is_missing_string(grib_accessor* a, unsigned char* x, size_t len);
int grib_is_missing_string(grib_accessor* a, const unsigned char* x, size_t len);
int grib_accessor_is_missing(grib_accessor* a, int* err);
int grib_is_missing(const grib_handle* h, const char* name, int* err);
int grib_is_defined(const grib_handle* h, const char* name);
@ -1337,7 +1337,7 @@ int grib_nearest_find(grib_nearest* nearest, const grib_handle* h, double inlat,
int grib_nearest_init(grib_nearest* i, grib_handle* h, grib_arguments* args);
int grib_nearest_delete(grib_nearest* i);
int grib_nearest_get_radius(grib_handle* h, double* radiusInKm);
void grib_binary_search(double xx[], const unsigned long n, double x, int* ju, int* jl);
void grib_binary_search(const double xx[], const unsigned long n, double x, int* ju, int* jl);
int grib_nearest_find_multiple(const grib_handle* h, int is_lsm, const double* inlats, const double* inlons, long npoints, double* outlats, double* outlons, double* values, double* distances, int* indexes);
int grib_nearest_find_generic(grib_nearest* nearest, grib_handle* h, double inlat, double inlon, unsigned long flags,
const char* values_keyname, const char* Ni_keyname, const char* Nj_keyname,

View File

@ -128,7 +128,7 @@ int grib_nearest_get_radius(grib_handle* h, double* radiusInKm)
return GRIB_SUCCESS;
}
void grib_binary_search(double xx[], const unsigned long n, double x,
void grib_binary_search(const double xx[], const unsigned long n, double x,
int* ju, int* jl)
{
size_t jm = 0;

View File

@ -364,7 +364,7 @@ static int condition_true(grib_accessor* a, codes_condition* condition)
return ret;
}
static void search_from_accessors_list(grib_accessors_list* al, grib_accessors_list* end, const char* name, grib_accessors_list* result)
static void search_from_accessors_list(grib_accessors_list* al, const grib_accessors_list* end, const char* name, grib_accessors_list* result)
{
char attribute_name[200] = {0,};
grib_accessor* accessor_result = 0;

View File

@ -19,7 +19,7 @@ typedef enum
eROUND_ANGLE_DOWN
} RoundingPolicy;
static void set_total_length(unsigned char* buffer, long* section_length, long* section_offset, int edition, size_t totalLength)
static void set_total_length(unsigned char* buffer, long* section_length, const long* section_offset, int edition, size_t totalLength)
{
long off;
switch (edition) {

View File

@ -604,7 +604,7 @@ int grib_is_missing_double(grib_accessor* a, double x)
return ret;
}
int grib_is_missing_string(grib_accessor* a, unsigned char* x, size_t len)
int grib_is_missing_string(grib_accessor* a, const unsigned char* x, size_t len)
{
/* For a string value to be missing, every character has to be */
/* all 1's (i.e. 0xFF) */