Fortran: Compiler warnings (SUP-3893)

This commit is contained in:
Shahram Najm 2023-12-20 14:17:30 +00:00
parent 692b72f4b6
commit 9ba56e862d
4 changed files with 47 additions and 23 deletions

View File

@ -20,6 +20,7 @@ integer, external :: grib_f_skip_computed, &
integer, external :: grib_f_keys_iterator_get_name, &
grib_f_keys_iterator_rewind
integer, external :: grib_f_new_from_message, &
grib_f_new_from_message_int, &
grib_f_new_from_message_copy, &
grib_f_new_from_samples, &
codes_bufr_f_new_from_samples, &

View File

@ -1365,7 +1365,7 @@
if (present(status)) then
status = iret
else
call grib_check(iret, 'new_from_message', '')
call grib_check(iret, 'new_from_message_char', '')
end if
end subroutine grib_new_from_message_char
@ -1394,11 +1394,13 @@
integer(kind=kindOfInt) :: iret
size_bytes = size(message, dim=1)*sizeOfInteger4
iret = grib_f_new_from_message(gribid, message, size_bytes)
! See SUP-3893
!iret = grib_f_new_from_message(gribid, message, size_bytes)
iret = grib_f_new_from_message_int(gribid, message, size_bytes)
if (present(status)) then
status = iret
else
call grib_check(iret, 'new_from_message', '')
call grib_check(iret, 'new_from_message_int4', '')
end if
end subroutine grib_new_from_message_int4

View File

