Commit f9ab623d authored by Kim, Jungwon's avatar Kim, Jungwon

C_LOC & LBOUND & memset

parent aabaf03c
......@@ -207,7 +207,7 @@ MODULE PAPYRUS
TYPE(C_PTR) :: VAL_CPTR
LOGICAL :: VAL_NULL_PTR
IF (ASSOCIATED(VAL)) THEN
VAL_CPTR = C_LOC(VAL)
VAL_CPTR = C_LOC(VAL(LBOUND(VAL, 1)))
VAL_NULL_PTR = .FALSE.
ELSE
VAL_CPTR = C_NULL_PTR
......@@ -231,7 +231,7 @@ MODULE PAPYRUS
CHARACTER, POINTER, INTENT(INOUT) :: VAL(:)
INTEGER, INTENT(OUT) :: IERROR
TYPE(C_PTR) :: VAL_CPTR
VAL_CPTR = C_LOC(VAL)
VAL_CPTR = C_LOC(VAL(LBOUND(VAL, 1)))
IERROR = PAPYRUSKV_FREE_CBIND(VAL_CPTR)
NULLIFY(VAL)
END SUBROUTINE PAPYRUSKV_FREE
......
......@@ -38,7 +38,7 @@ int Platform::Init(int* argc, char*** argv, const char* repository) {
MPI_Comm_dup(MPI_COMM_WORLD, &mpi_comm_ext_);
memset(db_, PAPYRUSKV_MAX_DB * sizeof(DB*), 0);
memset(db_, 0, PAPYRUSKV_MAX_DB * sizeof(DB*));
if (repository[0] == '$') {
char* env = getenv(repository + 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment