mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-12-31 08:36:11 +01:00
No bugs with Clang static analyzer
This commit is contained in:
parent
bbb6fac5db
commit
2bbef647f5
@ -276,7 +276,7 @@ qmckl_get_electron_walk_num (const qmckl_context context, int64_t* const walk_nu
|
||||
|
||||
Returns the current electron coordinates. The pointer is assumed
|
||||
to point on a memory block of size ~3 * elec_num * walk_num~.
|
||||
The normal order of the indices is:
|
||||
The order of the indices is:
|
||||
|
||||
| | Normal | Transposed |
|
||||
|---------+---------------------------+---------------------------|
|
||||
|
@ -129,6 +129,7 @@ qmckl_get_nucleus_num (const qmckl_context context, int64_t* const num) {
|
||||
int32_t mask = 1 << 0;
|
||||
|
||||
if ( (ctx->nucleus.uninitialized & mask) != 0) {
|
||||
*num = (int64_t) 0;
|
||||
return qmckl_failwith( context,
|
||||
QMCKL_NOT_PROVIDED,
|
||||
"qmckl_get_nucleus_num",
|
||||
@ -170,10 +171,7 @@ qmckl_get_nucleus_charge (const qmckl_context context, double* const charge) {
|
||||
|
||||
assert (ctx->nucleus.charge != NULL);
|
||||
|
||||
int64_t nucl_num;
|
||||
qmckl_exit_code rc;
|
||||
rc = qmckl_get_nucleus_num(context, &nucl_num);
|
||||
if (rc != QMCKL_SUCCESS) return rc;
|
||||
int64_t nucl_num = ctx->nucleus.num;
|
||||
|
||||
memcpy(charge, ctx->nucleus.charge, nucl_num*sizeof(double));
|
||||
|
||||
@ -361,7 +359,7 @@ qmckl_exit_code
|
||||
qmckl_set_nucleus_coord(qmckl_context context, const char transp, const double* coord) {
|
||||
<<pre2>>
|
||||
|
||||
int64_t nucl_num;
|
||||
int64_t nucl_num = (int64_t) 0;
|
||||
qmckl_exit_code rc;
|
||||
|
||||
int32_t mask = 1 << 2;
|
||||
|
Loading…
Reference in New Issue
Block a user