@@ -56,29 +56,31 @@ class BufferArg {
5656 : buf_(buf), valueType_(valueType) {}
5757
5858 BufferArg (const Matrix& matrix)
59- : buf_(( void *) matrix.getData()),
59+ : buf_(reinterpret_cast < void *>( matrix.getData() )),
6060 valueType_ (DataType<real>::value),
6161 shape_(2 ) {
6262 shape_.setDim (0 , matrix.getHeight ());
6363 shape_.setDim (1 , matrix.getWidth ());
6464 }
6565
6666 BufferArg (const Matrix& matrix, const TensorShape& shape)
67- : buf_(( void *) matrix.getData()),
67+ : buf_(reinterpret_cast < void *>( matrix.getData() )),
6868 valueType_(DataType<real>::value),
6969 shape_(shape) {
7070 CHECK_EQ (matrix.getElementCnt (), shape.getElements ());
7171 }
7272
7373 BufferArg (const Vector& vector)
74- : buf_(( void *) vector.getData()),
74+ : buf_(reinterpret_cast < void *>( vector.getData() )),
7575 valueType_(DataType<real>::value),
7676 shape_(1 ) {
7777 shape_.setDim (0 , vector.getSize ());
7878 }
7979
8080 BufferArg (const IVector& vector)
81- : buf_((void *)vector.getData()), valueType_(VALUE_TYPE_INT32), shape_(1 ) {
81+ : buf_(reinterpret_cast <void *>(vector.getData())),
82+ valueType_(VALUE_TYPE_INT32),
83+ shape_(1 ) {
8284 shape_.setDim (0 , vector.getSize ());
8385 }
8486
@@ -129,7 +131,7 @@ class BufferArg {
129131// sequence start positions in a mini-batch of sequences
130132// shape_.ndims() == 1
131133// valueType_ = int32
132- // if a < b than value_.buf_[a] < value_.buf_[b]
134+ // if a < b then value_.buf_[a] < value_.buf_[b]
133135class SequenceIdArg : public BufferArg {
134136public:
135137 SequenceIdArg (void * buf, const TensorShape& shape)
@@ -203,13 +205,13 @@ class SparseMatrixArg : public BufferArg {
203205
204206 SparseMatrixArg (const CpuSparseMatrix& sparse)
205207 : BufferArg(sparse),
206- row_(( void *) sparse.getRows(), VALUE_TYPE_INT32),
207- col_(( void *) sparse.getCols(), VALUE_TYPE_INT32) {}
208+ row_(reinterpret_cast < void *>( sparse.getRows() ), VALUE_TYPE_INT32),
209+ col_(reinterpret_cast < void *>( sparse.getCols() ), VALUE_TYPE_INT32) {}
208210
209211 SparseMatrixArg (const GpuSparseMatrix& sparse)
210212 : BufferArg(sparse),
211- row_(( void *) sparse.getRows(), VALUE_TYPE_INT32),
212- col_(( void *) sparse.getCols(), VALUE_TYPE_INT32) {}
213+ row_(reinterpret_cast < void *>( sparse.getRows() ), VALUE_TYPE_INT32),
214+ col_(reinterpret_cast < void *>( sparse.getCols() ), VALUE_TYPE_INT32) {}
213215
214216 ~SparseMatrixArg () {}
215217
0 commit comments