diff --git a/Makefile.am b/Makefile.am index ee6255a..b911ad8 100644 --- a/Makefile.am +++ b/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 diff --git a/org/qmckl_electron.org b/org/qmckl_electron.org index aa8a17e..26fc3ba 100644 --- a/org/qmckl_electron.org +++ b/org/qmckl_electron.org @@ -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 ; ielectron.coord_new; if (transp == 'N') { - qmckl_exit_code rc; for (int64_t i=0 ; inucleus.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",