Const correctness and cppcheck warnings

This commit is contained in:
shahramn 2024-03-04 10:25:35 +00:00
parent 71cabbf6dd
commit 12a2484c13
5 changed files with 5 additions and 5 deletions

View File

@ -1104,7 +1104,7 @@ long grib_get_binary_scale_fact(double max, double min, long bpval, int* error);
grib_handle* codes_external_sample(grib_context* c, ProductKind product_kind, const char* name);
char* get_external_sample_path(grib_context* c, const char* name);
/* grib_dependency.cc*/
/* grib_dependency.cc */
grib_handle* grib_handle_of_accessor(const grib_accessor* a);
void grib_dependency_add(grib_accessor* observer, grib_accessor* observed);
void grib_dependency_remove_observed(grib_accessor* observed);

View File

@ -35,7 +35,7 @@
#include "grib_accessor_class.h"
#line 6 "accessor_class_list.gperf"
struct accessor_class_hash { char *name; grib_accessor_class **cclass;};
struct accessor_class_hash { const char *name; grib_accessor_class **cclass;};
#define TOTAL_KEYWORDS 205
#define MIN_WORD_LENGTH 1

View File

@ -453,7 +453,7 @@ grib_context* grib_context_get_default()
#ifdef ECCODES_SAMPLES_PATH
if (!default_grib_context.grib_samples_path)
default_grib_context.grib_samples_path = ECCODES_SAMPLES_PATH;
default_grib_context.grib_samples_path = (char*)ECCODES_SAMPLES_PATH;
#endif
default_grib_context.grib_definition_files_path = codes_getenv("ECCODES_DEFINITION_PATH");

View File

@ -31,7 +31,7 @@
#include "grib_api_internal.h"
struct grib_keys_hash { char* name; int id;};
struct grib_keys_hash { const char* name; int id;};
#include <string.h>
#define TOTAL_KEYWORDS 2535

View File

@ -6,7 +6,7 @@ cat > accessor_class_list.gperf <<EOF
#include "grib_accessor_class.h"
%}
struct accessor_class_hash { char *name; grib_accessor_class **cclass;};
struct accessor_class_hash { const char *name; grib_accessor_class **cclass;};
%%
EOF