Commit d20fb217 authored by Oliver Heidmann's avatar Oliver Heidmann
Browse files

added spaces before PRIx32 for c++ compiling with clang++ in cksum_read.c and cksum_verify.c

parents 0415ce02 fce198f9
......@@ -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)
{
......
......@@ -4061,14 +4061,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 )
......@@ -4083,7 +4097,7 @@ void transpose2dArrayDP(size_t inWidth, size_t inHeight, double* data)
}
}
free(temp);
free(temp[0]);
}
static
......@@ -4091,14 +4105,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
......
......@@ -26,7 +26,7 @@ read_table(const char *table_fname, size_t *table_len)
*table_len = (size_t)-1;
return NULL;
}
while (fscanf(tablefp, "%08"PRIx32" %d\n", &cksum_temp, &code) == 2)
while (fscanf(tablefp, "%08" PRIx32" %d\n", &cksum_temp, &code) == 2)
{
ENSURE_ARRAY_SIZE(table, table_size, table_used + 1);
table[table_used].code = code;
......
......@@ -45,7 +45,7 @@ main()
uint32_t cksum_result = memcrc(test_data, num_blocks * block_size);
if (cksum_result != UINT32_C(0xc47779cd))
{
printf("unexpected crc result: 0x%8"PRIx32"\n", cksum_result);
printf("unexpected crc result: 0x%8" PRIx32"\n", cksum_result);
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
......
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