mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-03 10:06:09 +01:00
Added cppcheck
This commit is contained in:
parent
16595f898b
commit
bbb6fac5db
12
Makefile.am
12
Makefile.am
@ -161,4 +161,16 @@ tests/chbrclf.h: $(qmckl_h)
|
||||
generated.mk: $(ORG_FILES)
|
||||
python $(srcdir)/tools/build_makefile.py
|
||||
|
||||
cppcheck: cppcheck.out
|
||||
|
||||
cppcheck.out: $(qmckl_h)
|
||||
cd src/ && \
|
||||
cppcheck --addon=cert -q --error-exitcode=0 \
|
||||
--enable=all \
|
||||
--language=c --std=c99 -rp --platform=unix64 \
|
||||
-I../include *.c *.h 2>../$@
|
||||
|
||||
|
||||
.PHONY: cppcheck
|
||||
|
||||
endif
|
||||
|
@ -329,9 +329,9 @@ qmckl_get_electron_coord (const qmckl_context context, const char transp, double
|
||||
double* ptr2 = coord;
|
||||
|
||||
if (transp == 'N') {
|
||||
qmckl_exit_code rc;
|
||||
|
||||
for (int64_t i=0 ; i<walk_num ; ++i) {
|
||||
qmckl_exit_code rc;
|
||||
rc = qmckl_transpose(context, elec_num, 3,
|
||||
ptr1, elec_num, ptr2, 3);
|
||||
if (rc != QMCKL_SUCCESS) return rc;
|
||||
@ -535,7 +535,6 @@ qmckl_set_electron_coord(qmckl_context context, const char transp, const double*
|
||||
|
||||
double* ptr1 = ctx->electron.coord_new;
|
||||
if (transp == 'N') {
|
||||
qmckl_exit_code rc;
|
||||
|
||||
for (int64_t i=0 ; i<walk_num ; ++i) {
|
||||
rc = qmckl_transpose(context, 3, elec_num,
|
||||
|
@ -340,7 +340,7 @@ qmckl_set_nucleus_charge(qmckl_context context, const double* charge) {
|
||||
|
||||
assert (ctx->nucleus.charge == NULL);
|
||||
ctx->nucleus.charge = (double*) qmckl_malloc(context, mem_info);
|
||||
if (charge== NULL) {
|
||||
if (ctx->nucleus.charge == NULL) {
|
||||
return qmckl_failwith( context,
|
||||
QMCKL_ALLOCATION_FAILED,
|
||||
"qmckl_set_nucleus_charge",
|
||||
|
Loading…
Reference in New Issue
Block a user