Commit 82fd5583 authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

now compiles with compiler clang++

parent e176c882
......@@ -35,7 +35,7 @@ static int extDefaultNumber = EXT_REAL;
#define LIBVERSION 1.3.2
#define XSTRING(x) #x
#define STRING(x) XSTRING(x)
static const char ext_libvers[] = STRING(LIBVERSION) " of "__DATE__" "__TIME__;
static const char ext_libvers[] = STRING(LIBVERSION) " of " __DATE__ " " __TIME__ ;
const char *extLibraryVersion(void)
{
......
......@@ -153,7 +153,7 @@ static void file_table_print(void);
#define LIBVERSION 1.8.2
#define XSTRING(x) #x
#define STRING(x) XSTRING(x)
const char file_libvers[] = STRING(LIBVERSION) " of "__DATE__" "__TIME__;
const char file_libvers[] = STRING(LIBVERSION) " of " __DATE__ " " __TIME__;
/*
21/05/2004 1.3.2 set min I/O Buffersize to 128k
......
......@@ -29,7 +29,7 @@ static int iegDefaultDprec = 0;
#define LIBVERSION 1.3.3
#define XSTRING(x) #x
#define STRING(x) XSTRING(x)
static const char ieg_libvers[] = STRING(LIBVERSION) " of "__DATE__" "__TIME__;
static const char ieg_libvers[] = STRING(LIBVERSION) " of " __DATE__ " " __TIME__;
const char *iegLibraryVersion(void)
{
......
......@@ -37,7 +37,7 @@ static int srvDefaultDprec = 0;
#define LIBVERSION 1.3.2
#define XSTRING(x) #x
#define STRING(x) XSTRING(x)
static const char srv_libvers[] = STRING(LIBVERSION) " of "__DATE__" "__TIME__;
static const char srv_libvers[] = STRING(LIBVERSION) " of " __DATE__" " __TIME__;
const char *srvLibraryVersion(void)
{
......
......@@ -4015,14 +4015,28 @@ void transpose2dArrayDP(size_t inWidth, size_t inHeight, double* data)
{
const size_t cacheBlockSize = 256; // Purely an optimization parameter. Current value of 32 means we are handling 8kB blocks,
// which should be a decent compromise on many architectures.
#ifndef __cplusplus
double (*temp)[inWidth] = (double (*)[inWidth])malloc(inHeight*sizeof(*temp));
double (*out)[inHeight] = (double (*)[inHeight])data;
memcpy(temp, data, inHeight*sizeof(*temp));
#else
double *temp[inWidth];
temp[0] = (double *)malloc(inWidth * inHeight * sizeof(double));
for(int i = 1; i < inHeight; i++)
{
temp[i] = temp[0] + (inWidth * i);
}
double **out = (double **)data;
#endif
/*
for ( size_t y = 0; y < inHeight; ++y )
for ( size_t x = 0; x < inWidth; ++x )
out[x][y] = temp[y][x];
*/
for ( size_t yBlock = 0; yBlock < inHeight; yBlock += cacheBlockSize )
{
for ( size_t xBlock = 0; xBlock < inWidth; xBlock += cacheBlockSize )
......@@ -4037,7 +4051,7 @@ void transpose2dArrayDP(size_t inWidth, size_t inHeight, double* data)
}
}
free(temp);
free(temp[0]);
}
static
......@@ -4045,14 +4059,28 @@ void transpose2dArraySP(size_t inWidth, size_t inHeight, float* data)
{
const size_t cacheBlockSize = 256; // Purely an optimization parameter. Current value of 32 means we are handling 8kB blocks,
// which should be a decent compromise on many architectures.
#ifndef __cplusplus
float (*temp)[inWidth] = (float (*)[inWidth])malloc(inHeight*sizeof(*temp));
float (*out)[inHeight] = (float (*)[inHeight])data;
memcpy(temp, data, inHeight*sizeof(*temp));
#else
float *temp[inWidth];
temp[0] = (float *)malloc(inWidth * inHeight * sizeof(float));
for(int i = 1; i < inHeight; i++)
{
temp[i] = temp[0] + (inWidth * i);
}
float **out = (float **)data;
#endif
/*
for ( size_t y = 0; y < inHeight; ++y )
for ( size_t x = 0; x < inWidth; ++x )
out[x][y] = temp[y][x];
*/
for ( size_t yBlock = 0; yBlock < inHeight; yBlock += cacheBlockSize )
{
for ( size_t xBlock = 0; xBlock < inWidth; xBlock += cacheBlockSize )
......
......@@ -7,7 +7,7 @@
*/
#if defined (VERSION)
static const char cdi_libvers[] = VERSION " of "__DATE__" "__TIME__;
static const char cdi_libvers[] = VERSION " of " __DATE__" " __TIME__;
#else
# error "VERSION undefined"
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment