Skip to content

Commit

Permalink
Merge pull request #11945 from ebaskakov/main
Browse files Browse the repository at this point in the history
Bugfix in OMPI_ARRAY_FINT_2_INT_ALLOC and OMPI_ARRAY_LOGICAL_2_INT_ALLOC
  • Loading branch information
jsquyres authored Sep 25, 2023
2 parents b0a758c + fff8426 commit bc47684
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ompi/mpi/fortran/base/fint_2_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

/* This is for OUT parameters. Does only alloc */
#define OMPI_ARRAY_FINT_2_INT_ALLOC(in, n) \
OMPI_ARRAY_NAME_CONVERT(in) = malloc(n * sizeof(int))
OMPI_ARRAY_NAME_CONVERT(in) = malloc((n) * sizeof(int))

/* This is for IN/IN-OUT parameters. Does alloc and assignment */
#define OMPI_ARRAY_FINT_2_INT(in, n) \
Expand Down Expand Up @@ -117,7 +117,7 @@

/* This is for OUT parameters. Does only alloc */
#define OMPI_ARRAY_FINT_2_INT_ALLOC(in, n) \
OMPI_ARRAY_NAME_CONVERT(in) = malloc(n * sizeof(int))
OMPI_ARRAY_NAME_CONVERT(in) = malloc((n) * sizeof(int))

#define OMPI_ARRAY_FINT_2_INT(in, n) \
do { \
Expand Down Expand Up @@ -204,7 +204,7 @@
# define OMPI_LOGICAL_ARRAY_NAME_DECL(in) int * c_##in
# define OMPI_LOGICAL_ARRAY_NAME_CONVERT(in) c_##in
# define OMPI_ARRAY_LOGICAL_2_INT_ALLOC(in,n) \
OMPI_LOGICAL_ARRAY_NAME_CONVERT(in) = malloc(n * sizeof(int))
OMPI_LOGICAL_ARRAY_NAME_CONVERT(in) = malloc((n) * sizeof(int))
# define OMPI_ARRAY_LOGICAL_2_INT_CLEANUP(in) \
free(OMPI_LOGICAL_ARRAY_NAME_CONVERT(in))

Expand Down

0 comments on commit bc47684

Please sign in to comment.