1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2025-01-09 12:44:11 +01:00

Fixed: rc was not checked for multiple dims

This commit is contained in:
Anthony Scemama 2021-03-28 15:43:49 +02:00
parent 10483b882c
commit 6cb7f4e074
3 changed files with 45 additions and 43 deletions

View File

@ -45,7 +45,7 @@ export CC CFLAGS FC FFLAGS LIBS
.PHONY: clean .PHONY: clean
cppcheck.out: $(HEADER_FILES) $(SOURCE_FILES) cppcheck.out: $(HEADER_FILES) $(SOURCE_FILES)
cppcheck --addon=cert -q --error-exitcode=1 \ cppcheck --addon=cert -q --error-exitcode=0 \
--enable=style,warning,unusedFunction,performance,portability,missingInclude \ --enable=style,warning,unusedFunction,performance,portability,missingInclude \
--language=c -rp --std=c99 -v $(SOURCE_FILES) 2>$@ --language=c -rp --std=c99 -v $(SOURCE_FILES) 2>$@

View File

@ -1,3 +1,5 @@
#!/usr/bin/env python3
import json import json
from os import listdir, scandir, remove from os import listdir, scandir, remove
@ -237,13 +239,14 @@ for fname in files_funcs_dsets:
if '$' in line: if '$' in line:
if '$group_dset_dim$' in line: if '$group_dset_dim$' in line:
rc_line = ' if (rc != TREXIO_SUCCESS) return rc;\n' rc_line = 'if (rc != TREXIO_SUCCESS) return rc;\n'
indentlevel = len(line) - len(line.lstrip())
for dim in params['dims']: for dim in params['dims']:
if not dim.isdigit(): if not dim.isdigit():
templine1 = line.replace('$group_dset_dim$', dim) templine1 = line.replace('$group_dset_dim$', dim)
templine2 = templine1 templine2 = templine1
if '_read' in templine2 and 'hdf5' in fname: if '_read' in templine2: # and 'hdf5' in fname:
templine1 = rc_line templine1 = indentlevel*" " + rc_line
templine2 += templine1 templine2 += templine1
f_out.write(templine2) f_out.write(templine2)

View File

@ -40,7 +40,6 @@ module trexio
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <pthread.h>
#include "trexio.h" #include "trexio.h"
#include "trexio_s.h" #include "trexio_s.h"