summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2004-09-04 21:06:48 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2004-09-04 21:06:48 (GMT)
commit922e8a4a8b84f4a04548ac2928e37d67c23c81cb (patch)
tree59f636a2755524a0d3e9a827df90d0699d5918ca
parent45b23cfce11d5267849f0a58216cab581012b8a7 (diff)
downloadhdf5-922e8a4a8b84f4a04548ac2928e37d67c23c81cb.zip
hdf5-922e8a4a8b84f4a04548ac2928e37d67c23c81cb.tar.gz
hdf5-922e8a4a8b84f4a04548ac2928e37d67c23c81cb.tar.bz2
[svn-r9208] Purpose: Bug fix
Description: A few items were left out when tried to restore the old Error API. There are also a few minor bug fixes. Platforms tested: arabica fuss h5committest.
-rw-r--r--src/H5Edefin.h3
-rw-r--r--src/H5Einit.h13
-rw-r--r--src/H5Epubgen.h5
-rw-r--r--src/H5Eterm.h4
-rw-r--r--src/H5TS.c6
-rw-r--r--test/ttsafe_error.c6
6 files changed, 28 insertions, 9 deletions
diff --git a/src/H5Edefin.h b/src/H5Edefin.h
index fc629bb..0545043 100644
--- a/src/H5Edefin.h
+++ b/src/H5Edefin.h
@@ -20,6 +20,7 @@
#define _H5Edefin_H
/* Major error IDs */
+hid_t H5E_NONE_MAJOR_g = FAIL; /* No error */
hid_t H5E_DATASET_g = FAIL; /* Dataset */
hid_t H5E_FUNC_g = FAIL; /* Function entry/exit */
hid_t H5E_STORAGE_g = FAIL; /* Data storage */
@@ -50,6 +51,8 @@ hid_t H5E_CACHE_g = FAIL; /* Object cache */
/* Minor error IDs */
+hid_t H5E_NONE_MINOR_g = FAIL; /* No error */
+
/* Generic low-level file I/O errors */
hid_t H5E_SEEKERROR_g = FAIL; /* Seek failed */
hid_t H5E_READERROR_g = FAIL; /* Read failed */
diff --git a/src/H5Einit.h b/src/H5Einit.h
index 0e43071..962e1ff 100644
--- a/src/H5Einit.h
+++ b/src/H5Einit.h
@@ -22,7 +22,11 @@
/*********************/
/* Major error codes */
/*********************/
-
+assert(H5E_NONE_MAJOR_g==(-1));
+if((msg = H5E_create_msg(cls, H5E_MAJOR, "No Error"))==NULL)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
+if((H5E_NONE_MAJOR_g = H5I_register(H5I_ERROR_MSG, msg))<0)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
assert(H5E_DATASET_g==(-1));
if((msg = H5E_create_msg(cls, H5E_MAJOR, "Dataset"))==NULL)
HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
@@ -162,7 +166,12 @@ if((H5E_CACHE_g = H5I_register(H5I_ERROR_MSG, msg))<0)
/*********************/
/* Minor error codes */
/*********************/
-
+/* No error */
+assert(H5E_NONE_MINOR_g==(-1));
+if((msg = H5E_create_msg(cls, H5E_MINOR, "Read failed"))==NULL)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed")
+if((H5E_NONE_MINOR_g = H5I_register(H5I_ERROR_MSG, msg))<0)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message")
/* Generic low-level file I/O errors */
assert(H5E_SEEKERROR_g==(-1));
diff --git a/src/H5Epubgen.h b/src/H5Epubgen.h
index e59e53b..761483b 100644
--- a/src/H5Epubgen.h
+++ b/src/H5Epubgen.h
@@ -23,6 +23,7 @@
/* Major error codes */
/*********************/
+#define H5E_NONE_MAJOR (H5OPEN H5E_NONE_MAJOR_g)
#define H5E_DATASET (H5OPEN H5E_DATASET_g)
#define H5E_FUNC (H5OPEN H5E_FUNC_g)
#define H5E_STORAGE (H5OPEN H5E_STORAGE_g)
@@ -50,6 +51,7 @@
#define H5E_ERROR (H5OPEN H5E_ERROR_g)
#define H5E_PLINE (H5OPEN H5E_PLINE_g)
#define H5E_CACHE (H5OPEN H5E_CACHE_g)
+H5_DLLVAR hid_t H5E_NONE_MAJOR_g; /* No error */
H5_DLLVAR hid_t H5E_DATASET_g; /* Dataset */
H5_DLLVAR hid_t H5E_FUNC_g; /* Function entry/exit */
H5_DLLVAR hid_t H5E_STORAGE_g; /* Data storage */
@@ -81,6 +83,9 @@ H5_DLLVAR hid_t H5E_CACHE_g; /* Object cache */
/*********************/
/* Minor error codes */
/*********************/
+/* No error */
+#define H5E_NONE_MINOR (H5OPEN H5E_NONE_MINOR_g)
+H5_DLLVAR hid_t H5E_NONE_MINOR_g; /* No error */
/* Generic low-level file I/O errors */
#define H5E_SEEKERROR (H5OPEN H5E_SEEKERROR_g)
diff --git a/src/H5Eterm.h b/src/H5Eterm.h
index 4f5bda9..e52c87b 100644
--- a/src/H5Eterm.h
+++ b/src/H5Eterm.h
@@ -20,7 +20,7 @@
#define _H5Eterm_H
/* Reset major error IDs */
-
+H5E_NONE_MAJOR_g=
H5E_DATASET_g=
H5E_FUNC_g=
H5E_STORAGE_g=
@@ -51,6 +51,8 @@ H5E_CACHE_g= (-1);
/* Reset minor error IDs */
+/* No error */
+H5E_NONE_MINOR_g=
/* Generic low-level file I/O errors */
H5E_SEEKERROR_g=
diff --git a/src/H5TS.c b/src/H5TS.c
index ead5962..51fc0a9 100644
--- a/src/H5TS.c
+++ b/src/H5TS.c
@@ -154,7 +154,7 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex)
mutex->owner_thread = H5MM_malloc(sizeof(pthread_t));
if (!mutex->owner_thread) {
- H5E_push(NULL, "H5TS_mutex_lock", __FILE__, __LINE__,
+ H5E_push_stack(NULL, "H5TS_mutex_lock", __FILE__, __LINE__,
H5E_ERR_CLS_g, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed");
return FAIL;
}
@@ -170,7 +170,7 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex)
mutex->owner_thread = H5MM_malloc(sizeof(pthread_t));
if (!mutex->owner_thread) {
- H5E_push(NULL, "H5TS_mutex_lock",
+ H5E_push_stack(NULL, "H5TS_mutex_lock",
__FILE__, __LINE__, H5E_ERR_CLS_g, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed");
return FAIL;
}
@@ -283,7 +283,7 @@ H5TS_cancel_count_inc(void)
cancel_counter = H5MM_calloc(sizeof(H5TS_cancel_t));
if (!cancel_counter) {
- H5E_push(NULL, "H5TS_cancel_count_inc",
+ H5E_push_stack(NULL, "H5TS_cancel_count_inc",
__FILE__, __LINE__, H5E_ERR_CLS_g, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed");
return FAIL;
}
diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c
index 8f35a84..a946a40 100644
--- a/test/ttsafe_error.c
+++ b/test/ttsafe_error.c
@@ -166,10 +166,10 @@ void *tts_error_thread(void UNUSED *arg)
H5Eset_auto(error_callback, NULL);
#else /*H5_WANT_H5_V1_6_COMPAT*/
/* preserve previous error stack handler */
- H5Eget_auto(H5E_DEFAULT, &old_error_cb, &old_error_client_data);
+ H5Eget_auto_stack(H5E_DEFAULT, &old_error_cb, &old_error_client_data);
/* set each thread's error stack handler */
- H5Eset_auto(H5E_DEFAULT, error_callback, NULL);
+ H5Eset_auto_stack(H5E_DEFAULT, error_callback, NULL);
#endif /* H5_WANT_H5_V1_6_COMPAT */
/* define dataspace for dataset */
@@ -218,7 +218,7 @@ herr_t error_callback(hid_t estack, void *client_data)
pthread_mutex_lock(&error_mutex);
error_count++;
pthread_mutex_unlock(&error_mutex);
- return H5Ewalk(estack, H5E_WALK_DOWNWARD, walk_error_callback, client_data);
+ return H5Ewalk_stack(estack, H5E_WALK_DOWNWARD, walk_error_callback, client_data);
}
#endif /* H5_WANT_H5_V1_6_COMPAT */