diff --git a/src/C_routines.c b/src/C_routines.c index 37364543d..26d704974 100644 --- a/src/C_routines.c +++ b/src/C_routines.c @@ -86,7 +86,7 @@ void inflate_c(const uLong *s_deflated, const uLong *s_inflated, const Byte defl } #ifdef FYAML -void to_flow_c(char **flow, int* length_flow, const char *mixed){ +void to_flow_c(char **flow, long* length_flow, const char *mixed){ struct fy_document *fyd = NULL; enum fy_emitter_cfg_flags emit_flags = FYECF_MODE_FLOW_ONELINE | FYECF_STRIP_LABELS | FYECF_STRIP_TAGS |FYECF_STRIP_DOC; @@ -102,7 +102,7 @@ void to_flow_c(char **flow, int* length_flow, const char *mixed){ } *flow = fy_emit_document_to_string(fyd,emit_flags); - *length_flow = strlen(*flow); + *length_flow = (long) strlen(*flow); fy_document_destroy(fyd); } diff --git a/src/YAML_parse.f90 b/src/YAML_parse.f90 index b1f5aaf71..cd79fe713 100644 --- a/src/YAML_parse.f90 +++ b/src/YAML_parse.f90 @@ -24,11 +24,11 @@ module YAML_parse interface subroutine to_flow_C(flow,length_flow,mixed) bind(C) - use, intrinsic :: ISO_C_Binding, only: C_INT, C_CHAR, C_PTR + use, intrinsic :: ISO_C_Binding, only: C_LONG, C_CHAR, C_PTR implicit none(type,external) type(C_PTR), intent(out) :: flow - integer(C_INT), intent(out) :: length_flow + integer(C_LONG), intent(out) :: length_flow character(kind=C_CHAR), dimension(*), intent(in) :: mixed end subroutine to_flow_C @@ -216,7 +216,7 @@ function to_flow(mixed) result(flow) character(:,C_CHAR), allocatable :: flow type(C_PTR) :: str_ptr - integer(C_INT) :: strlen + integer(C_LONG) :: strlen call to_flow_C(str_ptr,strlen,f_c_string(mixed)) @@ -226,7 +226,7 @@ function to_flow(mixed) result(flow) block character(len=strlen,kind=c_char), pointer :: s call c_f_pointer(str_ptr,s) - flow = s(:len(s)-1) + flow = s(:len(s,pI64)-1_pI64) end block call free_C(str_ptr)