Const correctness

This commit is contained in:
Shahram Najm 2021-06-10 21:57:45 +01:00
parent cc948be671
commit cabb2d54bb
2 changed files with 5 additions and 3 deletions

View File

@ -155,7 +155,7 @@ void grib_set_bit(unsigned char* p, long bitp, int val)
long grib_decode_signed_longb(const unsigned char* p, long* bitp, long nbits)
{
int sign = grib_get_bit(p, *bitp);
const int sign = grib_get_bit(p, *bitp);
long val = 0;
Assert(nbits <= max_nbits);
@ -172,7 +172,7 @@ long grib_decode_signed_longb(const unsigned char* p, long* bitp, long nbits)
int grib_encode_signed_longb(unsigned char* p, long val, long* bitp, long nb)
{
short sign = val < 0;
const short sign = val < 0;
Assert(nb <= max_nbits);

View File

@ -252,6 +252,7 @@ static int grib_db_column_copy_from_handle(grib_handle* h, grib_db* db, int i)
}
/* --------------- grib_db functions ------------------*/
#if 0
grib_db* grib_db_new_from_files(grib_context* c, char* filenames[],
int nfiles, char** keys, int nkeys, int* err)
{
@ -269,7 +270,7 @@ grib_db* grib_db_new_from_files(grib_context* c, char* filenames[],
}
db = grib_db_new_from_file(c, filenames[0], keys, nkeys, err);
if (!db || err != GRIB_SUCCESS)
if (!db || *err != GRIB_SUCCESS)
return db;
*err = GRIB_SUCCESS;
@ -307,6 +308,7 @@ grib_db* grib_db_new_from_file(grib_context* c, char* filename,
return db;
}
#endif
static grib_db* grib_db_create_from_keys(grib_context* c, char** keys, int nkeys, int* err)
{