Commit 4e054031 authored by vijaysm's avatar vijaysm

Remove some more assert related issues in WriteHDF5

parent c4e3f0ab
...@@ -55,28 +55,8 @@ ...@@ -55,28 +55,8 @@
#error Attempt to compile WriteHDF5 with HDF5 support disabled #error Attempt to compile WriteHDF5 with HDF5 support disabled
#endif #endif
/* Access HDF5 file handle for debugging
#include <H5Fpublic.h>
struct file { uint32_t magic; hid_t handle; };
*/
#undef DEBUG
#undef BLOCKED_COORD_IO #undef BLOCKED_COORD_IO
#ifdef DEBUG
/*
# include <H5Epublic.h>
extern "C" herr_t hdf_error_handler(void*)
{
H5Eprint(stderr);
assert(0);
}
*/
# define myassert(A) assert(A)
#else
# define myassert(A)
#endif
#ifdef MOAB_HAVE_VALGRIND #ifdef MOAB_HAVE_VALGRIND
# include <valgrind/memcheck.h> # include <valgrind/memcheck.h>
#else #else
...@@ -172,7 +152,7 @@ static herr_t handle_hdf5_error(void* data) ...@@ -172,7 +152,7 @@ static herr_t handle_hdf5_error(void* data)
do { \ do { \
if (mhdf_isError(&(A))) { \ if (mhdf_isError(&(A))) { \
MB_SET_ERR_CONT(mhdf_message(&(A))); \ MB_SET_ERR_CONT(mhdf_message(&(A))); \
myassert(0); \ assert(0); \
return error(MB_FAILURE); \ return error(MB_FAILURE); \
} \ } \
} while (false) } while (false)
...@@ -181,7 +161,7 @@ do { \ ...@@ -181,7 +161,7 @@ do { \
do { \ do { \
if (mhdf_isError(&(A))) { \ if (mhdf_isError(&(A))) { \
MB_SET_ERR_CONT(mhdf_message(&(A))); \ MB_SET_ERR_CONT(mhdf_message(&(A))); \
myassert(0); \ assert(0); \
mhdf_closeData(filePtr, (B), &(A)); \ mhdf_closeData(filePtr, (B), &(A)); \
return error(MB_FAILURE); \ return error(MB_FAILURE); \
} \ } \
...@@ -191,7 +171,7 @@ do { \ ...@@ -191,7 +171,7 @@ do { \
do { \ do { \
if (mhdf_isError(&(A))) { \ if (mhdf_isError(&(A))) { \
MB_SET_ERR_CONT(mhdf_message(&(A))); \ MB_SET_ERR_CONT(mhdf_message(&(A))); \
myassert(0); \ assert(0); \
mhdf_closeData(filePtr, (B)[0], &(A)); \ mhdf_closeData(filePtr, (B)[0], &(A)); \
mhdf_closeData(filePtr, (B)[1], &(A)); \ mhdf_closeData(filePtr, (B)[1], &(A)); \
return error(MB_FAILURE); \ return error(MB_FAILURE); \
...@@ -202,7 +182,7 @@ do { \ ...@@ -202,7 +182,7 @@ do { \
do { \ do { \
if (mhdf_isError(&(A))) { \ if (mhdf_isError(&(A))) { \
MB_SET_ERR_CONT(mhdf_message(&(A))); \ MB_SET_ERR_CONT(mhdf_message(&(A))); \
myassert(0); \ assert(0); \
mhdf_closeData(filePtr, (B)[0], &(A)); \ mhdf_closeData(filePtr, (B)[0], &(A)); \
mhdf_closeData(filePtr, (B)[1], &(A)); \ mhdf_closeData(filePtr, (B)[1], &(A)); \
mhdf_closeData(filePtr, (B)[2], &(A)); \ mhdf_closeData(filePtr, (B)[2], &(A)); \
...@@ -214,7 +194,7 @@ do { \ ...@@ -214,7 +194,7 @@ do { \
do { \ do { \
if (mhdf_isError(&(A))) { \ if (mhdf_isError(&(A))) { \
MB_SET_ERR_CONT(mhdf_message(&(A))); \ MB_SET_ERR_CONT(mhdf_message(&(A))); \
myassert(0); \ assert(0); \
mhdf_closeData(filePtr, (B), &(A)); \ mhdf_closeData(filePtr, (B), &(A)); \
if (C) mhdf_closeData(filePtr, (D), &(A)); \ if (C) mhdf_closeData(filePtr, (D), &(A)); \
return error(MB_FAILURE); \ return error(MB_FAILURE); \
...@@ -234,7 +214,7 @@ do { \ ...@@ -234,7 +214,7 @@ do { \
if (MB_SUCCESS != (A)) { \ if (MB_SUCCESS != (A)) { \
MB_CHK_ERR_CONT((A)); \ MB_CHK_ERR_CONT((A)); \
mhdf_closeData(filePtr, (B), &(C)); \ mhdf_closeData(filePtr, (B), &(C)); \
myassert(0); \ assert(0); \
return error(A); \ return error(A); \
} \ } \
} while (false) } while (false)
...@@ -246,7 +226,7 @@ do { \ ...@@ -246,7 +226,7 @@ do { \
mhdf_closeData(filePtr, (B)[0], &(C)); \ mhdf_closeData(filePtr, (B)[0], &(C)); \
mhdf_closeData(filePtr, (B)[1], &(C)); \ mhdf_closeData(filePtr, (B)[1], &(C)); \
write_finished(); \ write_finished(); \
myassert(0); \ assert(0); \
return error(A); \ return error(A); \
} \ } \
} while (false) } while (false)
...@@ -259,7 +239,7 @@ do { \ ...@@ -259,7 +239,7 @@ do { \
mhdf_closeData(filePtr, (B)[1], &(C)); \ mhdf_closeData(filePtr, (B)[1], &(C)); \
mhdf_closeData(filePtr, (B)[2], &(C)); \ mhdf_closeData(filePtr, (B)[2], &(C)); \
write_finished(); \ write_finished(); \
myassert(0); \ assert(0); \
return error(A); \ return error(A); \
} \ } \
} while (false) } while (false)
...@@ -272,7 +252,7 @@ do { \ ...@@ -272,7 +252,7 @@ do { \
if (C) \ if (C) \
mhdf_closeData(filePtr, (D), &(E)); \ mhdf_closeData(filePtr, (D), &(E)); \
write_finished(); \ write_finished(); \
myassert(0); \ assert(0); \
return error(A); \ return error(A); \
} \ } \
} while (false) } while (false)
......
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