77 */
88#include <stdio.h>
99#include <stdlib.h>
10+ #include <string.h>
11+
1012#include "cblas.h"
1113#include "cblas_f77.h"
1214void API_SUFFIX (cblas_cgbmv )(const CBLAS_LAYOUT layout ,
@@ -26,6 +28,7 @@ void API_SUFFIX(cblas_cgbmv)(const CBLAS_LAYOUT layout,
2628 F77_INT F77_M = M , F77_N = N , F77_lda = lda , F77_incX = incX , F77_incY = incY ;
2729 F77_INT F77_KL = KL ,F77_KU = KU ;
2830#else
31+ CBLAS_INT incx = incX ;
2932 #define F77_M M
3033 #define F77_N N
3134 #define F77_lda lda
@@ -34,15 +37,19 @@ void API_SUFFIX(cblas_cgbmv)(const CBLAS_LAYOUT layout,
3437 #define F77_incX incx
3538 #define F77_incY incY
3639#endif
37- CBLAS_INT n = 0 , i = 0 , incx = incX ;
38- const float * xx = (float * )X , * alp = (float * )alpha , * bet = (float * )beta ;
40+ CBLAS_INT n = 0 , i = 0 ;
41+ const float * xx = (const float * )X , * alp = (const float * )alpha , * bet = (const float * )beta ;
3942 float ALPHA [2 ],BETA [2 ];
4043 CBLAS_INT tincY , tincx ;
41- float * x = ( float * ) X , * y = ( float * ) Y , * st = 0 , * tx = 0 ;
44+ float * x , * y , * st = 0 , * tx = 0 ;
4245 extern int CBLAS_CallFromC ;
4346 extern int RowMajorStrg ;
4447 RowMajorStrg = 0 ;
4548
49+ memcpy (& x , & X , sizeof (float * ));
50+ memcpy (& y , & Y , sizeof (float * ));
51+
52+
4653 CBLAS_CallFromC = 1 ;
4754 if (layout == CblasColMajor )
4855 {
@@ -125,7 +132,7 @@ void API_SUFFIX(cblas_cgbmv)(const CBLAS_LAYOUT layout,
125132 y -= n ;
126133 }
127134 }
128- else x = (float * ) X ;
135+ else memcpy ( & x , & X , sizeof (float * )) ;
129136
130137
131138 }
0 commit comments