Skip to content

Commit

Permalink
Const correctness
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Nov 8, 2023
1 parent 7a83e3c commit f78d164
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/eccodes_prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ int codes_check_message_header(const void* bytes, size_t length, ProductKind pro
int codes_check_message_footer(const void* bytes, size_t length, ProductKind product);
int grib_get_message_size(const grib_handle* h, size_t* size);
int grib_get_message(const grib_handle* h, const void** msg, size_t* size);
int grib_get_message_headers(grib_handle* h, const void** msg, size_t* size);
int grib_get_message_headers(const grib_handle* h, const void** msg, size_t* size);
grib_action* grib_action_from_filter(const char* filter);
int grib_handle_apply_action(grib_handle* h, grib_action* a);
void grib_multi_support_reset_file(grib_context* c, FILE* f);
Expand Down
8 changes: 3 additions & 5 deletions src/grib_handle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1149,9 +1149,7 @@ grib_multi_handle* grib_multi_handle_new(grib_context* c)
}
h = (grib_multi_handle*)grib_context_malloc_clear(c, sizeof(grib_multi_handle));
if (h == NULL) {
grib_context_log(c, GRIB_LOG_ERROR,
"grib_multi_handle_new: unable to allocate memory. %s",
grib_get_error_message(GRIB_OUT_OF_MEMORY));
grib_context_log(c, GRIB_LOG_ERROR, "%s: Unable to allocate memory", __func__);
return NULL;
}
h->buffer = grib_create_growable_buffer(c);
Expand Down Expand Up @@ -1375,7 +1373,7 @@ int grib_get_message(const grib_handle* ch, const void** msg, size_t* size)
return 0;
}

int grib_get_message_headers(grib_handle* h, const void** msg, size_t* size)
int grib_get_message_headers(const grib_handle* h, const void** msg, size_t* size)
{
int err = 0;
size_t endOfHeadersMarker;
Expand All @@ -1384,7 +1382,7 @@ int grib_get_message_headers(grib_handle* h, const void** msg, size_t* size)

if ((err = grib_get_offset(h, "endOfHeadersMarker", &endOfHeadersMarker)) != GRIB_SUCCESS) {
grib_context_log(h->context, GRIB_LOG_ERROR,
"grib_get_message_headers: unable to get offset of endOfHeadersMarker");
"%s: Unable to get offset of endOfHeadersMarker", __func__);
return err;
}

Expand Down

0 comments on commit f78d164

Please sign in to comment.