@@ -59,20 +59,20 @@ BEGIN_C_DECLS
59
59
* repeated code, but it's better this way (and this typedef will
60
60
* never change, so there's not much of a maintenance worry).
61
61
*/
62
- typedef void (ompi_op_c_handler_fn_t )(void * , void * , int * ,
62
+ typedef void (ompi_op_c_handler_fn_t )(const void * , void * , int * ,
63
63
struct ompi_datatype_t * * );
64
64
65
65
/**
66
66
* Typedef for fortran user-defined MPI_Ops.
67
67
*/
68
- typedef void (ompi_op_fortran_handler_fn_t )(void * , void * ,
68
+ typedef void (ompi_op_fortran_handler_fn_t )(const void * , void * ,
69
69
MPI_Fint * , MPI_Fint * );
70
70
71
71
/**
72
72
* Typedef for Java op functions intercept (used for user-defined
73
73
* MPI.Ops).
74
74
*/
75
- typedef void (ompi_op_java_handler_fn_t )(void * , void * , int * ,
75
+ typedef void (ompi_op_java_handler_fn_t )(const void * , void * , int * ,
76
76
struct ompi_datatype_t * * ,
77
77
int baseType ,
78
78
void * jnienv , void * object );
@@ -500,7 +500,7 @@ static inline bool ompi_op_is_valid(ompi_op_t * op, ompi_datatype_t * ddt,
500
500
* optimization). If you give it an intrinsic op with a datatype that
501
501
* is not defined to have that operation, it is likely to seg fault.
502
502
*/
503
- static inline void ompi_op_reduce (ompi_op_t * op , void * source ,
503
+ static inline void ompi_op_reduce (ompi_op_t * op , const void * source ,
504
504
void * target , size_t full_count ,
505
505
ompi_datatype_t * dtype )
506
506
{
@@ -531,7 +531,7 @@ static inline void ompi_op_reduce(ompi_op_t * op, void *source,
531
531
}
532
532
shift = done_count * ext ;
533
533
// Recurse one level in iterations of 'int'
534
- ompi_op_reduce (op , (char * )source + shift , (char * )target + shift , iter_count , dtype );
534
+ ompi_op_reduce (op , (const char * )source + shift , (char * )target + shift , iter_count , dtype );
535
535
done_count += iter_count ;
536
536
}
537
537
return ;
@@ -595,7 +595,7 @@ static inline void ompi_op_reduce(ompi_op_t * op, void *source,
595
595
static inline void ompi_3buff_op_user (ompi_op_t * op , void * restrict source1 , void * restrict source2 ,
596
596
void * restrict result , int count , struct ompi_datatype_t * dtype )
597
597
{
598
- ompi_datatype_copy_content_same_ddt (dtype , count , result , source1 );
598
+ ompi_datatype_copy_content_same_ddt (dtype , count , ( char * ) result , ( char * ) source1 );
599
599
op -> o_func .c_fn (source2 , result , & count , & dtype );
600
600
}
601
601
0 commit comments