ECC-1367: C API: codes_get_double_elements: The 'index_array' argument should be 'const'

This commit is contained in:
Shahram Najm 2022-03-09 19:33:52 +00:00
parent d5cd7960c7
commit 86f5e6ef16
5 changed files with 8 additions and 8 deletions

View File

@ -341,9 +341,9 @@ int codes_get_double_element(const grib_handle* h, const char* key, int i, doubl
{
return grib_get_double_element(h, key, i, value);
}
int codes_get_double_elements(const grib_handle* h, const char* key, int* i, long size, double* value)
int codes_get_double_elements(const grib_handle* h, const char* key, const int* index_array, long size, double* value)
{
return grib_get_double_elements(h, key, i, size, value);
return grib_get_double_elements(h, key, index_array, size, value);
}
int codes_get_string(const grib_handle* h, const char* key, char* mesg, size_t* length)
{

View File

@ -783,12 +783,12 @@ int codes_get_double_element(const codes_handle* h, const char* key, int i, doub
*
* @param h : the handle to get the data from
* @param key : the key to be searched
* @param i : zero-based array of indexes
* @param index_array : zero-based array of indexes
* @param size : size of the i and value arrays
* @param value : the double array for the data values
* @return 0 if OK, integer value on error
*/
int codes_get_double_elements(const codes_handle* h, const char* key, int* i, long size, double* value);
int codes_get_double_elements(const codes_handle* h, const char* key, const int* index_array, long size, double* value);
/**
* Get a string value from a key, if several keys of the same name are present, the last one is returned

View File

@ -809,12 +809,12 @@ int grib_get_double_element(const grib_handle* h, const char* key, int i, double
*
* @param h : the handle to get the data from
* @param key : the key to be searched
* @param i : zero-based array of indexes
* @param index_array : zero-based array of indexes
* @param size : size of the i and value arrays
* @param value : the double array for the data values
* @return 0 if OK, integer value on error
*/
int grib_get_double_elements(const grib_handle* h, const char* key, int* i, long size, double* value);
int grib_get_double_elements(const grib_handle* h, const char* key, const int* index_array, long size, double* value);
/**
* Get a string value from a key, if several keys of the same name are present, the last one is returned

View File

@ -1239,7 +1239,7 @@ int grib_get_double(const grib_handle* h, const char* name, double* val);
int grib_get_double_element_internal(grib_handle* h, const char* name, int i, double* val);
int grib_get_double_element(const grib_handle* h, const char* name, int i, double* val);
int grib_points_get_values(grib_handle* h, grib_points* points, double* val);
int grib_get_double_elements(const grib_handle* h, const char* name, int* index_array, long len, double* val_array);
int grib_get_double_elements(const grib_handle* h, const char* name, const int* index_array, long len, double* val_array);
int grib_get_string_internal(grib_handle* h, const char* name, char* val, size_t* length);
int grib_get_string(const grib_handle* h, const char* name, char* val, size_t* length);
int grib_get_bytes_internal(const grib_handle* h, const char* name, unsigned char* val, size_t* length);

View File

@ -1040,7 +1040,7 @@ int grib_points_get_values(grib_handle* h, grib_points* points, double* val)
return GRIB_SUCCESS;
}
int grib_get_double_elements(const grib_handle* h, const char* name, int* index_array, long len, double* val_array)
int grib_get_double_elements(const grib_handle* h, const char* name, const int* index_array, long len, double* val_array)
{
double* values = 0;
int err = 0;