Compiler warnings: Identifier is reserved because it starts with '_' at global scope [-Wreserved-identifier]

This commit is contained in:
Shahram Najm 2022-12-21 16:08:46 +00:00
parent 0908028394
commit fabf782df4
20 changed files with 49 additions and 49 deletions

View File

@ -395,7 +395,7 @@ static int get_descriptors(grib_accessor* a)
}
if (self->numberOfDescriptors) self_clear(c,self);
err=_grib_get_size(grib_handle_of_accessor(a),expandedDescriptors,&(self->numberOfDescriptors));
err=ecc__grib_get_size(grib_handle_of_accessor(a),expandedDescriptors,&(self->numberOfDescriptors));
if (err) return err;
self->expandedDescriptors=(long*)grib_context_malloc_clear(a->context,sizeof(long)*self->numberOfDescriptors);

View File

@ -153,7 +153,7 @@ int grib_accessor_replace_attribute(grib_accessor* a, grib_accessor* attr);
int grib_accessor_delete_attribute(grib_accessor* a, const char* name);
grib_accessor* grib_accessor_get_attribute_by_index(grib_accessor* a, int index);
const char* grib_accessor_get_name(grib_accessor* a);
grib_accessor* _grib_accessor_get_attribute(grib_accessor* a, const char* name, int* index);
grib_accessor* ecc__grib_accessor_get_attribute(grib_accessor* a, const char* name, int* index);
int grib_accessor_has_attributes(grib_accessor* a);
grib_accessor* grib_accessor_get_attribute(grib_accessor* a, const char* name);
grib_accessors_list* grib_accessors_list_create(grib_context* c);
@ -712,7 +712,7 @@ int grib_index_write(grib_index* index, const char* filename);
grib_index* grib_index_read(grib_context* c, const char* filename, int* err);
int grib_index_search_same(grib_index* index, grib_handle* h);
int grib_index_add_file(grib_index* index, const char* filename);
int _codes_index_add_file(grib_index* index, const char* filename, int message_type);
int ecc__codes_index_add_file(grib_index* index, const char* filename, int message_type);
grib_index* grib_index_new_from_file(grib_context* c, const char* filename, const char* keys, int* err);
int grib_index_get_size(const grib_index* index, const char* key, size_t* size);
int grib_index_get_string(const grib_index* index, const char* key, char** values, size_t* size);
@ -1197,7 +1197,7 @@ char* get_external_template_path(grib_context* c, const char* name);
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);
int _grib_dependency_notify_change(grib_handle* h, grib_accessor* observed);
int ecc__grib_dependency_notify_change(grib_handle* h, grib_accessor* observed);
int grib_dependency_notify_change(grib_accessor* observed);
void grib_dependency_remove_observer(grib_accessor* observer);
void grib_dependency_observe_expression(grib_accessor* observer, grib_expression* e);
@ -1249,19 +1249,19 @@ int grib_get_bytes_internal(const grib_handle* h, const char* name, unsigned cha
int grib_get_bytes(const grib_handle* h, const char* name, unsigned char* val, size_t* length);
int grib_get_native_type(const grib_handle* h, const char* name, int* type);
const char* grib_get_accessor_class_name(grib_handle* h, const char* name);
int _grib_get_double_array_internal(const grib_handle* h, grib_accessor* a, double* val, size_t buffer_len, size_t* decoded_length);
int ecc__grib_get_double_array_internal(const grib_handle* h, grib_accessor* a, double* val, size_t buffer_len, size_t* decoded_length);
int grib_get_double_array_internal(const grib_handle* h, const char* name, double* val, size_t* length);
int grib_get_double_array(const grib_handle* h, const char* name, double* val, size_t* length);
int _grib_get_string_length(grib_accessor* a, size_t* size);
int ecc__grib_get_string_length(grib_accessor* a, size_t* size);
int grib_get_string_length(const grib_handle* h, const char* name, size_t* size);
int _grib_get_size(const grib_handle* h, grib_accessor* a, size_t* size);
int ecc__grib_get_size(const grib_handle* h, grib_accessor* a, size_t* size);
int grib_get_size(const grib_handle* h, const char* name, size_t* size);
int grib_get_length(const grib_handle* h, const char* name, size_t* length);
int grib_get_count(grib_handle* h, const char* name, size_t* size);
int grib_get_offset(const grib_handle* h, const char* key, size_t* val);
int _grib_get_string_array_internal(const grib_handle* h, grib_accessor* a, char** val, size_t buffer_len, size_t* decoded_length);
int ecc__grib_get_string_array_internal(const grib_handle* h, grib_accessor* a, char** val, size_t buffer_len, size_t* decoded_length);
int grib_get_string_array(const grib_handle* h, const char* name, char** val, size_t* length);
int _grib_get_long_array_internal(const grib_handle* h, grib_accessor* a, long* val, size_t buffer_len, size_t* decoded_length);
int ecc__grib_get_long_array_internal(const grib_handle* h, grib_accessor* a, long* val, size_t buffer_len, size_t* decoded_length);
int grib_get_long_array_internal(grib_handle* h, const char* name, long* val, size_t* length);
int grib_get_long_array(const grib_handle* h, const char* name, long* val, size_t* length);
grib_key_value_list* grib_key_value_list_clone(grib_context* c, grib_key_value_list* list);

View File

@ -635,7 +635,7 @@ int grib_accessor_add_attribute(grib_accessor* a, grib_accessor* attr, int nest_
grib_accessor* aloc = a;
if (grib_accessor_has_attributes(a)) {
same = _grib_accessor_get_attribute(a, attr->name, &id);
same = ecc__grib_accessor_get_attribute(a, attr->name, &id);
}
if (same) {
@ -650,7 +650,7 @@ int grib_accessor_add_attribute(grib_accessor* a, grib_accessor* attr, int nest_
aloc->attributes[id] = attr;
attr->parent_as_attribute = aloc;
if (aloc->same)
attr->same = _grib_accessor_get_attribute(aloc->same, attr->name, &idx);
attr->same = ecc__grib_accessor_get_attribute(aloc->same, attr->name, &idx);
grib_context_log(a->context, GRIB_LOG_DEBUG, "added attribute %s->%s", a->name, attr->name);
return GRIB_SUCCESS;
@ -663,12 +663,12 @@ int grib_accessor_replace_attribute(grib_accessor* a, grib_accessor* attr)
{
int id = 0;
int idx = 0;
if (_grib_accessor_get_attribute(a, attr->name, &id) != NULL) {
if (ecc__grib_accessor_get_attribute(a, attr->name, &id) != NULL) {
grib_accessor_delete(a->context, a->attributes[id]);
a->attributes[id] = attr;
attr->parent_as_attribute = a;
if (a->same)
attr->same = _grib_accessor_get_attribute(a->same, attr->name, &idx);
attr->same = ecc__grib_accessor_get_attribute(a->same, attr->name, &idx);
}
else {
grib_accessor_add_attribute(a, attr, 0);
@ -679,7 +679,7 @@ int grib_accessor_replace_attribute(grib_accessor* a, grib_accessor* attr)
int grib_accessor_delete_attribute(grib_accessor* a, const char* name)
{
int id = 0;
if (_grib_accessor_get_attribute(a, name, &id) != NULL) {
if (ecc__grib_accessor_get_attribute(a, name, &id) != NULL) {
grib_accessor_delete(a->context, a->attributes[id]);
a->attributes[id] = NULL;
return GRIB_SUCCESS;
@ -702,7 +702,7 @@ const char* grib_accessor_get_name(grib_accessor* a)
return a->name;
}
grib_accessor* _grib_accessor_get_attribute(grib_accessor* a, const char* name, int* index)
grib_accessor* ecc__grib_accessor_get_attribute(grib_accessor* a, const char* name, int* index)
{
int i = 0;
while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) {
@ -731,14 +731,14 @@ grib_accessor* grib_accessor_get_attribute(grib_accessor* a, const char* name)
while (*(p + 1) != '\0' && (*p != '-' || *(p + 1) != '>'))
p++;
if (*(p + 1) == '\0') {
return _grib_accessor_get_attribute(a, name, &index);
return ecc__grib_accessor_get_attribute(a, name, &index);
}
else {
size_t size = p - name;
attribute_name = p + 2;
basename = (char*)grib_context_malloc_clear(a->context, size + 1);
basename = (char*)memcpy(basename, name, size);
acc = _grib_accessor_get_attribute(a, basename, &index);
acc = ecc__grib_accessor_get_attribute(a, basename, &index);
grib_context_free(a->context, basename);
if (acc)
return grib_accessor_get_attribute(acc, attribute_name);

View File

@ -228,7 +228,7 @@ static void link_same_attributes(grib_accessor* a, grib_accessor* b)
if (!grib_accessor_has_attributes(b))
return;
while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) {
bAttribute = _grib_accessor_get_attribute(b, a->attributes[i]->name, &idx);
bAttribute = ecc__grib_accessor_get_attribute(b, a->attributes[i]->name, &idx);
if (bAttribute)
a->attributes[i]->same = bAttribute;
i++;

View File

@ -367,7 +367,7 @@ static int unpack_string_array(grib_accessor* a, char** v, size_t* len)
int err = 0;
size_t length = 0;
err = _grib_get_string_length(a, &length);
err = ecc__grib_get_string_length(a, &length);
if (err)
return err;
v[0] = (char*)grib_context_malloc_clear(a->context, length);

View File

@ -203,7 +203,7 @@ static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len)
return GRIB_NOT_FOUND;
}
err = _grib_get_size(grib_handle_of_accessor(a), (grib_accessor*)tableAccessor, &size);
err = ecc__grib_get_size(grib_handle_of_accessor(a), (grib_accessor*)tableAccessor, &size);
if (err)
return err;
if (*len < size) {
@ -261,7 +261,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len)
return GRIB_NOT_FOUND;
}
err = _grib_get_size(grib_handle_of_accessor(a), (grib_accessor*)tableAccessor, &size);
err = ecc__grib_get_size(grib_handle_of_accessor(a), (grib_accessor*)tableAccessor, &size);
if (err)
return err;
if (*len < size) {

View File

@ -187,7 +187,7 @@ static size_t string_length(grib_accessor* a)
if (self->length)
return self->length;
_grib_get_string_length(a, &size);
ecc__grib_get_string_length(a, &size);
return size;
}

View File

@ -141,7 +141,7 @@ int grib_dependency_notify_change(grib_accessor* observed)
/* This version takes in the handle so does not need to work it out from the 'observed' */
/* See ECC-778 */
int _grib_dependency_notify_change(grib_handle* h, grib_accessor* observed)
int ecc__grib_dependency_notify_change(grib_handle* h, grib_accessor* observed)
{
grib_dependency* d = h->dependencies;
int ret = GRIB_SUCCESS;

View File

@ -686,7 +686,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment)
grib_handle* h = grib_handle_of_accessor(a);
const char* acc_name = a->name;
_grib_get_string_length(a, &size);
ecc__grib_get_string_length(a, &size);
if (size == 0)
return;

View File

@ -622,7 +622,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment)
if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0)
return;
_grib_get_string_length(a, &size);
ecc__grib_get_string_length(a, &size);
if (size == 0)
return;

View File

@ -735,7 +735,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment)
grib_handle* h = grib_handle_of_accessor(a);
const char* acc_name = a->name;
_grib_get_string_length(a, &size);
ecc__grib_get_string_length(a, &size);
if (size == 0)
return;

View File

@ -676,7 +676,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment)
grib_handle* h = grib_handle_of_accessor(a);
const char* acc_name = a->name;
_grib_get_string_length(a, &size);
ecc__grib_get_string_length(a, &size);
if (size == 0)
return;

View File

@ -285,7 +285,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment)
if (a->length == 0 && (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0)
return;
_grib_get_string_length(a, &size);
ecc__grib_get_string_length(a, &size);
if ((size < 2) && grib_is_missing_internal(a)) {
/* GRIB-302: transients and missing keys. Need to re-adjust the size */
size = 10; /* big enough to hold the string "missing" */

View File

@ -411,7 +411,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment)
return;
}
_grib_get_string_length(a, &size);
ecc__grib_get_string_length(a, &size);
if (size == 0)
return;

View File

@ -467,7 +467,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment)
/* ECC-710: It is MUCH slower determining the string length here
* than using a maximum size (and no need for malloc).
* Specially for BUFR elements */
/*err = _grib_get_string_length(a,&size);
/*err = ecc__grib_get_string_length(a,&size);
if (size==0) return;
value=(char*)grib_context_malloc_clear(a->context,size);
if (!value) {

View File

@ -305,7 +305,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment)
return;
}
_grib_get_string_length(a, &size);
ecc__grib_get_string_length(a, &size);
value = (char*)grib_context_malloc_clear(a->context, size);
if (!value) {
grib_context_log(a->context, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size);

View File

@ -1052,7 +1052,7 @@ int grib_index_add_file(grib_index* index, const char* filename)
else if (index->product_kind == PRODUCT_BUFR) message_type = CODES_BUFR;
else return GRIB_INVALID_ARGUMENT;
return _codes_index_add_file(index, filename, message_type);
return ecc__codes_index_add_file(index, filename, message_type);
}
static grib_handle* new_message_from_file(int message_type, grib_context* c, FILE* f, int* error)
@ -1067,7 +1067,7 @@ static grib_handle* new_message_from_file(int message_type, grib_context* c, FIL
#define MAX_NUM_KEYS 40
int _codes_index_add_file(grib_index* index, const char* filename, int message_type)
int ecc__codes_index_add_file(grib_index* index, const char* filename, int message_type)
{
double dval;
size_t svallen;

View File

@ -165,7 +165,7 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_
switch (grib_accessor_get_native_type(ga)) {
case GRIB_TYPE_STRING:
/*_grib_get_string_length(ga,&len); See ECC-490 */
/*ecc__grib_get_string_length(ga,&len); See ECC-490 */
grib_get_string_length(h, name, &len);
sval = (char*)grib_context_malloc(h->context, len);
ret = grib_get_string_internal(h, name, sval, &len);

View File

@ -209,7 +209,7 @@ int grib_accessor_print(grib_accessor* a, const char* name, int type, const char
size = count;
}
else {
ret = _grib_get_size(h, a, &size);
ret = ecc__grib_get_size(h, a, &size);
}
if (ret) return ret;
dval = (double*)grib_context_malloc_clear(h->context, sizeof(double) * size);
@ -219,7 +219,7 @@ int grib_accessor_print(grib_accessor* a, const char* name, int type, const char
}
else {
replen = 0;
ret = _grib_get_double_array_internal(h, a, dval, size, &replen);
ret = ecc__grib_get_double_array_internal(h, a, dval, size, &replen);
}
if (replen == 1)
fprintf(out, myformat, dval[0]);
@ -250,7 +250,7 @@ int grib_accessor_print(grib_accessor* a, const char* name, int type, const char
size = count;
}
else {
ret = _grib_get_size(h, a, &size);
ret = ecc__grib_get_size(h, a, &size);
}
if (ret) return ret;
lval = (long*)grib_context_malloc_clear(h->context, sizeof(long) * size);
@ -260,7 +260,7 @@ int grib_accessor_print(grib_accessor* a, const char* name, int type, const char
}
else {
replen = 0;
ret = _grib_get_long_array_internal(h, a, lval, size, &replen);
ret = ecc__grib_get_long_array_internal(h, a, lval, size, &replen);
}
if (replen == 1)
fprintf(out, myformat, lval[0]);

View File

@ -714,7 +714,7 @@ static int _grib_set_double_array_internal(grib_handle* h, grib_accessor* a,
*encoded_length += len;
if (err == GRIB_SUCCESS) {
/* See ECC-778 */
return _grib_dependency_notify_change(h, a);
return ecc__grib_dependency_notify_change(h, a);
}
}
else {
@ -752,7 +752,7 @@ static int _grib_set_double_array(grib_handle* h, const char* name,
err = GRIB_ARRAY_TOO_SMALL;
if (err == GRIB_SUCCESS)
return _grib_dependency_notify_change(h, a); /* See ECC-778 */
return ecc__grib_dependency_notify_change(h, a); /* See ECC-778 */
return err;
}
@ -1106,7 +1106,7 @@ int grib_get_double_elements(const grib_handle* h, const char* name, const int*
if (!act)
return GRIB_NOT_FOUND;
err = _grib_get_size(h, act, &size);
err = ecc__grib_get_size(h, act, &size);
if (err != GRIB_SUCCESS) {
grib_context_log(h->context, GRIB_LOG_ERROR, "grib_get_double_elements: cannot get size of %s\n", name);
@ -1289,7 +1289,7 @@ int grib_get_double_array(const grib_handle* h, const char* name, double* val, s
}
}
int _grib_get_string_length(grib_accessor* a, size_t* size)
int ecc__grib_get_string_length(grib_accessor* a, size_t* size)
{
size_t s = 0;
@ -1315,7 +1315,7 @@ int grib_get_string_length(const grib_handle* h, const char* name, size_t* size)
al = grib_find_accessors_list(h, name);
if (!al)
return GRIB_NOT_FOUND;
ret = _grib_get_string_length(al->accessor, size);
ret = ecc__grib_get_string_length(al->accessor, size);
grib_context_free(h->context, al);
return ret;
}
@ -1323,11 +1323,11 @@ int grib_get_string_length(const grib_handle* h, const char* name, size_t* size)
a = grib_find_accessor(h, name);
if (!a)
return GRIB_NOT_FOUND;
return _grib_get_string_length(a, size);
return ecc__grib_get_string_length(a, size);
}
}
int _grib_get_size(const grib_handle* h, grib_accessor* a, size_t* size)
int ecc__grib_get_size(const grib_handle* h, grib_accessor* a, size_t* size)
{
long count = 0;
int err = 0;
@ -1375,7 +1375,7 @@ int grib_get_size(const grib_handle* ch, const char* name, size_t* size)
return ret;
}
else
return _grib_get_size(h, a, size);
return ecc__grib_get_size(h, a, size);
}
}
@ -1409,10 +1409,10 @@ int grib_get_offset(const grib_handle* ch, const char* key, size_t* val)
return GRIB_NOT_FOUND;
}
int _grib_get_string_array_internal(const grib_handle* h, grib_accessor* a, char** val, size_t buffer_len, size_t* decoded_length)
int ecc__grib_get_string_array_internal(const grib_handle* h, grib_accessor* a, char** val, size_t buffer_len, size_t* decoded_length)
{
if (a) {
int err = _grib_get_string_array_internal(h, a->same, val, buffer_len, decoded_length);
int err = ecc__grib_get_string_array_internal(h, a->same, val, buffer_len, decoded_length);
if (err == GRIB_SUCCESS) {
size_t len = buffer_len - *decoded_length;
@ -1451,7 +1451,7 @@ int grib_get_string_array(const grib_handle* h, const char* name, char** val, si
}
else {
*length = 0;
return _grib_get_string_array_internal(h, a, val, len, length);
return ecc__grib_get_string_array_internal(h, a, val, len, length);
}
}
}