- char *inbuf[2] = {NULL, NULL}, *inbuf_free[2] = {NULL, NULL};
- char *accumbuf = NULL, *accumbuf_free = NULL;
- char *local_op_buffer = NULL, *sendtmpbuf = NULL;
- ptrdiff_t extent, lower_bound, segment_increment;
- MPI_Request reqs[2] = {MPI_REQUEST_NULL, MPI_REQUEST_NULL};
- int num_segments, line, ret, segindex, i, rank;
- int recvcount, prevcount, inbi;
-
- /**
- * Determine number of segments and number of elements
- * sent per operation
- */
- datatype->extent(&lower_bound, &extent);
- num_segments = (original_count + count_by_segment - 1) / count_by_segment;
- segment_increment = count_by_segment * extent;
-
- sendtmpbuf = (char*) sendbuf;
- if( sendbuf == MPI_IN_PLACE ) {
- sendtmpbuf = (char *)recvbuf;
+ unsigned char *inbuf[2] = {nullptr, nullptr}, *inbuf_free[2] = {nullptr, nullptr};
+ unsigned char *accumbuf = nullptr, *accumbuf_free = nullptr;
+ const unsigned char *local_op_buffer = nullptr, *sendtmpbuf = nullptr;
+ ptrdiff_t extent, lower_bound, segment_increment;
+ MPI_Request reqs[2] = {MPI_REQUEST_NULL, MPI_REQUEST_NULL};
+ int num_segments, line, ret, segindex, i, rank;
+ int recvcount, prevcount, inbi;
+
+ /**
+ * Determine number of segments and number of elements
+ * sent per operation
+ */
+ datatype->extent(&lower_bound, &extent);
+ num_segments = (original_count + count_by_segment - 1) / count_by_segment;
+ segment_increment = count_by_segment * extent;
+
+ sendtmpbuf = static_cast<const unsigned char*>(sendbuf);
+ if (sendbuf == MPI_IN_PLACE) {
+ sendtmpbuf = static_cast<const unsigned char*>(recvbuf);