Cppcheck warnings: Const correctness

This commit is contained in:
Shahram Najm 2021-11-06 17:56:21 +00:00
parent cf796ed5ae
commit 87acf45bb5
3 changed files with 3 additions and 3 deletions

View File

@ -97,7 +97,7 @@ int grib_encode_string(unsigned char* bitStream, long* bitOffset, size_t numberO
int remainder = *bitOffset % 8; int remainder = *bitOffset % 8;
unsigned char c; unsigned char c;
unsigned char* p; unsigned char* p;
unsigned char mask[] = { 0, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE }; const unsigned char mask[] = { 0, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE };
int remainderComplement = 8 - remainder; int remainderComplement = 8 - remainder;
char str[512] = {0,}; char str[512] = {0,};
char* s = str; char* s = str;

View File

@ -90,7 +90,7 @@ char* grib_decode_string(const unsigned char* bitStream, long* bitOffset, size_t
unsigned char c; unsigned char c;
unsigned char* p; unsigned char* p;
char* s = string; char* s = string;
unsigned char mask[] = { 0, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE }; const unsigned char mask[] = { 0, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE };
int remainderComplement = 8 - remainder; int remainderComplement = 8 - remainder;
if (numberOfCharacters == 0) if (numberOfCharacters == 0)

View File

@ -131,7 +131,7 @@ static void pj_authset(double es, double* APA)
APA[1] += t * P11; APA[1] += t * P11;
APA[2] = t * P20; APA[2] = t * P20;
} }
static double pj_authlat(double beta, double* APA) static double pj_authlat(double beta, const double* APA)
{ {
double t = beta + beta; double t = beta + beta;
return (beta + APA[0] * sin(t) + APA[1] * sin(t + t) + APA[2] * sin(t + t + t)); return (beta + APA[0] * sin(t) + APA[1] * sin(t + t) + APA[2] * sin(t + t + t));