@ -1497,11 +1497,10 @@ int codes_f_bufr_keys_iterator_delete(int* iterid) {
int grib_f_new_from_message_(int* gid, void* buffer , size_t* bufsize){
grib_handle *h = NULL;
h = grib_handle_new_from_message_copy(0, buffer, *bufsize);
if(h){
if (h){
push_handle(h,gid);
return GRIB_SUCCESS;
}
*gid = -1;
return GRIB_INTERNAL_ERROR;
}
@ -1512,6 +1511,23 @@ int grib_f_new_from_message(int* gid, void* buffer , size_t* bufsize){
return grib_f_new_from_message_(gid, buffer , bufsize);
}
/* See SUP-3893: Need to provide an 'int' version */
int grib_f_new_from_message_int_(int* gid, int* buffer , size_t* bufsize){
grib_handle *h = NULL;
h = grib_handle_new_from_message_copy(0, (void*)buffer, *bufsize);
if (h){
push_handle(h,gid);
return GRIB_SUCCESS;
}
*gid = -1;
return GRIB_INTERNAL_ERROR;
}
int grib_f_new_from_message_int__(int* gid, int* buffer , size_t* bufsize){
return grib_f_new_from_message_int_(gid, buffer , bufsize);
}
int grib_f_new_from_message_int(int* gid, int* buffer , size_t* bufsize){
return grib_f_new_from_message_int_(gid, buffer , bufsize);
}
/*****************************************************************************/
int grib_f_new_from_message_copy_(int* gid, void* buffer , size_t* bufsize){
grib_handle *h = NULL;

View File

@ -16,15 +16,15 @@ extern "C" {
int grib_f_read_any_headers_only_from_file_(int *fid, char *buffer, size_t *nbytes);
int grib_f_read_any_headers_only_from_file__(int *fid, char *buffer, size_t *nbytes);
int grib_f_read_any_headers_only_from_file(int *fid, char *buffer, size_t *nbytes);
int grib_f_read_any_from_file_(int *fid, void *buffer, size_t *nbytes);
int grib_f_read_any_from_file__(int *fid, void *buffer, size_t *nbytes);
int grib_f_read_any_from_file(int *fid, void *buffer, size_t *nbytes);
int grib_f_write_file_(int *fid, void *buffer, size_t *nbytes);
int grib_f_write_file__(int *fid, void *buffer, size_t *nbytes);
int grib_f_write_file(int *fid, void *buffer, size_t *nbytes);
int grib_f_read_file_(int *fid, void *buffer, size_t *nbytes);
int grib_f_read_file__(int *fid, void *buffer, size_t *nbytes);
int grib_f_read_file(int *fid, void *buffer, size_t *nbytes);
int grib_f_read_any_from_file_(int *fid, void* buffer, size_t *nbytes);
int grib_f_read_any_from_file__(int *fid, void* buffer, size_t *nbytes);
int grib_f_read_any_from_file(int *fid, void* buffer, size_t *nbytes);
int grib_f_write_file_(int *fid, void* buffer, size_t *nbytes);
int grib_f_write_file__(int *fid, void* buffer, size_t *nbytes);
int grib_f_write_file(int *fid, void* buffer, size_t *nbytes);
int grib_f_read_file_(int *fid, void* buffer, size_t *nbytes);
int grib_f_read_file__(int *fid, void* buffer, size_t *nbytes);
int grib_f_read_file(int *fid, void* buffer, size_t *nbytes);
int grib_f_open_file_(int *fid, char *name, char *op, int lname, int lop);
int grib_f_open_file__(int *fid, char *name, char *op, int lname, int lop);
int grib_f_open_file(int *fid, char *name, char *op, int lname, int lop);
@ -99,12 +99,17 @@ int grib_f_skip_read_only(int *iterid);
int grib_f_skip_function_(int *iterid);
int grib_f_skip_function__(int *iterid);
int grib_f_skip_function(int *iterid);
int grib_f_new_from_message_(int *gid, void *buffer, size_t *bufsize);
int grib_f_new_from_message__(int *gid, void *buffer, size_t *bufsize);
int grib_f_new_from_message(int *gid, void *buffer, size_t *bufsize);
int grib_f_new_from_message_copy_(int *gid, void *buffer, size_t *bufsize);
int grib_f_new_from_message_copy__(int *gid, void *buffer, size_t *bufsize);
int grib_f_new_from_message_copy(int *gid, void *buffer, size_t *bufsize);
int grib_f_new_from_message_(int *gid, void* buffer, size_t *bufsize);
int grib_f_new_from_message__(int *gid, void* buffer, size_t *bufsize);
int grib_f_new_from_message(int *gid, void* buffer, size_t *bufsize);
int grib_f_new_from_message_int_(int *gid, int *buffer, size_t *bufsize);
int grib_f_new_from_message_int__(int *gid, int *buffer, size_t *bufsize);
int grib_f_new_from_message_int(int *gid, int *buffer, size_t *bufsize);
int grib_f_new_from_message_copy_(int *gid, void* buffer, size_t *bufsize);
int grib_f_new_from_message_copy__(int *gid, void* buffer, size_t *bufsize);
int grib_f_new_from_message_copy(int *gid, void* buffer, size_t *bufsize);
int grib_f_new_from_samples_(int *gid, char *name, int lname);
int grib_f_new_from_samples__(int *gid, char *name, int lname);
int grib_f_new_from_samples(int *gid, char *name, int lname);
@ -353,9 +358,9 @@ int grib_f_get_data_real8(int *gid, double *lats, double *lons, double *values,
int grib_f_get_message_size_(int *gid, size_t *len);
int grib_f_get_message_size__(int *gid, size_t *len);
int grib_f_get_message_size(int *gid, size_t *len);
int grib_f_copy_message_(int *gid, void *mess, size_t *len);
int grib_f_copy_message__(int *gid, void *mess, size_t *len);
int grib_f_copy_message(int *gid, void *mess, size_t *len);
int grib_f_copy_message_(int *gid, void* mess, size_t *len);
int grib_f_copy_message__(int *gid, void* mess, size_t *len);
int grib_f_copy_message(int *gid, void* mess, size_t *len);
void grib_f_check_(int *err, char *call, char *str, int lencall, int lenstr);
void grib_f_check__(int *err, char *call, char *key, int lencall, int lenkey);
void grib_f_check(int *err, char *call, char *key, int lencall, int lenkey);