Skip to content

Commit

Permalink
Reduce sonarcloud warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Cornu committed Oct 4, 2023
1 parent 8686690 commit ae02186
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 30 deletions.
1 change: 0 additions & 1 deletion src/coreneuron/mpi/lib/mpispike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ void nrnmpi_barrier_impl() {
}

static MPI_Op type2OP(int type) {
MPI_Op tt;
if (type == 1) {
return MPI_SUM;
} else if (type == 2) {
Expand Down
2 changes: 1 addition & 1 deletion src/nrnmpi/bbsmpipack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ void nrnmpi_bbssend(int dest, int tag, bbsmpibuf* r) {
assert(r->buf && r->keypos <= r->size);
nrn_mpi_assert(MPI_Send(r->buf, r->size, MPI_PACKED, dest, tag, nrn_bbs_comm));
} else {
nrn_mpi_assert(MPI_Send(NULL, 0, MPI_PACKED, dest, tag, nrn_bbs_comm));
nrn_mpi_assert(MPI_Send(nullptr, 0, MPI_PACKED, dest, tag, nrn_bbs_comm));
}
errno = 0;
#if debug
Expand Down
33 changes: 5 additions & 28 deletions src/oc/nrnassrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,21 @@ has side effects which need to be executed regardles of NDEBUG.
#if defined(hocassrt_h) /* hoc_execerror form */
#include "oc_ansi.h"

#if defined(__STDC__)
#define nrn_assert(ex) \
{ \
do { \
if (!(ex)) { \
fprintf(stderr, "Assertion failed: file %s, line %d\n", __FILE__, __LINE__); \
hoc_execerror(#ex, (char*) 0); \
hoc_execerror(#ex, nullptr); \
} \
}
#else
#define nrn_assert(ex) \
{ \
if (!(ex)) { \
fprintf(stderr, "Assertion failed: file %s, line %d\n", __FILE__, __LINE__); \
hoc_execerror("ex", (char*) 0); \
} \
}
#endif

} while (0)
#else /* abort form */

#if defined(__STDC__)
#define nrn_assert(ex) \
{ \
do { \
if (!(ex)) { \
fprintf(stderr, "Assertion failed: file %s, line %d\n", __FILE__, __LINE__); \
abort(); \
} \
}
#else
#define nrn_assert(ex) \
{ \
if (!(ex)) { \
fprintf(stderr, "Assertion failed: file %s, line %d\n", __FILE__, __LINE__); \
abort(); \
} \
}
#endif

} while (0)
#endif


Expand Down

0 comments on commit ae02186

Please sign in to comment.