Skip to content

Commit 86d3707

Browse files
committed
Fixed CBLAS integer formats for 64bit build.
1 parent 3381a0e commit 86d3707

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

CBLAS/examples/cblas_example1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ int main ( )
6161
y, incy );
6262
/* Print y */
6363
for( i = 0; i < n; i++ )
64-
printf(" y%d = %f\n", i, y[i]);
64+
printf(" y%" CBLAS_IFMT " = %f\n", i, y[i]);
6565
free(a);
6666
free(x);
6767
free(y);

CBLAS/include/cblas.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define CBLAS_H
33
#include <stddef.h>
44
#include <stdint.h>
5+
#include <inttypes.h>
56

67

78
#ifdef __cplusplus
@@ -24,6 +25,17 @@ extern "C" { /* Assume C declarations for C++ */
2425
#endif
2526
#endif
2627

28+
/*
29+
* Integer format string
30+
*/
31+
#ifndef CBLAS_IFMT
32+
#ifdef WeirdNEC
33+
#define CBLAS_IFMT PRId64
34+
#else
35+
#define CBLAS_IFMT PRId32
36+
#endif
37+
#endif
38+
2739
typedef enum CBLAS_LAYOUT {CblasRowMajor=101, CblasColMajor=102} CBLAS_LAYOUT;
2840
typedef enum CBLAS_TRANSPOSE {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113} CBLAS_TRANSPOSE;
2941
typedef enum CBLAS_UPLO {CblasUpper=121, CblasLower=122} CBLAS_UPLO;

CBLAS/src/cblas_xerbla.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ cblas_xerbla(CBLAS_INT info, const char *rout, const char *form, ...)
6363
}
6464
}
6565
if (info)
66-
fprintf(stderr, "Parameter %d to routine %s was incorrect\n", info, rout);
66+
fprintf(stderr, "Parameter %" CBLAS_IFMT " to routine %s was incorrect\n", info, rout);
6767
vfprintf(stderr, form, argptr);
6868
va_end(argptr);
6969
if (info && !info)

CBLAS/testing/c_xerbla.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void cblas_xerbla(CBLAS_INT info, const char *rout, const char *form, ...)
7878
}
7979

8080
if (info != cblas_info){
81-
printf("***** XERBLA WAS CALLED WITH INFO = %d INSTEAD OF %d in %s *******\n",info, cblas_info, rout);
81+
printf("***** XERBLA WAS CALLED WITH INFO = %" CBLAS_IFMT " INSTEAD OF %d in %s *******\n",info, cblas_info, rout);
8282
cblas_lerr = PASSED;
8383
cblas_ok = FALSE;
8484
} else cblas_lerr = FAILED;

0 commit comments

Comments
 (0)