1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-07-22 18:57:39 +02:00

discard portability patch

This commit is contained in:
q-posev 2021-05-06 09:35:48 +02:00
parent c35362f933
commit d3b35ae453
3 changed files with 12 additions and 12 deletions

View File

@ -235,7 +235,7 @@ trexio_hdf5_write_$group_num$ (trexio_t* const file, const uint64_t num)
if (infile_num != num) {
if (infile_num != 0) {
printf("%llu -> %llu %s \n", num, infile_num,
printf("%lu -> %lu %s \n", num, infile_num,
"This variable already exists. Overwriting it is not supported");
return TREXIO_FAILURE;

View File

@ -347,7 +347,7 @@ trexio_text_read_$group$ (trexio_text_t* const file)
return NULL;
}
rc = fscanf(f, "%llu\n", &($group$->dims_$group_dset$[i]));
rc = fscanf(f, "%lu\n", &($group$->dims_$group_dset$[i]));
assert(!(rc != 1));
if (rc != 1) {
FREE(buffer);
@ -373,7 +373,7 @@ trexio_text_read_$group$ (trexio_text_t* const file)
return NULL;
}
rc = fscanf(f, "%llu", &($group$->$group_num$));
rc = fscanf(f, "%lu", &($group$->$group_num$));
assert(!(rc != 1));
if (rc != 1) {
FREE(buffer);
@ -479,14 +479,14 @@ trexio_text_flush_$group$ (trexio_text_t* const file)
if ($group$->rank_$group_dset$ != 0) size_$group_dset$ = 1;
for (unsigned int i=0; i<$group$->rank_$group_dset$; ++i){
fprintf(f, "dims_$group_dset$ %u %llu\n", i, $group$->dims_$group_dset$[i]);
fprintf(f, "dims_$group_dset$ %u %lu\n", i, $group$->dims_$group_dset$[i]);
size_$group_dset$ *= $group$->dims_$group_dset$[i];
}
// END REPEAT GROUP_DSET
// START REPEAT GROUP_NUM
fprintf(f, "$group_num$ %llu\n", $group$->$group_num$);
fprintf(f, "$group_num$ %lu\n", $group$->$group_num$);
// END REPEAT GROUP_NUM
/* Write arrays */
@ -993,7 +993,7 @@ trexio_text_buffered_read_rdm_two_e(trexio_t* const file,
fseek(f, (long) offset * line_length, SEEK_SET);
for (uint64_t i=0 ; i<size ; ++i) {
int rc = fscanf(f, "%9lld %9lld %9lld %9lld %24le\n",
int rc = fscanf(f, "%9ld %9ld %9ld %9ld %24le\n",
&index[4*i],
&index[4*i+1],
&index[4*i+2],
@ -1032,7 +1032,7 @@ trexio_text_buffered_write_rdm_two_e(trexio_t* const file,
fseek(f, (long) offset * line_length, SEEK_SET);
for (uint64_t i=0 ; i<size ; ++i) {
int rc = fprintf(f, "%9lld %9lld %9lld %9lld %24le\n",
int rc = fprintf(f, "%9ld %9ld %9ld %9ld %24le\n",
index[4*i],
index[4*i+1],
index[4*i+2],

View File

@ -151,8 +151,8 @@ for fname in files_funcs_groups:
std_dtype_out = '24.16e'
std_dtype_in = 'lf'
elif params['dtype'] == 'int64_t':
std_dtype_out = 'lld'
std_dtype_in = 'lld'
std_dtype_out = 'ld'
std_dtype_in = 'ld'
templine1 = templine2.replace('$group_dset_std_dtype_out$', std_dtype_out)
templine2 = templine1.replace('$group_dset_std_dtype_in$', std_dtype_in)