77 */
88#include <stdio.h>
99#include <stdlib.h>
10+ #include <string.h>
1011#include "cblas.h"
1112#include "cblas_f77.h"
1213void API_SUFFIX (cblas_zher2 )(const CBLAS_LAYOUT layout , const CBLAS_UPLO Uplo ,
@@ -23,19 +24,27 @@ void API_SUFFIX(cblas_zher2)(const CBLAS_LAYOUT layout, const CBLAS_UPLO Uplo,
2324#ifdef F77_INT
2425 F77_INT F77_N = N , F77_lda = lda , F77_incX = incX , F77_incY = incY ;
2526#else
27+ CBLAS_INT incx = incX , incy = incY ;
2628 #define F77_N N
2729 #define F77_lda lda
2830 #define F77_incX incx
2931 #define F77_incY incy
3032#endif
31- CBLAS_INT n , i , j , tincx , tincy , incx = incX , incy = incY ;
32- double * x = ( double * ) X , * xx = ( double * ) X , * y = ( double * ) Y ,
33- * yy = ( double * ) Y , * tx , * ty , * stx , * sty ;
33+ CBLAS_INT n , i , j , tincx , tincy ;
34+ double * x , * xx , * y ,
35+ * yy , * tx , * ty , * stx , * sty ;
3436
3537 extern int CBLAS_CallFromC ;
3638 extern int RowMajorStrg ;
3739 RowMajorStrg = 0 ;
3840
41+
42+ memcpy (& x ,& X ,sizeof (double * ));
43+ memcpy (& xx ,& X ,sizeof (double * ));
44+ memcpy (& y ,& Y ,sizeof (double * ));
45+ memcpy (& yy ,& Y ,sizeof (double * ));
46+
47+
3948 CBLAS_CallFromC = 1 ;
4049 if (layout == CblasColMajor )
4150 {
@@ -129,8 +138,9 @@ void API_SUFFIX(cblas_zher2)(const CBLAS_LAYOUT layout, const CBLAS_UPLO Uplo,
129138 #endif
130139 } else
131140 {
132- x = (double * ) X ;
133- y = (double * ) Y ;
141+
142+ memcpy (& x ,& X ,sizeof (double * ));
143+ memcpy (& y ,& Y ,sizeof (double * ));
134144 }
135145 F77_zher2 (F77_UL , & F77_N , alpha , y , & F77_incY , x ,
136146 & F77_incX , A , & F77_lda );
0 commit comments